Skip to content

Commit

Permalink
Fix list checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesypoof committed Aug 26, 2016
1 parent bc9cb2c commit 8359700
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion couch/theme/_system/content_list_inner_comments.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<cms:set my_paginator="<cms:render 'paginator' />" 'parent' />

<div class="select-all">
<cms:render 'list_checkbox' for_header='1' />
<cms:render 'list_checkbox' for_header='1' text_label='1' />
</div>
</cms:if>
</cms:comments>
Expand Down
2 changes: 1 addition & 1 deletion couch/theme/_system/content_list_inner_gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h4><cms:localize 'folder_empty' /></h4>

<div style="clear:both;"></div>
<div class="select-all">
<cms:render 'list_checkbox' for_header='1' />
<cms:render 'list_checkbox' for_header='1' text_label='1' />
</div>
</cms:if>
</cms:pages>
Expand Down
11 changes: 8 additions & 3 deletions couch/theme/_system/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ function _render_alert( $heading='', $content='', $type='', $center='' ){
$CTX->set( 'k_alert_center', $center == '1' ? '1' : '0' );
}

function _render_list_checkbox( $for_header=0 ){
function _render_list_checkbox( $for_header=0, $text_label=0 ){
global $CTX, $FUNCS;

$page_id = $CTX->get( 'k_page_id' );
Expand All @@ -1117,10 +1117,15 @@ function _render_list_checkbox( $for_header=0 ){
if( $for_header ){
$html = '<label class="ctrl checkbox">';
$html .= '<input class="checkbox-all" type="checkbox" name="check-all" />';
$html .= '<span class="ctrl-option"></span>'.$FUNCS->t('select-deselect').'</label>';
if( $text_label ){
$html .= '<span class="ctrl-option"></span>'.$FUNCS->t('select-deselect').'</label>';
}
else{
$html .= '<span class="ctrl-option tt" title="'.$FUNCS->t('select-deselect').'"></span></label>';
}
}
else{
$html = '<label class="ctrl checkbox">';
$html = '<label class="ctrl checkbox'.( !$can_delete ? ' ctrl-disabled' : '' ).'">';
$html .= '<input type="checkbox" value="'.$page_id.'" class="page-selector checkbox-item" name="page-id[]" id="page-selector-'.$page_id.'"';
if( !$can_delete ) $html .= ' disabled="1"';
$html .= '/>';
Expand Down

0 comments on commit 8359700

Please sign in to comment.