diff --git a/includes/attachments.php b/includes/attachments.php index f81419a1..37497e2a 100644 --- a/includes/attachments.php +++ b/includes/attachments.php @@ -472,7 +472,7 @@ public function generate_rewrite_rules() { ); } - return $rules; + return apply_filters( 'bp_docs_attachments_generate_rewrite_rules', $rules, $this ); } /** @@ -733,6 +733,11 @@ public function admin_notice() { </rule> '; } + if ( $is_apache ) { + $help_url = 'https://github.com/boonebgorges/buddypress-docs/wiki/Attachment-Privacy#apache'; + $help_p = __( 'It looks like you are running Apache. The most likely cause of your problem is that the AllowOverride directive has been disabled, either globally (httpd.conf) or in a VirtualHost definition. Contact your host for assistance.', 'bp-docs' ); + } + ?>
diff --git a/includes/component.php b/includes/component.php index 2dd26f31..c7dbc85b 100644 --- a/includes/component.php +++ b/includes/component.php @@ -1116,6 +1116,7 @@ function enqueue_scripts() { 'upload_title' => __( 'Upload File', 'bp-docs' ), 'upload_button' => __( 'OK', 'bp-docs' ), 'still_working' => __( 'Still working?', 'bp-docs' ), + 'and_x_more' => __( 'and %d more', 'bp-docs' ), ); if ( bp_docs_is_doc_edit() ) { diff --git a/includes/css/screen.css b/includes/css/screen.css index 71eab987..56793619 100644 --- a/includes/css/screen.css +++ b/includes/css/screen.css @@ -1 +1 @@ -.hide-if-no-js{display:none}.description{font-weight:normal;font-style:italic}.description code{font-style:normal;background:#eee;padding:2px 4px}#bp-create-doc-button{float:right;margin:5px 19px;font-weight:bold}body.bp-docs div.page ul{list-style-type:none}#bp-docs-all-docs{width:auto}.doc-tabs{overflow:hidden}.doc-tabs ul{padding-left:0}.doc-tabs li{float:left;margin:0 5px;list-style-type:none}.doc-tabs li:first-child{margin-left:0}.doc-tabs li a{background:#f1f1f1;text-decoration:none;display:block;padding:4px 10px;border-radius:5px 5px 0 0}.doc-tabs li.current a{background:#f3f3f3;color:#555;font-weight:bold}.doc-header h4{margin-bottom:15px !important}.docs-filter{display:block;width:400px;float:left;margin-bottom:15px}.doc-search{float:right;width:250px;text-align:right}.docs-filter-tags{width:100%}.docs-filter-tags ul li{display:block;width:120px;float:left;padding:6px}.doctable{border-collapse:separate;border-spacing:0}.doctable p{padding:0;margin:0}.doctable tr:hover .row-actions{visibility:visible}.doctable tr:nth-child(even){background-color:#f3f3f3}.doctable .bp-doc-trashed-doc .attachment-clip-cell{border-left:4px solid red}.bp-docs-trashed-doc-notice{color:red;font-size:.9em;font-style:italic}#buddypress #bp-docs-all-docs li{background:#eee}#buddypress div.doc-permissions{float:none;width:auto;margin-bottom:1em}#buddypress table.doctable td{vertical-align:top}#buddypress table.doctable tr:nth-child(even){background-color:#f3f3f3}#buddypress table.doctable tr th{background-color:#f3f3f3}.row-actions{visibility:hidden;padding:2px 0 0}body.mobile .row-actions{visibility:visible}.row-actions a{color:#999;font-size:11px}.row-actions a.delete{color:#f00}#docs-filter-submit{margin:10px 4px}.title-cell{width:30%}.author-cell,.created-date-cell,.edited-date-cell{text-align:center;width:100px}.current-orderby a{padding-left:20px}.asc a{background:url(../images/sort-col-asc.gif) no-repeat}.desc a{background:url(../images/sort-col-desc.gif) no-repeat}.doc-edit-link{margin:15px 0 20px 0}.doc-meta,#doc-meta,.docs #comments{padding-top:20px;border-top:1px solid #ddd}div.docs-info-header{background:#f3f3f3;padding:5px 10px;margin-bottom:10px}#associated_group_summary .item{padding-top:1em}#associated_group_summary .meta{font-size:11px;color:#888}#associated_group_summary img.avatar{margin-left:0}#doc-attachments-ul{margin-top:1em;list-style-type:none}#doc-attachments-ul li{margin:0px 5px 0px 0;padding:6px}#doc-attachments-ul li.even{background-color:#f3f3f3}#doc-attachments-ul .doc-attachment-delete{float:right;margin-top:.15em;margin-right:.3em}.bp-docs-attachment-clip{cursor:pointer;display:block;margin-top:10px}.doc-attachment-mime-icon{display:block;float:left;width:24px;height:24px;margin-right:5px;background:transparent url("../images/mime-type-sprites.png") no-repeat}.doc-attachment-mime-tar,.doc-attachment-mime-zip,.doc-attachment-mime-gz,.doc-attachment-mime-gzip,.doc-attachment-mime-rar,.doc-attachment-mime-7z{background-position:0 0px}.doc-attachment-mime-mp3,.doc-attachment-mime-m4a,.doc-attachment-mime-m4b,.doc-attachment-mime-ra,.doc-attachment-mime-ram,.doc-attachment-mime-wav,.doc-attachment-mime-ogg,.doc-attachment-mime-oga,.doc-attachment-mime-mid,.doc-attachment-mime-midi,.doc-attachment-mime-wma,.doc-attachment-mime-mka{background-position:0 -40px}.doc-attachment-mime-ics{background-position:0 -80px}.doc-attachment-mime-mdb,.doc-attachment-mime-odb{background-position:0 -120px}.doc-attachment-mime-odg{background-position:0 -160px}.doc-attachment-mime-jpg,.doc-attachment-mime-jpeg,.doc-attachment-mime-gif,.doc-attachment-mime-png,.doc-attachment-mime-bmp,.doc-attachment-mime-tif,.doc-attachment-mime-tiff,.doc-attachment-mime-ico{background-position:0 -200px}.doc-attachment-mime-pdf{background-position:0 -240px}.doc-attachment-mime-xla,.doc-attachment-mime-xls,.doc-attachment-mime-xlt,.doc-attachment-mime-xlw,.doc-attachment-mime-xlsx,.doc-attachment-mime-xlsm,.doc-attachment-mime-xlsb,.doc-attachment-mime-xlsb,.doc-attachment-mime-xlsx,.doc-attachment-mime-xlsm,.doc-attachment-mime-xlam,.doc-attachment-mime-ods,.doc-attachment-mime-odc{background-position:0 -280px}.doc-attachment-mime-txt,.doc-attachment-mime-asc,.doc-attachment-mime-c,.doc-attachment-mime-cc,.doc-attachment-mime-h,.doc-attachment-mime-csv,.doc-attachment-mime-tsv,.doc-attachment-mime-ics,.doc-attachment-mime-rtx,.doc-attachment-mime-css,.doc-attachment-mime-htm,.doc-attachment-mime-html{background-position:0 -320px}.doc-attachment-mime-asf,.doc-attachment-mime-asx,.doc-attachment-mime-wax,.doc-attachment-mime-wmv,.doc-attachment-mime-wmx,.doc-attachment-mime-avi,.doc-attachment-mime-divx,.doc-attachment-mime-flv,.doc-attachment-mime-mov,.doc-attachment-mime-qt,.doc-attachment-mime-mpeg,.doc-attachment-mime-mpg,.doc-attachment-mime-mpe,.doc-attachment-mime-mp4,.doc-attachment-mime-m4v,.doc-attachment-mime-ogv,.doc-attachment-mime-mkv{background-position:0 -360px}body.js .bp-docs-attachment-drawer{display:none}.bp-docs-attachment-drawer h4{margin:.5em 0}.bp-docs-attachment-drawer>ul{list-style-type:none}.bp-docs-attachment-drawer>ul>li{margin-left:0}.toggleable.toggle-closed .toggle-content{display:none}.hide-pane,.show-pane,.paperclip-vertical,.paperclip-jaunty{background:url("../images/bp-docs-ui-sprites.png") no-repeat;display:block;float:left;margin-left:10px;margin-top:5px}.hide-pane{background-position:0 0;width:16px;height:16px}.show-pane{background-position:0 -28px;width:16px;height:16px}.paperclip-vertical{background-position:0 -55px;width:13px;height:36px}.paperclip-jaunty{background-position:0 -105px;width:17px;height:36px}.toggle-switch,.entry-content p.toggle-switch{display:block;font-size:1em;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;border:1px solid #ccc;background-color:#f3f3f3;padding:3px 0;text-indent:16px;margin:16px 0 0}.toggle-switch.active-switch,.entry-content p.toggle-switch.active-switch{-moz-border-radius-bottomleft:10px;-webkit-border-bottom-left-radius:10px;-moz-border-radius-bottomright:10px;-webkit-border-bottom-right-radius:10px;border-radius:3px 3px 0px 0px}.toggle-switch a,.entry-content p.toggle-switch a{color:#757575;text-decoration:none;display:block;width:100%;height:100%}.toggle-switch a:hover,.entry-content p.toggle-switch a:hover{font-weight:bold}.standard-form label.toggle-switch{margin:16px 0 0}.toggle-content{-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;border:1px solid #ccc;border-top:none;overflow:hidden}td.desc-column{width:50%;padding:0px 18px 12px}.docs-info-header .docs-filter{margin-bottom:0}#docs-filter-meta{font-size:.8em;color:#666;margin-bottom:0}a.docs-filter-title{margin:0 7px;text-decoration:none}a.docs-filter-title:visited{color:inherit}a.docs-filter-title.current{font-weight:bold}.docs-filter-section{border:1px solid #ccc;border-radius:2px;font-size:.8em;padding:6px 10px;margin-top:8px;transition:max-height 2s ease;overflow:hidden;position:relative}#docs-filter-section-tags a.tags-action-button,#docs-filter-section-tags a.tags-action-button:visited{display:inline;line-height:3em;text-decoration:none;background:#fff;background-opacity:.5;padding:5px 10px;border-radius:3px}body.js .docs-filter-section{display:none}body.js .docs-filter-section.docs-filter-section-open{display:block}p.currently-viewing{margin-bottom:5px;font-size:.8em;margin-top:8px}p#filter-by-tag{margin-bottom:0}.docs-info-header .toggle-switch{margin-top:8px}ul#tags-list{list-style-type:none;margin-bottom:0;padding:0;-moz-column-count:2;-moz-column-gap:10%;-webkit-column-count:2;-webkit-column-gap:10%;column-count:2;column-gap:10%}ul#tags-list li{margin-left:0}ul#tags-list li.hidden-tag{display:none}ul#tags-list li.tags-ellipses{font-style:italic}.groups-cell{padding-left:10px}.groups-cell ul{list-style-type:none;padding-left:0}.groups-cell ul li{margin-bottom:.5em;margin-left:0}.groups-cell ul li a{vertical-align:middle;font-size:.85em}.groups-cell ul li img.avatar{float:none}select#has-attachment{margin:8px 10px}div#bp-docs-pagination{position:relative;height:30px}div#bp-docs-pagination-count{position:absolute;left:0;top:5px;font-size:.9em;color:#999}div#bp-docs-paginate-links{position:absolute;right:0;top:5px}div#bp-docs-paginate-links a{padding:0 4px}div.doc-content{padding:20px;border:3px solid #f3f3f3}div.doc-content img{margin:10px}div.doc-content img.mceIcon{margin:0}#bp-docs-single-doc-header{overflow:hidden}body.trashed-doc #buddypress{border-left:4px solid red;padding-left:10px}div.doc-permissions{float:right;width:35%;background:#f0f0f0;border:1px solid #ddd;border-radius:3px;padding:4px}div.doc-permissions div:last-child{clear:both}#doc-permissions-summary,#doc-group-summary{font-size:1.0em;padding:3px 12px;border:1px solid}#doc-permissions-summary.doc-public{background:#b2ffb2;border-color:#00ff00}#doc-permissions-summary.doc-limited{background:#ffffe0;border-color:#e6db55}#doc-permissions-summary.doc-private{background:#ffebe8;border-color:#ff0000}a.doc-permissions-toggle{display:block;float:right;font-size:12px;cursor:hand}dl.doc-permissions-types dd,dl.doc-permissions-types dt{height:1.5em}dl.doc-permissions-types dt{width:50%;float:left;clear:left}#doc-group-summary{border-color:#f0f0f0}#doc-group-summary img.avatar{float:none}#doc-permissions-details ul{list-style-type:none;padding-left:0}#doc-permissions-details ul li{margin-bottom:.5em}span.bp-docs-level-icon{display:block;float:left;width:1.2em;height:1.2em;margin:3px 5px}.bp-docs-level-anyone span.bp-docs-level-icon{-moz-border-radius:.6em;-webkit-border-radius:.6em;border-radius:.6em;background:green}.bp-docs-level-friends span.bp-docs-level-icon,.bp-docs-level-loggedin span.bp-docs-level-icon,.bp-docs-level-group-members span.bp-docs-level-icon{width:0;height:0;border-left:.6em solid transparent;border-right:.6em solid transparent;border-bottom:1.2em solid yellow}.bp-docs-level-admins-mods span.bp-docs-level-icon,.bp-docs-level-no-one span.bp-docs-level-icon,.bp-docs-level-creator span.bp-docs-level-icon{background:red}div.doc-is-locked .toggle-content{border:2px solid #f33;margin-top:5px;padding:7px 10px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}div.doc-meta p{margin-bottom:5px}a.nonexistent-doc{color:#f33}h2.doc-title{display:inline-block;width:50%}.comments-closed{padding:10px 20px;background:#f3f3f3;margin-top:10px}#respond{margin-top:20px}.doc-content ul{list-style:disc}.doc-content ol{list-style:decimal}.doc-content li{margin-left:20px}.doc-content blockquote{background:#f3f3f3;padding:5px;margin:10px 30px}div.hidden{display:none}table.group-docs-options td.label{width:200px}table.diff{width:100%}table.diff col.content{width:50%}table.diff tr{background-color:transparent}table.diff td,table.diff th{padding:.5em;font-family:Consolas, Monaco, Courier, monospace;border:none}table.diff .diff-deletedline del,table.diff .diff-addedline ins{text-decoration:none}table.diff .diff-deletedline{background-color:#fdd}table.diff .diff-deletedline del{background-color:#f99}table.diff .diff-addedline{background-color:#dfd}table.diff .diff-addedline ins{background-color:#9f9}#att-info{background-color:#E4F2FD}table#post-revisions{margin-top:20px}@media screen and (min-width: 4em){#docs-filter-section-tags a.tags-action-button,#docs-filter-section-tags a.tags-action-button:visited{display:block;margin-bottom:1em;padding:0;text-align:center}}@media screen and (min-width: 50em){.entry-content ul#tags-list{-moz-column-count:4;-moz-column-gap:5%;-webkit-column-count:4;-webkit-column-gap:5%;column-count:4;column-gap:5%}}@media screen and (min-width: 71em){.entry-content ul#tags-list{-moz-column-count:5;-moz-column-gap:5%;-webkit-column-count:5;-webkit-column-gap:5%;column-count:5;column-gap:5%}}@media screen and (max-width: 820px){.created-date-cell{display:none}}@media screen and (max-width: 620px){.tags-cell{display:none}}@media screen and (max-width: 520px){.groups-cell{display:none}}@media screen and (max-width: 420px){.attachment-clip-cell,.edited-date-cell{display:none}} +.hide-if-no-js{display:none}.description{font-weight:normal;font-style:italic}.description code{font-style:normal;background:#eee;padding:2px 4px}#bp-create-doc-button{float:right;margin:5px 19px;font-weight:bold}body.bp-docs div.page ul{list-style-type:none}#bp-docs-all-docs{width:auto}.doc-tabs{overflow:hidden}.doc-tabs ul{padding-left:0}.doc-tabs li{float:left;margin:0 5px;list-style-type:none}.doc-tabs li:first-child{margin-left:0}.doc-tabs li a{background:#f1f1f1;text-decoration:none;display:block;padding:4px 10px;border-radius:5px 5px 0 0}.doc-tabs li.current a{background:#f3f3f3;color:#555;font-weight:bold}.doc-header h4{margin-bottom:15px !important}.docs-filter{display:block;width:400px;float:left;margin-bottom:15px}.doc-search{float:right;width:250px;text-align:right}.docs-filter-tags{width:100%}.docs-filter-tags ul li{display:block;width:120px;float:left;padding:6px}.doctable{border-collapse:separate;border-spacing:0}.doctable p{padding:0;margin:0}.doctable tr:hover .row-actions{visibility:visible}.doctable tr:nth-child(even){background-color:#f3f3f3}.doctable .bp-doc-trashed-doc .attachment-clip-cell{border-left:4px solid red}.bp-docs-trashed-doc-notice{color:red;font-size:.9em;font-style:italic}#buddypress #bp-docs-all-docs li{background:#eee}#buddypress div.doc-permissions{float:none;width:auto;margin-bottom:1em}#buddypress table.doctable td{vertical-align:top}#buddypress table.doctable tr:nth-child(even){background-color:#f3f3f3}#buddypress table.doctable tr th{background-color:#f3f3f3}.row-actions{visibility:hidden;padding:2px 0 0}body.mobile .row-actions{visibility:visible}.row-actions a{color:#999;font-size:11px}.row-actions a.delete{color:#f00}#docs-filter-submit{margin:10px 4px}.title-cell{width:30%}.author-cell,.created-date-cell,.edited-date-cell{text-align:center;width:100px}.current-orderby a{padding-left:20px}.asc a{background:url(../images/sort-col-asc.gif) no-repeat}.desc a{background:url(../images/sort-col-desc.gif) no-repeat}.doc-edit-link{margin:15px 0 20px 0}.doc-meta,#doc-meta,.docs #comments{padding-top:20px;border-top:1px solid #ddd}div.docs-info-header{background:#f3f3f3;padding:5px 10px;margin-bottom:10px}#associated_group_summary .item{padding-top:1em}#associated_group_summary .meta{font-size:11px;color:#888}#associated_group_summary img.avatar{margin-left:0}#doc-attachments-ul{margin-top:1em;list-style-type:none}#doc-attachments-ul li{margin:0px 5px 0px 0;padding:6px}#doc-attachments-ul li.even{background-color:#f3f3f3}#doc-attachments-ul .doc-attachment-delete{float:right;margin-top:.15em;margin-right:.3em}.bp-docs-attachment-clip{cursor:pointer;display:block;margin-top:10px}.doc-attachment-mime-icon{display:block;float:left;width:24px;height:24px;margin-right:5px;background:transparent url("../images/mime-type-sprites.png") no-repeat}.doc-attachment-mime-tar,.doc-attachment-mime-zip,.doc-attachment-mime-gz,.doc-attachment-mime-gzip,.doc-attachment-mime-rar,.doc-attachment-mime-7z{background-position:0 0px}.doc-attachment-mime-mp3,.doc-attachment-mime-m4a,.doc-attachment-mime-m4b,.doc-attachment-mime-ra,.doc-attachment-mime-ram,.doc-attachment-mime-wav,.doc-attachment-mime-ogg,.doc-attachment-mime-oga,.doc-attachment-mime-mid,.doc-attachment-mime-midi,.doc-attachment-mime-wma,.doc-attachment-mime-mka{background-position:0 -40px}.doc-attachment-mime-ics{background-position:0 -80px}.doc-attachment-mime-mdb,.doc-attachment-mime-odb{background-position:0 -120px}.doc-attachment-mime-odg{background-position:0 -160px}.doc-attachment-mime-jpg,.doc-attachment-mime-jpeg,.doc-attachment-mime-gif,.doc-attachment-mime-png,.doc-attachment-mime-bmp,.doc-attachment-mime-tif,.doc-attachment-mime-tiff,.doc-attachment-mime-ico{background-position:0 -200px}.doc-attachment-mime-pdf{background-position:0 -240px}.doc-attachment-mime-xla,.doc-attachment-mime-xls,.doc-attachment-mime-xlt,.doc-attachment-mime-xlw,.doc-attachment-mime-xlsx,.doc-attachment-mime-xlsm,.doc-attachment-mime-xlsb,.doc-attachment-mime-xlsb,.doc-attachment-mime-xlsx,.doc-attachment-mime-xlsm,.doc-attachment-mime-xlam,.doc-attachment-mime-ods,.doc-attachment-mime-odc{background-position:0 -280px}.doc-attachment-mime-txt,.doc-attachment-mime-asc,.doc-attachment-mime-c,.doc-attachment-mime-cc,.doc-attachment-mime-h,.doc-attachment-mime-csv,.doc-attachment-mime-tsv,.doc-attachment-mime-ics,.doc-attachment-mime-rtx,.doc-attachment-mime-css,.doc-attachment-mime-htm,.doc-attachment-mime-html{background-position:0 -320px}.doc-attachment-mime-asf,.doc-attachment-mime-asx,.doc-attachment-mime-wax,.doc-attachment-mime-wmv,.doc-attachment-mime-wmx,.doc-attachment-mime-avi,.doc-attachment-mime-divx,.doc-attachment-mime-flv,.doc-attachment-mime-mov,.doc-attachment-mime-qt,.doc-attachment-mime-mpeg,.doc-attachment-mime-mpg,.doc-attachment-mime-mpe,.doc-attachment-mime-mp4,.doc-attachment-mime-m4v,.doc-attachment-mime-ogv,.doc-attachment-mime-mkv{background-position:0 -360px}body.js .bp-docs-attachment-drawer{display:none}.bp-docs-attachment-drawer h4{margin:.5em 0}.bp-docs-attachment-drawer>ul{list-style-type:none}.bp-docs-attachment-drawer>ul>li{margin-left:0;clear:left;padding-bottom:0.8em}.toggleable.toggle-closed .toggle-content{display:none}.hide-pane,.show-pane,.paperclip-vertical,.paperclip-jaunty{background:url("../images/bp-docs-ui-sprites.png") no-repeat;display:block;float:left;margin-left:10px;margin-top:5px}.hide-pane{background-position:0 0;width:16px;height:16px}.show-pane{background-position:0 -28px;width:16px;height:16px}.paperclip-vertical{background-position:0 -55px;width:13px;height:36px}.paperclip-jaunty{background-position:0 -105px;width:17px;height:36px}.toggle-switch,.entry-content p.toggle-switch{display:block;font-size:1em;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;border:1px solid #ccc;background-color:#f3f3f3;padding:3px 0;text-indent:16px;margin:16px 0 0}.toggle-switch.active-switch,.entry-content p.toggle-switch.active-switch{-moz-border-radius-bottomleft:10px;-webkit-border-bottom-left-radius:10px;-moz-border-radius-bottomright:10px;-webkit-border-bottom-right-radius:10px;border-radius:3px 3px 0px 0px}.toggle-switch a,.entry-content p.toggle-switch a{color:#757575;text-decoration:none;display:block;width:100%;height:100%}.toggle-switch a:hover,.entry-content p.toggle-switch a:hover{font-weight:bold}.standard-form label.toggle-switch{margin:16px 0 0}.toggle-content{-moz-border-radius-bottomleft:2px;-webkit-border-bottom-left-radius:2px;-moz-border-radius-bottomright:2px;-webkit-border-bottom-right-radius:2px;border:1px solid #ccc;border-top:none;overflow:hidden}td.desc-column{width:50%;padding:0px 18px 12px}.docs-info-header .docs-filter{margin-bottom:0}#docs-filter-meta{font-size:.8em;color:#666;margin-bottom:0}a.docs-filter-title{margin:0 7px;text-decoration:none}a.docs-filter-title:visited{color:inherit}a.docs-filter-title.current{font-weight:bold}.docs-filter-section{border:1px solid #ccc;border-radius:2px;font-size:.8em;padding:6px 10px;margin-top:8px;transition:max-height 2s ease;overflow:hidden;position:relative}#docs-filter-section-tags a.tags-spanning-button,#docs-filter-section-tags a.tags-spanning-button:visited{display:inline;line-height:3em;text-decoration:none;background:#fff;background-opacity:.5;padding:5px 10px;border-radius:3px}#docs-filter-section-tags .and-x-more{white-space:nowrap}body.js .docs-filter-section{display:none}body.js .docs-filter-section.docs-filter-section-open{display:block}p.currently-viewing{margin-bottom:5px;font-size:.8em;margin-top:8px}p#filter-by-tag{margin-bottom:0}.docs-info-header .toggle-switch{margin-top:8px}ul#tags-list{list-style-type:none;margin-bottom:0;padding:0;-moz-column-count:2;-moz-column-gap:10%;-webkit-column-count:2;-webkit-column-gap:10%;column-count:2;column-gap:10%}ul#tags-list li{margin-left:0}ul#tags-list li.hidden-tag{display:none}ul#tags-list li.tags-ellipses{font-style:italic}.groups-cell{padding-left:10px}.groups-cell ul{list-style-type:none;padding-left:0}.groups-cell ul li{margin-bottom:.5em;margin-left:0}.groups-cell ul li a{vertical-align:middle;font-size:.85em}.groups-cell ul li img.avatar{float:none}select#has-attachment{margin:8px 10px}div#bp-docs-pagination{position:relative;height:30px}div#bp-docs-pagination-count{position:absolute;left:0;top:5px;font-size:.9em;color:#999}div#bp-docs-paginate-links{position:absolute;right:0;top:5px}div#bp-docs-paginate-links a{padding:0 4px}div.doc-content{padding:20px;border:3px solid #f3f3f3}div.doc-content img{margin:10px}div.doc-content img.mceIcon{margin:0}#bp-docs-single-doc-header{overflow:hidden}body.trashed-doc #buddypress{border-left:4px solid red;padding-left:10px}div.doc-permissions{float:right;width:35%;background:#f0f0f0;border:1px solid #ddd;border-radius:3px;padding:4px}div.doc-permissions div:last-child{clear:both}#doc-permissions-summary,#doc-group-summary{font-size:1.0em;padding:3px 12px;border:1px solid}#doc-permissions-summary.doc-public{background:#b2ffb2;border-color:#00ff00}#doc-permissions-summary.doc-limited{background:#ffffe0;border-color:#e6db55}#doc-permissions-summary.doc-private{background:#ffebe8;border-color:#ff0000}a.doc-permissions-toggle{display:block;float:right;font-size:12px;cursor:hand}dl.doc-permissions-types dd,dl.doc-permissions-types dt{height:1.5em}dl.doc-permissions-types dt{width:50%;float:left;clear:left}#doc-group-summary{border-color:#f0f0f0}#doc-group-summary img.avatar{float:none}#doc-permissions-details ul{list-style-type:none;padding-left:0}#doc-permissions-details ul li{margin-bottom:.5em}span.bp-docs-level-icon{display:block;float:left;width:1.2em;height:1.2em;margin:3px 5px}.bp-docs-level-anyone span.bp-docs-level-icon{-moz-border-radius:.6em;-webkit-border-radius:.6em;border-radius:.6em;background:green}.bp-docs-level-friends span.bp-docs-level-icon,.bp-docs-level-loggedin span.bp-docs-level-icon,.bp-docs-level-group-members span.bp-docs-level-icon{width:0;height:0;border-left:.6em solid transparent;border-right:.6em solid transparent;border-bottom:1.2em solid yellow}.bp-docs-level-admins-mods span.bp-docs-level-icon,.bp-docs-level-no-one span.bp-docs-level-icon,.bp-docs-level-creator span.bp-docs-level-icon{background:red}div.doc-is-locked .toggle-content{border:2px solid #f33;margin-top:5px;padding:7px 10px;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}div.doc-meta p{margin-bottom:5px}a.nonexistent-doc{color:#f33}h2.doc-title{display:inline-block;width:50%}.comments-closed{padding:10px 20px;background:#f3f3f3;margin-top:10px}#respond{margin-top:20px}.doc-content ul{list-style:disc}.doc-content ol{list-style:decimal}.doc-content li{margin-left:20px}.doc-content blockquote{background:#f3f3f3;padding:5px;margin:10px 30px}div.hidden{display:none}table.group-docs-options td.label{width:200px}table.diff{width:100%}table.diff col.content{width:50%}table.diff tr{background-color:transparent}table.diff td,table.diff th{padding:.5em;font-family:Consolas, Monaco, Courier, monospace;border:none}table.diff .diff-deletedline del,table.diff .diff-addedline ins{text-decoration:none}table.diff .diff-deletedline{background-color:#fdd}table.diff .diff-deletedline del{background-color:#f99}table.diff .diff-addedline{background-color:#dfd}table.diff .diff-addedline ins{background-color:#9f9}#att-info{background-color:#E4F2FD}table#post-revisions{margin-top:20px}@media screen and (min-width: 4em){#docs-filter-section-tags a.tags-spanning-button,#docs-filter-section-tags a.tags-spanning-button:visited{display:block;margin-bottom:1em;padding:0;text-align:center}}@media screen and (min-width: 50em){.entry-content ul#tags-list{-moz-column-count:4;-moz-column-gap:5%;-webkit-column-count:4;-webkit-column-gap:5%;column-count:4;column-gap:5%}}@media screen and (min-width: 71em){.entry-content ul#tags-list{-moz-column-count:5;-moz-column-gap:5%;-webkit-column-count:5;-webkit-column-gap:5%;column-count:5;column-gap:5%}}@media screen and (max-width: 820px){.created-date-cell{display:none}}@media screen and (max-width: 620px){.tags-cell{display:none}}@media screen and (max-width: 520px){.groups-cell{display:none}}@media screen and (max-width: 420px){.attachment-clip-cell,.edited-date-cell{display:none}} diff --git a/includes/functions.php b/includes/functions.php index 30b503b3..01f69f60 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -551,6 +551,42 @@ function bp_docs_get_access_options( $settings_field, $doc_id = 0, $group_id = 0 return $options; } +/** + * Saves the settings associated with a given Doc + * + * @since 1.6.1 + * @param int $doc_id The numeric ID of the doc + * @return null + */ +function bp_docs_save_doc_access_settings( $doc_id ) { + // Two cases: + // 1. User is saving a doc for which he can update the access settings + if ( isset( $_POST['settings'] ) ) { + $settings = ! empty( $_POST['settings'] ) ? $_POST['settings'] : array(); + $verified_settings = bp_docs_verify_settings( $settings, $doc_id, bp_loggedin_user_id() ); + + $new_settings = array(); + foreach ( $verified_settings as $verified_setting_name => $verified_setting ) { + $new_settings[ $verified_setting_name ] = $verified_setting['verified_value']; + if ( $verified_setting['verified_value'] != $verified_setting['original_value'] ) { + $result['message'] = __( 'Your Doc was successfully saved, but some of your access settings have been changed to match the Doc\'s permissions.', 'bp-docs' ); + } + } + update_post_meta( $doc_id, 'bp_docs_settings', $new_settings ); + + // The 'read' setting must also be saved to a taxonomy, for + // easier directory queries + $read_setting = isset( $new_settings['read'] ) ? $new_settings['read'] : 'anyone'; + bp_docs_update_doc_access( $doc_id, $read_setting ); + + // 2. User is saving a doc for which he can't manage the access settings + // isset( $_POST['settings'] ) is false; the access settings section + // isn't included on the edit form + } else { + // Do nothing. + // Leave the access settings intact. + } +} /** * Verifies the settings associated with a given Doc diff --git a/includes/integration-groups.php b/includes/integration-groups.php index c6bb5fd6..95f034de 100644 --- a/includes/integration-groups.php +++ b/includes/integration-groups.php @@ -1442,10 +1442,10 @@ function bp_docs_get_associated_group_id( $doc_id, $doc = false, $single_array = } function bp_docs_set_associated_group_id( $doc_id, $group_id = 0 ) { - if ( 0 == intval( $group_id ) ) { - $term = array(); - } else { + if ( ! empty( $group_id ) ) { $term = bp_docs_get_group_term( $group_id ); + } else { + $term = array(); } wp_set_post_terms( $doc_id, $term, bp_docs_get_associated_item_tax_name(), false ); diff --git a/includes/js/bp-docs.js b/includes/js/bp-docs.js index 35ec584c..4b9ebe38 100644 --- a/includes/js/bp-docs.js +++ b/includes/js/bp-docs.js @@ -7,7 +7,7 @@ jQuery(document).ready(function($){ // If this is an edit page, set the lock if ( $( 'body' ).hasClass( 'bp-docs-edit' ) ) { var lock_data = { - action: 'add_edit_lock', + action: 'add_edit_lock', doc_id: doc_id }; @@ -33,13 +33,13 @@ jQuery(document).ready(function($){ // Fix the wonky tabindex on Text mode $('input#doc-permalink').on('keydown',function(e){ - focus_in_content_area(e); + focus_in_content_area(e); }); // When a Doc is created new, there is no Permalink input $('input#doc-title').on('keydown',function(e){ - if ( ! document.getElementById( 'doc-permalink' ) ) { - focus_in_content_area(e); + if ( ! document.getElementById( 'doc-permalink' ) ) { + focus_in_content_area(e); } }); @@ -66,15 +66,15 @@ jQuery(document).ready(function($){ } // Slide the tags up or down - var rclass, aclass; + var rclass, aclass; if ( $pom.hasClass('show-pane') ) { rclass = 'show-pane'; aclass = 'hide-pane'; - $toggleable.removeClass( 'toggle-open' ).addClass( 'toggle-closed' ); + $toggleable.removeClass( 'toggle-open' ).addClass( 'toggle-closed' ); } else { rclass = 'hide-pane'; aclass = 'show-pane'; - $toggleable.removeClass( 'toggle-closed' ).addClass( 'toggle-open' ); + $toggleable.removeClass( 'toggle-closed' ).addClass( 'toggle-open' ); } $pom.removeClass(rclass); @@ -83,8 +83,13 @@ jQuery(document).ready(function($){ return false; }); - $('#bp-docs-group-enable').click(function(){ - $('#group-doc-options').slideToggle(400); + var $group_enable_toggle = $( '#bp-docs-group-enable' ); + $group_enable_toggle.click(function(){ + if ( $group_enable_toggle.is( ':checked' ) ) { + $('#group-doc-options').show(); + } else { + $('#group-doc-options').hide(); + } }); /* Permissions snapshot toggle */ @@ -128,7 +133,7 @@ jQuery(document).ready(function($){ $dfsection_tags.on( 'click', 'a.tags-action-button', function( e ) { $dfsection_tags.slideUp( 300, function() { - tag_button_action = $( e.target ).hasClass( 'tags-unhide' ) ? 'expand' : 'collapse'; + tag_button_action = $( e.target ).hasClass( 'tags-unhide' ) ? 'expand' : 'collapse'; if ( 'expand' == tag_button_action ) { tags_section_expand( $dfsection_tags ); @@ -147,7 +152,7 @@ jQuery(document).ready(function($){ var filter_id = filter_title_id.split('-').pop(); var filter_to_show_id = 'docs-filter-section-' + filter_id; var showing_filter_id = $('.docs-filter-section-open').attr('id'); - + $('.docs-filter-title').removeClass( 'current' ); filter_title.addClass( 'current' ); @@ -204,12 +209,12 @@ jQuery(document).ready(function($){ } ); // Add an ellipses item - var st = '… and %d more'; - st = st.replace( /%d/, hidden_tag_counter ); + var st = '' + bp_docs.and_x_more + ''; + st = st.replace( /%d/, hidden_tag_counter ); $dfsection_tags_list.append( '
  • ' + st + '
  • ' ); - $dfsection_tags.prepend( 'show all tags' ); + $dfsection_tags.prepend( 'show all tags' ); } /** @@ -219,7 +224,7 @@ jQuery(document).ready(function($){ $section.find( 'a.tags-unhide' ).remove(); $section.find( '.tags-ellipses' ).remove(); $dfsection_tags_items.removeClass( 'hidden-tag' ); - $dfsection_tags.prepend( 'show fewer tags' ); + $dfsection_tags.prepend( 'show fewer tags' ); hidden_tag_counter = 0; } @@ -229,7 +234,7 @@ jQuery(document).ready(function($){ $doc_content = $('textarea#doc_content'); if ( $doc_content.is(':visible') ) { var doccontent = $doc_content.val(); - $doc_content.val(''); + $doc_content.val(''); $doc_content.focus(); $doc_content.val(doccontent); return false; diff --git a/includes/query-builder.php b/includes/query-builder.php index 7766f991..63472997 100644 --- a/includes/query-builder.php +++ b/includes/query-builder.php @@ -440,9 +440,10 @@ function save( $args = false ) { // Check group associations // @todo Move into group integration piece if ( bp_is_active( 'groups' ) ) { - $associated_group_id = isset( $_POST['associated_group_id'] ) ? intval( $_POST['associated_group_id'] ) : 0; + // This group id is only used to check whether the user can associate the doc with the group. + $associated_group_id = isset( $_POST['associated_group_id'] ) ? intval( $_POST['associated_group_id'] ) : null; - if ( $associated_group_id && ! BP_Docs_Groups_Integration::user_can_associate_doc_with_group( bp_loggedin_user_id(), $associated_group_id ) ) { + if ( ! empty( $associated_group_id ) && ! BP_Docs_Groups_Integration::user_can_associate_doc_with_group( bp_loggedin_user_id(), $associated_group_id ) ) { $retval = array( 'message_type' => 'error', 'message' => __( 'You are not allowed to associate a Doc with that group.', 'bp-docs' ), @@ -518,6 +519,7 @@ function save( $args = false ) { } else { // Remove the edit lock delete_post_meta( $this->doc_id, '_edit_lock' ); + delete_post_meta( $this->doc_id, '_bp_docs_last_pinged' ); // When the post has been autosaved, we need to leave a // special success message @@ -538,7 +540,7 @@ function save( $args = false ) { if ( ! empty( $post_id ) ) { // Add to a group, if necessary - if ( isset( $associated_group_id ) ) { + if ( ! is_null( $associated_group_id ) ) { bp_docs_set_associated_group_id( $post_id, $associated_group_id ); } @@ -549,22 +551,7 @@ function save( $args = false ) { update_post_meta( $this->doc_id, 'bp_docs_last_editor', bp_loggedin_user_id() ); // Save settings - $settings = ! empty( $_POST['settings'] ) ? $_POST['settings'] : array(); - $verified_settings = bp_docs_verify_settings( $settings, $post_id, bp_loggedin_user_id() ); - - $new_settings = array(); - foreach ( $verified_settings as $verified_setting_name => $verified_setting ) { - $new_settings[ $verified_setting_name ] = $verified_setting['verified_value']; - if ( $verified_setting['verified_value'] != $verified_setting['original_value'] ) { - $result['message'] = __( 'Your Doc was successfully saved, but some of your access settings have been changed to match the Doc\'s permissions.', 'bp-docs' ); - } - } - update_post_meta( $this->doc_id, 'bp_docs_settings', $new_settings ); - - // The 'read' setting must also be saved to a taxonomy, for - // easier directory queries - $read_setting = isset( $new_settings['read'] ) ? $new_settings['read'] : 'anyone'; - bp_docs_update_doc_access( $this->doc_id, $read_setting ); + bp_docs_save_doc_access_settings( $this->doc_id ); // Increment the revision count $revision_count = get_post_meta( $this->doc_id, 'bp_docs_revision_count', true ); diff --git a/includes/scss/screen.scss b/includes/scss/screen.scss index 0361d928..f5f0d6a5 100644 --- a/includes/scss/screen.scss +++ b/includes/scss/screen.scss @@ -402,6 +402,8 @@ body.js .bp-docs-attachment-drawer { & > ul > li { margin-left: 0; + clear: left; + padding-bottom: 0.8em; } } @@ -530,8 +532,8 @@ a.docs-filter-title.current { position: relative; } -#docs-filter-section-tags a.tags-action-button, -#docs-filter-section-tags a.tags-action-button:visited { +#docs-filter-section-tags a.tags-spanning-button, +#docs-filter-section-tags a.tags-spanning-button:visited { display: inline; line-height: 3em; text-decoration: none; @@ -541,6 +543,10 @@ a.docs-filter-title.current { border-radius: 3px; } +#docs-filter-section-tags .and-x-more { + white-space: nowrap; +} + body.js .docs-filter-section { display: none; } @@ -845,8 +851,8 @@ table#post-revisions { //Media query for most screens, unseen by IE 7 or 8 @media screen and (min-width:4em) { - #docs-filter-section-tags a.tags-action-button, - #docs-filter-section-tags a.tags-action-button:visited { + #docs-filter-section-tags a.tags-spanning-button, + #docs-filter-section-tags a.tags-spanning-button:visited { display: block; // Let the button span the entire box margin-bottom: 1em; padding: 0; diff --git a/loader.php b/loader.php index e648089b..b6dfd287 100644 --- a/loader.php +++ b/loader.php @@ -3,7 +3,7 @@ Plugin Name: BuddyPress Docs Plugin URI: http://github.com/boonebgorges/buddypress-docs Description: Adds collaborative Docs to BuddyPress -Version: 1.6.0 +Version: 1.6.1 Author: Boone B Gorges Author URI: http://boone.gorg.es Licence: GPLv3 @@ -13,7 +13,7 @@ It's on like Donkey Kong */ -define( 'BP_DOCS_VERSION', '1.6.0' ); +define( 'BP_DOCS_VERSION', '1.6.1' ); // BuddyPress Docs introduces a lot of overhead. Unless otherwise specified, // don't load the plugin on subsites of an MS install diff --git a/readme.txt b/readme.txt index 3ce9c01a..3287fdea 100755 --- a/readme.txt +++ b/readme.txt @@ -4,8 +4,8 @@ Donate link: http://teleogistic.net/donate Tags: buddypress, docs, wiki, documents, collaboration Requires at least: WordPress 3.3, BuddyPress 1.5 Tested up to: WordPress 3.9, BuddyPress 2.0.0 -Stable tag: 1.6.0 - +Stable tag: 1.6.1 + Adds collaborative Docs to BuddyPress. == Description == @@ -33,6 +33,15 @@ This plugin is in active development. For feature requests and bug reports, visi == Changelog == += 1.6.1 = +* Fix a bug where group associations could be lost when Docs were edited by non-admins +* Add a filter for auto-generated Apache attachment rewrite rules +* Better error notice for Apache users with AllowOverride issues +* Improved layout of attachment drawer +* Improved appearance and localizability for "and x more" tags link +* More reliable toggling of settings during group creation +* Fix bug that prevented edit lock from being cleared on doc save + = 1.6.0 = * Overhaul of the way group/user tag clouds work * Improved support for attachments on nginx and IIS @@ -193,7 +202,7 @@ This plugin is in active development. For feature requests and bug reports, visi * Fixes bug that prevented front-end doc deletion * Removes temporarily non-functional doc counts from group tabs -= 1.2.3 = += 1.2.3 = * Fixes bug with bp-pages = 1.2.2 = diff --git a/tests/test-bp-docs.php b/tests/test-bp-docs.php index f397b16a..90c22ab2 100644 --- a/tests/test-bp-docs.php +++ b/tests/test-bp-docs.php @@ -117,7 +117,7 @@ function test_delete_group_association() { $this->go_to( $permalink ); // Just to be sure - unset( $_POST['associated_group_id'] ); + $_POST['associated_group_id'] = ''; // We need this dummy $_POST data to make the save go through. Ugh $doc = $this->factory->doc->get_object_by_id( $doc_id );