bring lockstate to webpages

This commit is contained in:
Mario Vavti 2015-04-21 23:08:54 +02:00
parent 21704ecb93
commit e58e8f3f75
3 changed files with 12 additions and 5 deletions

View File

@ -142,6 +142,9 @@ function webpages_content(&$a) {
$pages = array();
foreach($r as $rr) {
unobscure($rr);
$lockstate = (($rr['allow_cid'] || $rr['allow_gid'] || $rr['deny_cid'] || $rr['deny_gid']) ? 'lock' : 'unlock');
$element_arr = array(
'type' => 'webpage',
'title' => $rr['title'],
@ -159,7 +162,8 @@ function webpages_content(&$a) {
'title' => $rr['title'],
'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']),
'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']),
'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]'
'bb_element' => '[element]' . base64url_encode(json_encode($element_arr)) . '[/element]',
'lockstate' => $lockstate
);
}
}

View File

@ -15,14 +15,14 @@
padding: 7px 3px 7px 10px;
}
#webpage-list-table th:nth-child(6),
#webpage-list-table td:nth-child(6){
#webpage-list-table th:nth-child(7),
#webpage-list-table td:nth-child(7){
padding: 7px 3px;
white-space: nowrap;
}
#webpage-list-table th:nth-child(7),
#webpage-list-table td:nth-child(7){
#webpage-list-table th:nth-child(8),
#webpage-list-table td:nth-child(8){
padding: 7px 10px 7px 7px;
white-space: nowrap;
}

View File

@ -21,6 +21,7 @@
<th width="1%"></th>
<th width="1%"></th>
<th width="1%"></th>
<th width="1%"></th>
<th width="1%" class="hidden-xs">{{$created_txt}}</th>
<th width="1%" class="hidden-xs">{{$edited_txt}}</th>
</tr>
@ -38,6 +39,8 @@
{{$item.title}}
</td>
<td class="webpage-list-tool">
{{if $item.lockstate=='lock'}}<i class="icon-lock dropdown-toggle lockview" data-toggle="dropdown" onclick="lockview('item',{{$item.url}});" ></i><ul id="panel-{{$item.url}}" class="lockview-panel dropdown-menu"></ul>{{/if}}
<td class="webpage-list-tool">
{{if $edit}}<a href="{{$baseurl}}/{{$item.url}}" title="{{$edit}}"><i class="icon-pencil"></i></a>{{/if}}
</td>
<td class="webpage-list-tool">