diff options
author | zotlabs <mike@macgirvin.com> | 2016-12-25 14:26:27 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2016-12-25 14:26:27 -0800 |
commit | c38e7ee3e3a46e56a3894b2fe40b74206cdd8762 (patch) | |
tree | 2bd029c94d12e02633995c227c5ec683cada86cb /include/conversation.php | |
parent | 9f9b1d3ce600787cb17c1d46aea022a3a9cfd376 (diff) | |
download | volse-hubzilla-c38e7ee3e3a46e56a3894b2fe40b74206cdd8762.tar.gz volse-hubzilla-c38e7ee3e3a46e56a3894b2fe40b74206cdd8762.tar.bz2 volse-hubzilla-c38e7ee3e3a46e56a3894b2fe40b74206cdd8762.zip |
show webpages link to visitors if a 'home' page exists. This means the nav menu must be used to edit pages.
Diffstat (limited to 'include/conversation.php')
-rw-r--r-- | include/conversation.php | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/include/conversation.php b/include/conversation.php index 1673bc9fb..941b55159 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1786,6 +1786,20 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ $cal_link = '/cal/' . $nickname; } + require_once('include/security.php'); + $sql_options = item_permissions_sql($uid); + + $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 item.item_deleted = 0 + and ( iconfig.k = 'WEBPAGE' and item_type = %d ) + $sql_options limit 1", + intval($uid), + dbesc('home'), + intval(ITEM_TYPE_WEBPAGE) + ); + + $has_webpages = (($r) ? true : false); if (get_pconfig($uid, 'system', 'noprofiletabs')) return; @@ -1870,15 +1884,16 @@ function profile_tabs($a, $is_owner = false, $nickname = null){ ); } - if ($p['write_pages'] && feature_enabled($uid,'webpages')) { + if($has_webpages && feature_enabled($uid,'webpages')) { $tabs[] = array( 'label' => t('Webpages'), - 'url' => z_root() . '/webpages/' . $nickname, + 'url' => z_root() . '/page/' . $nickname . '/home', 'sel' => ((argv(0) == 'webpages') ? 'active' : ''), - 'title' => t('Manage Webpages'), + 'title' => t('View Webpages'), 'id' => 'webpages-tab', ); - } + } + if(feature_enabled($uid,'wiki') && (get_account_techlevel($account_id) > 3)) { $tabs[] = array( |