apporder style improvement and add to nav menu, also add language awareness to webpages
This commit is contained in:
parent
1c8c7479b8
commit
7ae0317b6a
@ -112,7 +112,7 @@ class Editwebpage extends \Zotlabs\Web\Controller {
|
|||||||
intval($itm[0]['id'])
|
intval($itm[0]['id'])
|
||||||
);
|
);
|
||||||
if($item_id)
|
if($item_id)
|
||||||
$page_title = $item_id[0]['v'];
|
$page_title = str_replace('%2f','/',$item_id[0]['v']);
|
||||||
|
|
||||||
$mimetype = $itm[0]['mimetype'];
|
$mimetype = $itm[0]['mimetype'];
|
||||||
|
|
||||||
|
@ -43,11 +43,31 @@ class Page extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$channel_address = argv(1);
|
$channel_address = argv(1);
|
||||||
|
|
||||||
|
// Always look first for the page name prefixed by the observer language; for instance page/nickname/de/foo
|
||||||
|
// followed by page/nickname/foo if that is not found.
|
||||||
|
// If your browser language is de and you want to access the default in this case,
|
||||||
|
// use page/nickname/-/foo to over-ride the language and access only the page with pagelink of 'foo'
|
||||||
|
|
||||||
|
$page_name = '';
|
||||||
|
$ignore_language = false;
|
||||||
|
|
||||||
|
for($x = 2; $x < argc(); $x ++) {
|
||||||
|
if($page_name === '' && argv($x) === '-') {
|
||||||
|
$ignore_language = true;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if($page_name)
|
||||||
|
$page_name .= '/';
|
||||||
|
$page_name .= argv($x);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// The page link title was stored in a urlencoded format
|
// The page link title was stored in a urlencoded format
|
||||||
// php or the browser may/will have decoded it, so re-encode it for our search
|
// php or the browser may/will have decoded it, so re-encode it for our search
|
||||||
|
|
||||||
$page_id = urlencode(argv(2));
|
$page_id = urlencode($page_name);
|
||||||
|
$lang_page_id = urlencode(\App::$language . '/' . $page_name);
|
||||||
|
|
||||||
$u = q("select channel_id from channel where channel_address = '%s' limit 1",
|
$u = q("select channel_id from channel where channel_address = '%s' limit 1",
|
||||||
dbesc($channel_address)
|
dbesc($channel_address)
|
||||||
);
|
);
|
||||||
@ -64,16 +84,31 @@ class Page extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
require_once('include/security.php');
|
require_once('include/security.php');
|
||||||
$sql_options = item_permissions_sql($u[0]['channel_id']);
|
$sql_options = item_permissions_sql($u[0]['channel_id']);
|
||||||
|
|
||||||
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
|
$r = null;
|
||||||
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
|
|
||||||
and (( iconfig.k = 'WEBPAGE' and item_type = %d )
|
if(! $ignore_language) {
|
||||||
OR ( iconfig.k = 'PDL' AND item_type = %d )) $sql_options $revision limit 1",
|
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
|
||||||
intval($u[0]['channel_id']),
|
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
|
||||||
dbesc($page_id),
|
and (( iconfig.k = 'WEBPAGE' and item_type = %d )
|
||||||
intval(ITEM_TYPE_WEBPAGE),
|
OR ( iconfig.k = 'PDL' AND item_type = %d )) $sql_options $revision limit 1",
|
||||||
intval(ITEM_TYPE_PDL)
|
intval($u[0]['channel_id']),
|
||||||
);
|
dbesc($lang_page_id),
|
||||||
|
intval(ITEM_TYPE_WEBPAGE),
|
||||||
|
intval(ITEM_TYPE_PDL)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if(! $r) {
|
||||||
|
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
|
||||||
|
where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
|
||||||
|
and (( iconfig.k = 'WEBPAGE' and item_type = %d )
|
||||||
|
OR ( iconfig.k = 'PDL' AND item_type = %d )) $sql_options $revision limit 1",
|
||||||
|
intval($u[0]['channel_id']),
|
||||||
|
dbesc($page_id),
|
||||||
|
intval(ITEM_TYPE_WEBPAGE),
|
||||||
|
intval(ITEM_TYPE_PDL)
|
||||||
|
);
|
||||||
|
}
|
||||||
if(! $r) {
|
if(! $r) {
|
||||||
|
|
||||||
// Check again with no permissions clause to see if it is a permissions issue
|
// Check again with no permissions clause to see if it is a permissions issue
|
||||||
|
@ -218,13 +218,13 @@ class Webpages extends \Zotlabs\Web\Controller {
|
|||||||
'created' => $rr['created'],
|
'created' => $rr['created'],
|
||||||
'edited' => $rr['edited'],
|
'edited' => $rr['edited'],
|
||||||
'mimetype' => $rr['mimetype'],
|
'mimetype' => $rr['mimetype'],
|
||||||
'pagetitle' => $rr['v'],
|
'pagetitle' => str_replace('%2f','/',$rr['v']),
|
||||||
'mid' => $rr['mid'],
|
'mid' => $rr['mid'],
|
||||||
'layout_mid' => $rr['layout_mid']
|
'layout_mid' => $rr['layout_mid']
|
||||||
);
|
);
|
||||||
$pages[$rr['iid']][] = array(
|
$pages[$rr['iid']][] = array(
|
||||||
'url' => $rr['iid'],
|
'url' => $rr['iid'],
|
||||||
'pagetitle' => $rr['v'],
|
'pagetitle' => str_replace('%2f','/',$rr['v']),
|
||||||
'title' => $rr['title'],
|
'title' => $rr['title'],
|
||||||
'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']),
|
'created' => datetime_convert('UTC',date_default_timezone_get(),$rr['created']),
|
||||||
'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']),
|
'edited' => datetime_convert('UTC',date_default_timezone_get(),$rr['edited']),
|
||||||
|
@ -281,6 +281,7 @@ EOT;
|
|||||||
'$nav_apps' => $nav_apps,
|
'$nav_apps' => $nav_apps,
|
||||||
'$channel_apps' => $channel_apps,
|
'$channel_apps' => $channel_apps,
|
||||||
'$addapps' => t('Add Apps'),
|
'$addapps' => t('Add Apps'),
|
||||||
|
'$orderapps' => t('Arrange Apps'),
|
||||||
'$sysapps_toggle' => t('Toggle System Apps')
|
'$sysapps_toggle' => t('Toggle System Apps')
|
||||||
));
|
));
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
<a class="dropdown-item" href="{{$app.url}}">{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}</a>
|
<a class="dropdown-item" href="{{$app.url}}">{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{if $order}}
|
{{if $order}}
|
||||||
<a href="{{$hosturl}}appman/{{$app.guid}}/moveup"><i class="generic-icons-nav fa fa-fw fa-arrow-up"></i></a>
|
<a href="{{$hosturl}}appman/{{$app.guid}}/moveup" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-up"></i></a>
|
||||||
<a href="{{$hosturl}}appman/{{$app.guid}}/movedown"><i class="generic-icons-nav fa fa-fw fa-arrow-down"></i></a>
|
<a href="{{$hosturl}}appman/{{$app.guid}}/movedown" class="btn btn-outline-secondary btn-sm" style="margin-bottom: 5px;"><i class="generic-icons-nav fa fa-fw fa-arrow-down"></i></a>
|
||||||
{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}<br>
|
{{if $icon}}<i class="generic-icons-nav fa fa-fw fa-{{$icon}}"></i>{{else}}<img src="{{$app.photo}}" width="16" height="16" style="margin-right:9px;"/>{{/if}}{{$app.name}}<br>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -207,6 +207,7 @@
|
|||||||
{{if $localuser}}
|
{{if $localuser}}
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="dropdown-item" href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>{{$addapps}}</a>
|
<a class="dropdown-item" href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>{{$addapps}}</a>
|
||||||
|
<a class="dropdown-item" href="/apporder"><i class="generic-icons-nav fa fa-fw fa-sort"></i>{{$orderapps}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
@ -232,6 +233,7 @@
|
|||||||
{{if $localuser}}
|
{{if $localuser}}
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
<a class="nav-link" href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>{{$addapps}}</a>
|
<a class="nav-link" href="/apps"><i class="generic-icons-nav fa fa-fw fa-plus-circle"></i>{{$addapps}}</a>
|
||||||
|
<a class="dropdown-item" href="/apporder"><i class="generic-icons-nav fa fa-fw fa-sort"></i>{{$orderapps}}</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user