diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Lib/Apps.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Apps.php | 2 | ||||
-rw-r--r-- | Zotlabs/Module/Cards.php | 40 | ||||
-rw-r--r-- | Zotlabs/Module/Channel.php | 15 | ||||
-rw-r--r-- | Zotlabs/Module/Display.php | 14 | ||||
-rw-r--r-- | Zotlabs/Render/Comanche.php | 4 | ||||
-rw-r--r-- | Zotlabs/Widget/Categories.php | 13 |
7 files changed, 58 insertions, 33 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 1d9fe48e6..860a799ef 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -500,7 +500,8 @@ class Apps { '$icon' => $icon, '$hosturl' => $hosturl, '$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''), - '$install' => (($hosturl && in_array($mode, ['view','install'])) ? $install_action : ''), + '$installed' => $installed, + '$action_label' => (($hosturl && in_array($mode, ['view','install'])) ? $install_action : ''), '$edit' => ((local_channel() && $installed && $mode == 'edit') ? t('Edit') : ''), '$delete' => ((local_channel() && $installed && $mode == 'edit') ? t('Delete') : ''), '$undelete' => ((local_channel() && $installed && $mode == 'edit') ? t('Undelete') : ''), diff --git a/Zotlabs/Module/Apps.php b/Zotlabs/Module/Apps.php index 78c8d99ae..11025ce6e 100644 --- a/Zotlabs/Module/Apps.php +++ b/Zotlabs/Module/Apps.php @@ -47,7 +47,7 @@ class Apps extends \Zotlabs\Web\Controller { return replace_macros(get_markup_template('myapps.tpl'), array( '$sitename' => get_config('system','sitename'), '$cat' => $cat, - '$title' => t('Apps'), + '$title' => (($available) ? t('Available Apps') : t('Installed Apps')), '$apps' => $apps, '$authed' => ((local_channel()) ? true : false), '$manage' => (($available) ? '' : t('Manage apps')), diff --git a/Zotlabs/Module/Cards.php b/Zotlabs/Module/Cards.php index f196988a2..f81d9324f 100644 --- a/Zotlabs/Module/Cards.php +++ b/Zotlabs/Module/Cards.php @@ -1,12 +1,16 @@ <?php namespace Zotlabs\Module; +use App; +use Zotlabs\Lib\Apps; +use Zotlabs\Web\Controller; +use Zotlabs\Lib\PermissionDescription; + require_once('include/channel.php'); require_once('include/conversation.php'); require_once('include/acl_selectors.php'); - -class Cards extends \Zotlabs\Web\Controller { +class Cards extends Controller { function init() { @@ -29,22 +33,24 @@ class Cards extends \Zotlabs\Web\Controller { return login(); } - if(! \App::$profile) { + if(! App::$profile) { notice( t('Requested profile is not available.') . EOL ); - \App::$error = 404; + App::$error = 404; return; } - if(! feature_enabled(\App::$profile_uid, 'cards')) { - return; + if(! Apps::system_app_installed(App::$profile_uid, 'Cards')) { + $o = '<b>Cards App - Not Installed:</b><br>'; + $o .= 'Create personal planning cards'; + return $o; } - nav_set_selected(t('Cards')); + nav_set_selected('Cards'); head_add_link([ 'rel' => 'alternate', 'type' => 'application/json+oembed', - 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . \App::$query_string), + 'href' => z_root() . '/oep?f=&url=' . urlencode(z_root() . '/' . App::$query_string), 'title' => 'oembed' ]); @@ -52,7 +58,7 @@ class Cards extends \Zotlabs\Web\Controller { $category = (($_REQUEST['cat']) ? escape_tags(trim($_REQUEST['cat'])) : ''); if($category) { - $sql_extra2 .= protect_sprintf(term_item_parent_query(\App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY)); + $sql_extra2 .= protect_sprintf(term_item_parent_query(App::$profile['profile_uid'], 'item', $category, TERM_CATEGORY)); } @@ -60,11 +66,11 @@ class Cards extends \Zotlabs\Web\Controller { $selected_card = ((argc() > 2) ? argv(2) : ''); - $_SESSION['return_url'] = \App::$query_string; + $_SESSION['return_url'] = App::$query_string; $uid = local_channel(); - $owner = \App::$profile_uid; - $observer = \App::get_observer(); + $owner = App::$profile_uid; + $observer = App::get_observer(); $ob_hash = (($observer) ? $observer['xchan_hash'] : ''); @@ -101,8 +107,8 @@ class Cards extends \Zotlabs\Web\Controller { 'nickname' => $channel['channel_address'], 'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'), - 'acl' => (($is_owner) ? populate_acl($channel_acl, false, - \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_pages')) : ''), + 'acl' => (($is_owner) ? populate_acl($channel_acl, false, + PermissionDescription::fromGlobalPermission('view_pages')) : ''), 'permissions' => $channel_acl, 'showacl' => (($is_owner) ? true : false), 'visitor' => true, @@ -132,8 +138,8 @@ class Cards extends \Zotlabs\Web\Controller { $itemspage = get_pconfig(local_channel(),'system','itemspage'); - \App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); - $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(\App::$pager['itemspage']), intval(\App::$pager['start'])); + App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); + $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start'])); $sql_extra = item_permissions_sql($owner); @@ -171,7 +177,7 @@ class Cards extends \Zotlabs\Web\Controller { WHERE item.uid = %d $item_normal AND item.parent IN ( %s ) $sql_extra $sql_extra2 ", - intval(\App::$profile['profile_uid']), + intval(App::$profile['profile_uid']), dbesc($parents_str) ); if($items) { diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 9d4c23e4c..8941faf56 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -71,6 +71,8 @@ class Channel extends Controller { function get($update = 0, $load = false) { + $noscript_content = get_config('system', 'noscript_content', '1'); + if($load) $_SESSION['loadtime'] = datetime_convert(); @@ -272,7 +274,7 @@ class Channel extends Controller { App::set_pager_itemspage(((intval($itemspage)) ? $itemspage : 20)); $pager_sql = sprintf(" LIMIT %d OFFSET %d ", intval(App::$pager['itemspage']), intval(App::$pager['start'])); - if((! $update) || ($load)) { + if($noscript_content || $load) { if($mid) { $r = q("SELECT parent AS item_id from item where mid like '%s' and uid = %d $item_normal AND item_wall = 1 $sql_extra limit 1", @@ -411,10 +413,17 @@ class Channel extends Controller { $o .= conversation($items,$mode,$update,$page_mode); } else { + $o .= '<noscript>'; - $o .= conversation($items,$mode,$update,'traditional'); - $o .= alt_pager(count($items)); + if($noscript_content) { + $o .= conversation($items,$mode,$update,'traditional'); + $o .= alt_pager(count($items)); + } + else { + $o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to be able to view this content.') . '</div>'; + } $o .= '</noscript>'; + $o .= conversation($items,$mode,$update,$page_mode); if ($mid && $items[0]['title']) diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php index bdaed0933..1d21b64ac 100644 --- a/Zotlabs/Module/Display.php +++ b/Zotlabs/Module/Display.php @@ -12,8 +12,9 @@ class Display extends \Zotlabs\Web\Controller { function get($update = 0, $load = false) { - $module_format = 'html'; + $noscript_content = get_config('system', 'noscript_content', '1'); + $module_format = 'html'; if(argc() > 1) { $module_format = substr(argv(1),strrpos(argv(1),'.') + 1); @@ -251,7 +252,7 @@ class Display extends \Zotlabs\Web\Controller { $sql_extra = public_permissions_sql($observer_hash); - if((! $update) || ($load)) { + if($noscript_content || $load) { $r = null; @@ -367,7 +368,12 @@ class Display extends \Zotlabs\Web\Controller { } else { $o .= '<noscript>'; - $o .= conversation($items, 'display', $update, 'traditional'); + if($noscript_content) { + $o .= conversation($items, 'display', $update, 'traditional'); + } + else { + $o .= '<div class="section-content-warning-wrapper">' . t('You must enable javascript for your browser to be able to view this content.') . '</div>'; + } $o .= '</noscript>'; if ($items[0]['title']) @@ -429,7 +435,7 @@ class Display extends \Zotlabs\Web\Controller { $o .= '<div id="content-complete"></div>'; - if(((! $update) || ($load)) && (! $items)) { + if((($update && $load) || $noscript_content) && (! $items)) { $r = q("SELECT id, item_deleted FROM item WHERE mid = '%s' LIMIT 1", dbesc($item_hash) diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index f58dba60e..cf87cc7d7 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -441,7 +441,7 @@ class Comanche { $path = 'view/js/jquery.js'; break; case 'bootstrap': - $path = 'library/bootstrap/js/bootstrap.min.js'; + $path = 'vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js'; break; case 'foundation': $path = 'library/foundation/js/foundation.js'; @@ -466,7 +466,7 @@ class Comanche { switch($s) { case 'bootstrap': - $path = 'library/bootstrap/css/bootstrap.min.css'; + $path = 'vendor/twbs/bootstrap/dist/css/bootstrap.min.css'; break; case 'foundation': $path = 'library/foundation/css/foundation.min.css'; diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index 9bfa9742a..27d4b5980 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -2,6 +2,9 @@ namespace Zotlabs\Widget; +use App; +use Zotlabs\Lib\Apps; + require_once('include/contact_widgets.php'); class Categories { @@ -10,22 +13,22 @@ class Categories { $cards = ((array_key_exists('cards',$arr) && $arr['cards']) ? true : false); - if(($cards) && (! feature_enabled(\App::$profile['profile_uid'],'cards'))) + if(($cards) && (! Apps::system_app_installed(App::$profile['profile_uid'], 'Cards'))) return ''; $articles = ((array_key_exists('articles',$arr) && $arr['articles']) ? true : false); - if(($articles) && (! feature_enabled(\App::$profile['profile_uid'],'articles'))) + if(($articles) && (! feature_enabled(App::$profile['profile_uid'],'articles'))) return ''; - if((! \App::$profile['profile_uid']) - || (! perm_is_allowed(\App::$profile['profile_uid'],get_observer_hash(),(($cards || $articles) ? 'view_pages' : 'view_stream')))) { + if((! App::$profile['profile_uid']) + || (! perm_is_allowed(App::$profile['profile_uid'],get_observer_hash(),(($cards || $articles) ? 'view_pages' : 'view_stream')))) { return ''; } $cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat'],ENT_COMPAT,'UTF-8') : ''); - $srchurl = (($cards) ? \App::$argv[0] . '/' . \App::$argv[1] : \App::$query_string); + $srchurl = (($cards) ? App::$argv[0] . '/' . App::$argv[1] : App::$query_string); $srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&'); $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl); |