From 16d750d1f6cf0d2866388269e02445630c4e3464 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 15 Mar 2017 20:56:12 -0700 Subject: widgets cont. --- Zotlabs/Widget/Affinity.php | 60 +++++++++++++++++ Zotlabs/Widget/Catcloud_wall.php | 19 ++++++ Zotlabs/Widget/Conversations.php | 74 +++++++++++++++++++++ Zotlabs/Widget/Design_tools.php | 21 ++++++ Zotlabs/Widget/Eventstools.php | 19 ++++++ Zotlabs/Widget/Mailmenu.php | 36 ++++++++++ Zotlabs/Widget/Photo_albums.php | 25 +++++++ Zotlabs/Widget/Settings_menu.php | 137 +++++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Tagcloud_wall.php | 20 ++++++ 9 files changed, 411 insertions(+) create mode 100644 Zotlabs/Widget/Affinity.php create mode 100644 Zotlabs/Widget/Catcloud_wall.php create mode 100644 Zotlabs/Widget/Conversations.php create mode 100644 Zotlabs/Widget/Design_tools.php create mode 100644 Zotlabs/Widget/Eventstools.php create mode 100644 Zotlabs/Widget/Mailmenu.php create mode 100644 Zotlabs/Widget/Photo_albums.php create mode 100644 Zotlabs/Widget/Settings_menu.php create mode 100644 Zotlabs/Widget/Tagcloud_wall.php (limited to 'Zotlabs/Widget') diff --git a/Zotlabs/Widget/Affinity.php b/Zotlabs/Widget/Affinity.php new file mode 100644 index 000000000..439ba1f33 --- /dev/null +++ b/Zotlabs/Widget/Affinity.php @@ -0,0 +1,60 @@ + $cmin . ',' . $cmax, + '$refresh' => t('Refresh'), + '$labels' => $label_str, + )); + + $arr = array('html' => $x); + call_hooks('main_slider',$arr); + return $arr['html']; + } + return ''; + } +} + \ No newline at end of file diff --git a/Zotlabs/Widget/Catcloud_wall.php b/Zotlabs/Widget/Catcloud_wall.php new file mode 100644 index 000000000..3795987cc --- /dev/null +++ b/Zotlabs/Widget/Catcloud_wall.php @@ -0,0 +1,19 @@ + 1) { + + switch(argv(1)) { + case 'combined': + $mailbox = 'combined'; + $header = t('Conversations'); + break; + case 'inbox': + $mailbox = 'inbox'; + $header = t('Received Messages'); + break; + case 'outbox': + $mailbox = 'outbox'; + $header = t('Sent Messages'); + break; + default: + $mailbox = 'combined'; + $header = t('Conversations'); + break; + } + + require_once('include/message.php'); + + // private_messages_list() can do other more complicated stuff, for now keep it simple + $r = private_messages_list(local_channel(), $mailbox, App::$pager['start'], App::$pager['itemspage']); + + if(! $r) { + info( t('No messages.') . EOL); + return $o; + } + + $messages = array(); + + foreach($r as $rr) { + + $messages[] = array( + 'mailbox' => $mailbox, + 'id' => $rr['id'], + 'from_name' => $rr['from']['xchan_name'], + 'from_url' => chanlink_hash($rr['from_xchan']), + 'from_photo' => $rr['from']['xchan_photo_s'], + 'to_name' => $rr['to']['xchan_name'], + 'to_url' => chanlink_hash($rr['to_xchan']), + 'to_photo' => $rr['to']['xchan_photo_s'], + 'subject' => (($rr['seen']) ? $rr['title'] : '' . $rr['title'] . ''), + 'delete' => t('Delete conversation'), + 'body' => $rr['body'], + 'date' => datetime_convert('UTC',date_default_timezone_get(),$rr['created'], 'c'), + 'seen' => $rr['seen'], + 'selected' => ((argv(2)) ? (argv(2) == $rr['id']) : ($r[0]['id'] == $rr['id'])) + ); + } + + $tpl = get_markup_template('mail_head.tpl'); + $o .= replace_macros($tpl, array( + '$header' => $header, + '$messages' => $messages + )); + + } + return $o; + } +} \ No newline at end of file diff --git a/Zotlabs/Widget/Design_tools.php b/Zotlabs/Widget/Design_tools.php new file mode 100644 index 000000000..8ab6a235d --- /dev/null +++ b/Zotlabs/Widget/Design_tools.php @@ -0,0 +1,21 @@ + t('Events Tools'), + '$export' => t('Export Calendar'), + '$import' => t('Import Calendar'), + '$submit' => t('Submit') + )); + } +} diff --git a/Zotlabs/Widget/Mailmenu.php b/Zotlabs/Widget/Mailmenu.php new file mode 100644 index 000000000..512f7d9c0 --- /dev/null +++ b/Zotlabs/Widget/Mailmenu.php @@ -0,0 +1,36 @@ + t('Private Mail Menu'), + '$combined' => array( + 'label' => t('Combined View'), + 'url' => z_root() . '/mail/combined', + 'sel' => (argv(1) == 'combined'), + ), + '$inbox' => array( + 'label' => t('Inbox'), + 'url' => z_root() . '/mail/inbox', + 'sel' => (argv(1) == 'inbox'), + ), + '$outbox' => array( + 'label' => t('Outbox'), + 'url' => z_root() . '/mail/outbox', + 'sel' => (argv(1) == 'outbox'), + ), + '$new' => array( + 'label' => t('New Message'), + 'url' => z_root() . '/mail/new', + 'sel'=> (argv(1) == 'new'), + ) + )); + } +} diff --git a/Zotlabs/Widget/Photo_albums.php b/Zotlabs/Widget/Photo_albums.php new file mode 100644 index 000000000..2a746e492 --- /dev/null +++ b/Zotlabs/Widget/Photo_albums.php @@ -0,0 +1,25 @@ + 1) ? true : false); + + $tabs = array( + array( + 'label' => t('Account settings'), + 'url' => z_root().'/settings/account', + 'selected' => ((argv(1) === 'account') ? 'active' : ''), + ), + + array( + 'label' => t('Channel settings'), + 'url' => z_root().'/settings/channel', + 'selected' => ((argv(1) === 'channel') ? 'active' : ''), + ), + + ); + + if(get_account_techlevel() > 0 && get_features()) { + $tabs[] = array( + 'label' => t('Additional features'), + 'url' => z_root().'/settings/features', + 'selected' => ((argv(1) === 'features') ? 'active' : ''), + ); + } + + $tabs[] = array( + 'label' => t('Feature/Addon settings'), + 'url' => z_root().'/settings/featured', + 'selected' => ((argv(1) === 'featured') ? 'active' : ''), + ); + + $tabs[] = array( + 'label' => t('Display settings'), + 'url' => z_root().'/settings/display', + 'selected' => ((argv(1) === 'display') ? 'active' : ''), + ); + + if($hublocs) { + $tabs[] = array( + 'label' => t('Manage locations'), + 'url' => z_root() . '/locs', + 'selected' => ((argv(1) === 'locs') ? 'active' : ''), + ); + } + + $tabs[] = array( + 'label' => t('Export channel'), + 'url' => z_root() . '/uexport', + 'selected' => '' + ); + + $tabs[] = array( + 'label' => t('Connected apps'), + 'url' => z_root() . '/settings/oauth', + 'selected' => ((argv(1) === 'oauth') ? 'active' : ''), + ); + + if(get_account_techlevel() > 2) { + $tabs[] = array( + 'label' => t('Guest Access Tokens'), + 'url' => z_root() . '/settings/tokens', + 'selected' => ((argv(1) === 'tokens') ? 'active' : ''), + ); + } + + if(feature_enabled(local_channel(),'permcats')) { + $tabs[] = array( + 'label' => t('Permission Groups'), + 'url' => z_root() . '/settings/permcats', + 'selected' => ((argv(1) === 'permcats') ? 'active' : ''), + ); + } + + + if($role === false || $role === 'custom') { + $tabs[] = array( + 'label' => t('Connection Default Permissions'), + 'url' => z_root() . '/connedit/' . $abook_self_id, + 'selected' => '' + ); + } + + if(feature_enabled(local_channel(),'premium_channel')) { + $tabs[] = array( + 'label' => t('Premium Channel Settings'), + 'url' => z_root() . '/connect/' . $channel['channel_address'], + 'selected' => '' + ); + } + + if(feature_enabled(local_channel(),'channel_sources')) { + $tabs[] = array( + 'label' => t('Channel Sources'), + 'url' => z_root() . '/sources', + 'selected' => '' + ); + } + + $tabtpl = get_markup_template("generic_links_widget.tpl"); + return replace_macros($tabtpl, array( + '$title' => t('Settings'), + '$class' => 'settings-widget', + '$items' => $tabs, + )); + } + +} \ No newline at end of file diff --git a/Zotlabs/Widget/Tagcloud_wall.php b/Zotlabs/Widget/Tagcloud_wall.php new file mode 100644 index 000000000..7cff6ce09 --- /dev/null +++ b/Zotlabs/Widget/Tagcloud_wall.php @@ -0,0 +1,20 @@ +