From 755b75161494ea9810ab0e38242cb1a318793ed3 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 15 Mar 2017 16:55:47 -0700 Subject: Comanche: allow widgets to be class based and stored appropriately in Zotlabs --- Zotlabs/Render/Comanche.php | 14 ++++++++++++++ Zotlabs/Widget/Notes.php | 23 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 Zotlabs/Widget/Notes.php (limited to 'Zotlabs') diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index 5826063fd..899fbd8aa 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -410,6 +410,20 @@ class Comanche { } } + $clsname = ucfirst($name); + $nsname = "Zotlabs\\Widget\\" . $clsname; + if(file_exists('Zotlabs/SiteWidget/' . $clsname . '.php')) + require_once('Zotlabs/SiteWidget/' . $clsname . '.php'); + elseif(file_exists('Zotlabs/Widget/' . $clsname . '.php')) + require_once('Zotlabs/Widget/' . $clsname . '.php'); + if(class_exists($nsname)) { + $x = new $nsname; + $f = 'widget'; + if(method_exists($x,$f)) { + return $x->$f($vars); + } + } + $func = 'widget_' . trim($name); if(! function_exists($func)) { diff --git a/Zotlabs/Widget/Notes.php b/Zotlabs/Widget/Notes.php new file mode 100644 index 000000000..5c83a550f --- /dev/null +++ b/Zotlabs/Widget/Notes.php @@ -0,0 +1,23 @@ + t('Notes'), + '$text' => $text, + '$save' => t('Save'), + )); + + return $o; + } +} -- cgit v1.2.3 From 242ef70a775a86050152c0aea9096ec1cd6d0312 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 15 Mar 2017 17:05:16 -0700 Subject: use absolute namespace --- Zotlabs/Render/Comanche.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php index 899fbd8aa..60a7b232c 100644 --- a/Zotlabs/Render/Comanche.php +++ b/Zotlabs/Render/Comanche.php @@ -411,7 +411,8 @@ class Comanche { } $clsname = ucfirst($name); - $nsname = "Zotlabs\\Widget\\" . $clsname; + $nsname = "\\Zotlabs\\Widget\\" . $clsname; + if(file_exists('Zotlabs/SiteWidget/' . $clsname . '.php')) require_once('Zotlabs/SiteWidget/' . $clsname . '.php'); elseif(file_exists('Zotlabs/Widget/' . $clsname . '.php')) -- cgit v1.2.3 From 477ed97c2fbfff903f9ebf0ffa7fba078eeac10f Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 15 Mar 2017 18:31:34 -0700 Subject: convert more widgets to classes --- Zotlabs/Widget/Collections.php | 51 +++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Profile | 13 ++++++++++ Zotlabs/Widget/Suggestions.php | 58 ++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Tagcloud.php | 33 ++++++++++++++++++++++++ Zotlabs/Widget/Zcard.php | 11 ++++++++ 5 files changed, 166 insertions(+) create mode 100644 Zotlabs/Widget/Collections.php create mode 100644 Zotlabs/Widget/Profile create mode 100644 Zotlabs/Widget/Suggestions.php create mode 100644 Zotlabs/Widget/Tagcloud.php create mode 100644 Zotlabs/Widget/Zcard.php (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Collections.php b/Zotlabs/Widget/Collections.php new file mode 100644 index 000000000..d2b29679a --- /dev/null +++ b/Zotlabs/Widget/Collections.php @@ -0,0 +1,51 @@ + 2) ? mt_rand(0,count($r) - 2) : 0); + + for($x = $index; $x <= ($index+1); $x ++) { + $rr = $r[$x]; + if(! $rr['xchan_url']) + break; + + $connlnk = z_root() . '/follow/?url=' . $rr['xchan_addr']; + + $arr[] = array( + 'url' => chanlink_url($rr['xchan_url']), + 'profile' => $rr['xchan_url'], + 'name' => $rr['xchan_name'], + 'photo' => $rr['xchan_photo_m'], + 'ignlnk' => z_root() . '/directory?ignore=' . $rr['xchan_hash'], + 'conntxt' => t('Connect'), + 'connlnk' => $connlnk, + 'ignore' => t('Ignore/Hide') + ); + } + + $o = replace_macros(get_markup_template('suggest_widget.tpl'),array( + '$title' => t('Suggestions'), + '$more' => t('See more...'), + '$entries' => $arr + )); + + return $o; + } +} diff --git a/Zotlabs/Widget/Tagcloud.php b/Zotlabs/Widget/Tagcloud.php new file mode 100644 index 000000000..cf7a4932e --- /dev/null +++ b/Zotlabs/Widget/Tagcloud.php @@ -0,0 +1,33 @@ +

' . t('Categories') . '

'; + foreach($r as $rv) { + $o .= '' . $rv[0] .' ' . "\r\n"; + } + $o .= '
'; + } + return $o; + } +} diff --git a/Zotlabs/Widget/Zcard.php b/Zotlabs/Widget/Zcard.php new file mode 100644 index 000000000..12e53eaab --- /dev/null +++ b/Zotlabs/Widget/Zcard.php @@ -0,0 +1,11 @@ + 875)); + } +} -- cgit v1.2.3 From 17977effe775ef05a48a84da40da4b1f049b00d9 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 15 Mar 2017 18:48:27 -0700 Subject: more widgets --- Zotlabs/Widget/Follow.php | 37 +++++++++++++++++ Zotlabs/Widget/Savedsearch.php | 91 ++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Sitesearch.php | 38 ++++++++++++++++++ 3 files changed, 166 insertions(+) create mode 100644 Zotlabs/Widget/Follow.php create mode 100644 Zotlabs/Widget/Savedsearch.php create mode 100644 Zotlabs/Widget/Sitesearch.php (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Follow.php b/Zotlabs/Widget/Follow.php new file mode 100644 index 000000000..c4aecc8e1 --- /dev/null +++ b/Zotlabs/Widget/Follow.php @@ -0,0 +1,37 @@ + t('Add New Connection'), + '$desc' => t('Enter channel address'), + '$hint' => t('Examples: bob@example.com, https://example.com/barbara'), + '$follow' => t('Connect'), + '$abook_usage_message' => $abook_usage_message + )); + } +} + diff --git a/Zotlabs/Widget/Savedsearch.php b/Zotlabs/Widget/Savedsearch.php new file mode 100644 index 000000000..378c27139 --- /dev/null +++ b/Zotlabs/Widget/Savedsearch.php @@ -0,0 +1,91 @@ + $rr['tid'], + 'term' => $rr['term'], + 'dellink' => z_root() . '/' . $srchurl . (($hasq || $hasamp) ? '' : '?f=') . '&searchremove=1&search=' . urlencode($rr['term']), + 'srchlink' => z_root() . '/' . $srchurl . (($hasq || $hasamp) ? '' : '?f=') . '&search=' . urlencode($rr['term']), + 'displayterm' => htmlspecialchars($rr['term'], ENT_COMPAT,'UTF-8'), + 'encodedterm' => urlencode($rr['term']), + 'delete' => t('Remove term'), + 'selected' => ($search==$rr['term']), + ); + } + } + + $tpl = get_markup_template("saved_searches.tpl"); + $o = replace_macros($tpl, array( + '$title' => t('Saved Searches'), + '$add' => t('add'), + '$searchbox' => searchbox($search, 'netsearch-box', $srchurl . (($hasq) ? '' : '?f='), true), + '$saved' => $saved, + )); + + return $o; + } +} diff --git a/Zotlabs/Widget/Sitesearch.php b/Zotlabs/Widget/Sitesearch.php new file mode 100644 index 000000000..b3a25d76a --- /dev/null +++ b/Zotlabs/Widget/Sitesearch.php @@ -0,0 +1,38 @@ + t('Search'), + '$searchbox' => searchbox($search, 'netsearch-box', $srchurl . (($hasq) ? '' : '?f='), false), + '$saved' => $saved, + )); + + return $o; + } +} -- cgit v1.2.3 From 74f58818d628a30297f48720b73c094b215f593b Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 15 Mar 2017 19:13:16 -0700 Subject: filename issue --- Zotlabs/Widget/Profile | 13 ------------- Zotlabs/Widget/Profile.php | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100644 Zotlabs/Widget/Profile create mode 100644 Zotlabs/Widget/Profile.php (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Profile b/Zotlabs/Widget/Profile deleted file mode 100644 index bffd910b6..000000000 --- a/Zotlabs/Widget/Profile +++ /dev/null @@ -1,13 +0,0 @@ - Date: Wed, 15 Mar 2017 19:30:57 -0700 Subject: more widgets --- Zotlabs/Widget/Archive.php | 55 ++++++++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Filer.php | 35 +++++++++++++++++++++++++++ Zotlabs/Widget/Fullprofile.php | 16 ++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 Zotlabs/Widget/Archive.php create mode 100644 Zotlabs/Widget/Filer.php create mode 100644 Zotlabs/Widget/Fullprofile.php (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Archive.php b/Zotlabs/Widget/Archive.php new file mode 100644 index 000000000..c151ca563 --- /dev/null +++ b/Zotlabs/Widget/Archive.php @@ -0,0 +1,55 @@ + t('Archives'), + '$size' => $visible_years, + '$cutoff_year' => $cutoff_year, + '$cutoff' => $cutoff, + '$url' => $url, + '$style' => $style, + '$showend' => $showend, + '$dates' => $ret + )); + return $o; + } +} + diff --git a/Zotlabs/Widget/Filer.php b/Zotlabs/Widget/Filer.php new file mode 100644 index 000000000..cb9a0becf --- /dev/null +++ b/Zotlabs/Widget/Filer.php @@ -0,0 +1,35 @@ + $rr['term'], 'selected' => (($selected == $rr['term']) ? 'selected' : '')); + + return replace_macros(get_markup_template('fileas_widget.tpl'),array( + '$title' => t('Saved Folders'), + '$desc' => '', + '$sel_all' => (($selected == '') ? 'selected' : ''), + '$all' => t('Everything'), + '$terms' => $terms, + '$base' => z_root() . '/' . \App::$cmd + )); + } +} diff --git a/Zotlabs/Widget/Fullprofile.php b/Zotlabs/Widget/Fullprofile.php new file mode 100644 index 000000000..d7340ef40 --- /dev/null +++ b/Zotlabs/Widget/Fullprofile.php @@ -0,0 +1,16 @@ + Date: Wed, 15 Mar 2017 20:11:28 -0700 Subject: more widget migrations --- Zotlabs/Widget/Appcategories.php | 49 ++++++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Appcloud.php | 13 +++++++++++ Zotlabs/Widget/Categories.php | 22 ++++++++++++++++++ Zotlabs/Widget/Shortprofile.php | 18 +++++++++++++++ 4 files changed, 102 insertions(+) create mode 100644 Zotlabs/Widget/Appcategories.php create mode 100644 Zotlabs/Widget/Appcloud.php create mode 100644 Zotlabs/Widget/Categories.php create mode 100644 Zotlabs/Widget/Shortprofile.php (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Appcategories.php b/Zotlabs/Widget/Appcategories.php new file mode 100644 index 000000000..490ec1abc --- /dev/null +++ b/Zotlabs/Widget/Appcategories.php @@ -0,0 +1,49 @@ + $rr['term'], 'selected' => (($selected == $rr['term']) ? 'selected' : '')); + + return replace_macros(get_markup_template('categories_widget.tpl'),array( + '$title' => t('Categories'), + '$desc' => '', + '$sel_all' => (($selected == '') ? 'selected' : ''), + '$all' => t('Everything'), + '$terms' => $terms, + '$base' => $srchurl, + + )); + } + } +} diff --git a/Zotlabs/Widget/Appcloud.php b/Zotlabs/Widget/Appcloud.php new file mode 100644 index 000000000..2a4671eee --- /dev/null +++ b/Zotlabs/Widget/Appcloud.php @@ -0,0 +1,13 @@ + 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') 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 @@ + Date: Wed, 15 Mar 2017 21:26:28 -0700 Subject: widgets cont. --- Zotlabs/Widget/Admin.php | 68 ++++++++++++++++++++++++++++++++++++ Zotlabs/Widget/Chatroom_list.php | 24 +++++++++++++ Zotlabs/Widget/Chatroom_members.php | 15 ++++++++ Zotlabs/Widget/Menu_preview.php | 16 +++++++++ Zotlabs/Widget/Tasklist.php | 30 ++++++++++++++++ Zotlabs/Widget/Vcard.php | 12 +++++++ Zotlabs/Widget/Wiki_list.php | 23 ++++++++++++ Zotlabs/Widget/Wiki_page_history.php | 27 ++++++++++++++ Zotlabs/Widget/Wiki_pages.php | 59 +++++++++++++++++++++++++++++++ 9 files changed, 274 insertions(+) create mode 100644 Zotlabs/Widget/Admin.php create mode 100644 Zotlabs/Widget/Chatroom_list.php create mode 100644 Zotlabs/Widget/Chatroom_members.php create mode 100644 Zotlabs/Widget/Menu_preview.php create mode 100644 Zotlabs/Widget/Tasklist.php create mode 100644 Zotlabs/Widget/Vcard.php create mode 100644 Zotlabs/Widget/Wiki_list.php create mode 100644 Zotlabs/Widget/Wiki_page_history.php create mode 100644 Zotlabs/Widget/Wiki_pages.php (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Admin.php b/Zotlabs/Widget/Admin.php new file mode 100644 index 000000000..a761eebe3 --- /dev/null +++ b/Zotlabs/Widget/Admin.php @@ -0,0 +1,68 @@ + array(z_root() . '/admin/site/', t('Site'), 'site'), + 'accounts' => array(z_root() . '/admin/accounts/', t('Accounts'), 'accounts', 'pending-update', t('Member registrations waiting for confirmation')), + 'channels' => array(z_root() . '/admin/channels/', t('Channels'), 'channels'), + 'security' => array(z_root() . '/admin/security/', t('Security'), 'security'), + 'features' => array(z_root() . '/admin/features/', t('Features'), 'features'), + 'plugins' => array(z_root() . '/admin/plugins/', t('Plugins'), 'plugins'), + 'themes' => array(z_root() . '/admin/themes/', t('Themes'), 'themes'), + 'queue' => array(z_root() . '/admin/queue', t('Inspect queue'), 'queue'), + 'profs' => array(z_root() . '/admin/profs', t('Profile Fields'), 'profs'), + 'dbsync' => array(z_root() . '/admin/dbsync/', t('DB updates'), 'dbsync') + ]; + + /* get plugins admin page */ + + $r = q("SELECT * FROM addon WHERE plugin_admin = 1"); + + $plugins = array(); + if($r) { + foreach ($r as $h){ + $plugin = $h['aname']; + $plugins[] = array(z_root() . '/admin/plugins/' . $plugin, $plugin, 'plugin'); + // temp plugins with admin + \App::$plugins_admin[] = $plugin; + } + } + + $logs = array(z_root() . '/admin/logs/', t('Logs'), 'logs'); + + $arr = array('links' => $aside,'plugins' => $plugins,'logs' => $logs); + call_hooks('admin_aside',$arr); + + $o .= replace_macros(get_markup_template('admin_aside.tpl'), array( + '$admin' => $aside, + '$admtxt' => t('Admin'), + '$plugadmtxt' => t('Plugin Features'), + '$plugins' => $plugins, + '$logtxt' => t('Logs'), + '$logs' => $logs, + '$h_pending' => t('Member registrations waiting for confirmation'), + '$admurl'=> z_root() . '/admin/' + )); + + return $o; + + } +} + diff --git a/Zotlabs/Widget/Chatroom_list.php b/Zotlabs/Widget/Chatroom_list.php new file mode 100644 index 000000000..e2aad0e05 --- /dev/null +++ b/Zotlabs/Widget/Chatroom_list.php @@ -0,0 +1,24 @@ + t('Chatrooms'), + '$baseurl' => z_root(), + '$nickname' => \App::$profile['channel_address'], + '$items' => $r, + '$overview' => t('Overview') + )); + } + } +} diff --git a/Zotlabs/Widget/Chatroom_members.php b/Zotlabs/Widget/Chatroom_members.php new file mode 100644 index 000000000..8ed77fb3c --- /dev/null +++ b/Zotlabs/Widget/Chatroom_members.php @@ -0,0 +1,15 @@ + t('Chat Members') + )); + } + +} diff --git a/Zotlabs/Widget/Menu_preview.php b/Zotlabs/Widget/Menu_preview.php new file mode 100644 index 000000000..51218f6cf --- /dev/null +++ b/Zotlabs/Widget/Menu_preview.php @@ -0,0 +1,16 @@ +var tasksShowAll = 0; $(document).ready(function() { tasksFetch(); $("#tasklist-new-form").submit(function(event) { event.preventDefault(); $.post( "tasks/new", $("#tasklist-new-form").serialize(), function(data) { tasksFetch(); $("#tasklist-new-summary").val(""); } ); return false; } )});'; + $o .= ''; + + $o .= '
' . '

' . t('Tasks') . '

'; + $o .= '
'; + $o .= '
'; + return $o; + + } +} + diff --git a/Zotlabs/Widget/Vcard.php b/Zotlabs/Widget/Vcard.php new file mode 100644 index 000000000..cab05dfdd --- /dev/null +++ b/Zotlabs/Widget/Vcard.php @@ -0,0 +1,12 @@ + t('Wiki List'), + '$channel' => $channel['channel_address'], + '$wikis' => $wikis['wikis'] + )); + } + return ''; + } + +} diff --git a/Zotlabs/Widget/Wiki_page_history.php b/Zotlabs/Widget/Wiki_page_history.php new file mode 100644 index 000000000..dcec9a037 --- /dev/null +++ b/Zotlabs/Widget/Wiki_page_history.php @@ -0,0 +1,27 @@ + \App::$profile_uid, + 'observer_hash' => get_observer_hash(), + 'resource_id' => $resource_id, + 'pageUrlName' => $pageUrlName + ]); + + return replace_macros(get_markup_template('nwiki_page_history.tpl'), array( + '$pageHistory' => $pageHistory['history'], + '$permsWrite' => $arr['permsWrite'], + '$name_lbl' => t('Name'), + '$msg_label' => t('Message','wiki_history') + )); + + } +} diff --git a/Zotlabs/Widget/Wiki_pages.php b/Zotlabs/Widget/Wiki_pages.php new file mode 100644 index 000000000..bad451475 --- /dev/null +++ b/Zotlabs/Widget/Wiki_pages.php @@ -0,0 +1,59 @@ + $hide, + '$resource_id' => $arr['resource_id'], + '$not_refresh' => $not_refresh, + '$header' => t('Wiki Pages'), + '$channel' => $channelname, + '$wikiname' => $wikiname, + '$pages' => $pages, + '$canadd' => $can_create, + '$candel' => $can_delete, + '$addnew' => t('Add new page'), + '$pageName' => array('pageName', t('Page name')), + )); + } +} + + -- cgit v1.2.3 From cd57483ed9069a26b52ae8d7d74fdc537da89946 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Wed, 29 Mar 2017 11:59:20 +0200 Subject: namespace error --- Zotlabs/Widget/Conversations.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Conversations.php b/Zotlabs/Widget/Conversations.php index fa59ce20c..31fcb6c58 100644 --- a/Zotlabs/Widget/Conversations.php +++ b/Zotlabs/Widget/Conversations.php @@ -33,7 +33,7 @@ class Conversations { 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']); + $r = private_messages_list(local_channel(), $mailbox, \App::$pager['start'], App::$pager['itemspage']); if(! $r) { info( t('No messages.') . EOL); @@ -71,4 +71,4 @@ class Conversations { } return $o; } -} \ No newline at end of file +} -- cgit v1.2.3 From 0bad26e116499d9b656c28f64c81275df4bbecb6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 16 Mar 2017 17:11:48 -0700 Subject: the rest of the standard widgets converted --- Zotlabs/Widget/Activity.php | 61 +++++++++++++++++ Zotlabs/Widget/Album.php | 106 +++++++++++++++++++++++++++++ Zotlabs/Widget/Bookmarkedchats.php | 28 ++++++++ Zotlabs/Widget/Categories.php | 1 + Zotlabs/Widget/Clock.php | 63 +++++++++++++++++ Zotlabs/Widget/Cover_photo.php | 59 ++++++++++++++++ Zotlabs/Widget/Dirsort.php | 11 +++ Zotlabs/Widget/Dirtags.php | 13 ++++ Zotlabs/Widget/Filer.php | 1 + Zotlabs/Widget/Findpeople.php | 12 ++++ Zotlabs/Widget/Forums.php | 97 ++++++++++++++++++++++++++ Zotlabs/Widget/Helpindex.php | 45 ++++++++++++ Zotlabs/Widget/Item.php | 54 +++++++++++++++ Zotlabs/Widget/Photo.php | 55 +++++++++++++++ Zotlabs/Widget/Photo_rand.php | 66 ++++++++++++++++++ Zotlabs/Widget/Pubsites.php | 16 +++++ Zotlabs/Widget/Random_block.php | 46 +++++++++++++ Zotlabs/Widget/Rating.php | 67 ++++++++++++++++++ Zotlabs/Widget/Suggestedchats.php | 37 ++++++++++ Zotlabs/Widget/Website_portation_tools.php | 22 ++++++ 20 files changed, 860 insertions(+) create mode 100644 Zotlabs/Widget/Activity.php create mode 100644 Zotlabs/Widget/Album.php create mode 100644 Zotlabs/Widget/Bookmarkedchats.php create mode 100644 Zotlabs/Widget/Clock.php create mode 100644 Zotlabs/Widget/Cover_photo.php create mode 100644 Zotlabs/Widget/Dirsort.php create mode 100644 Zotlabs/Widget/Dirtags.php create mode 100644 Zotlabs/Widget/Findpeople.php create mode 100644 Zotlabs/Widget/Forums.php create mode 100644 Zotlabs/Widget/Helpindex.php create mode 100644 Zotlabs/Widget/Item.php create mode 100644 Zotlabs/Widget/Photo.php create mode 100644 Zotlabs/Widget/Photo_rand.php create mode 100644 Zotlabs/Widget/Pubsites.php create mode 100644 Zotlabs/Widget/Random_block.php create mode 100644 Zotlabs/Widget/Rating.php create mode 100644 Zotlabs/Widget/Suggestedchats.php create mode 100644 Zotlabs/Widget/Website_portation_tools.php (limited to 'Zotlabs') diff --git a/Zotlabs/Widget/Activity.php b/Zotlabs/Widget/Activity.php new file mode 100644 index 000000000..72a27bdf1 --- /dev/null +++ b/Zotlabs/Widget/Activity.php @@ -0,0 +1,61 @@ + $v) { + $arr[] = [ 'author_xchan' => $k, 'total' => $v ]; + } + usort($arr,'total_sort'); + xchan_query($arr); + } + + $x = [ 'entries' => $arr ]; + call_hooks('activity_widget',$x); + $arr = $x['entries']; + + if($arr) { + $o .= '
'; + $o .= '

' . t('Activity','widget') . '

'; + } + return $o; + } + +} + diff --git a/Zotlabs/Widget/Album.php b/Zotlabs/Widget/Album.php new file mode 100644 index 000000000..f359e6d0f --- /dev/null +++ b/Zotlabs/Widget/Album.php @@ -0,0 +1,106 @@ + $rr['id'], + 'twist' => ' ' . $twist . rand(2,4), + 'link' => $imagelink, + 'title' => t('View Photo'), + 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['imgscale'] . '.' .$ext, + 'alt' => $imgalt_e, + 'desc'=> $desc_e, + 'ext' => $ext, + 'hash'=> $rr['resource_id'], + 'unknown' => t('Unknown') + ); + } + } + + + $tpl = get_markup_template('photo_album.tpl'); + $o .= replace_macros($tpl, array( + '$photos' => $photos, + '$album' => (($title) ? $title : $album), + '$album_id' => rand(), + '$album_edit' => array(t('Edit Album'), $album_edit), + '$can_post' => false, + '$upload' => array(t('Upload'), z_root() . '/photos/' . \App::$profile['channel_address'] . '/upload/' . bin2hex($album)), + '$order' => false, + '$upload_form' => $upload_form, + '$usage' => $usage_message + )); + + return $o; + } +} + diff --git a/Zotlabs/Widget/Bookmarkedchats.php b/Zotlabs/Widget/Bookmarkedchats.php new file mode 100644 index 000000000..d64bbdb4b --- /dev/null +++ b/Zotlabs/Widget/Bookmarkedchats.php @@ -0,0 +1,28 @@ + t('Bookmarked Chatrooms'), + '$rooms' => $r + )); + } +} diff --git a/Zotlabs/Widget/Categories.php b/Zotlabs/Widget/Categories.php index 82fffccc8..d1dcfda93 100644 --- a/Zotlabs/Widget/Categories.php +++ b/Zotlabs/Widget/Categories.php @@ -2,6 +2,7 @@ namespace Zotlabs\Widget; +require_once('include/contact_widgets.php'); class Categories { diff --git a/Zotlabs/Widget/Clock.php b/Zotlabs/Widget/Clock.php new file mode 100644 index 000000000..b63b5f748 --- /dev/null +++ b/Zotlabs/Widget/Clock.php @@ -0,0 +1,63 @@ + +

+ + +EOT; + + return $o; + } +} + diff --git a/Zotlabs/Widget/Cover_photo.php b/Zotlabs/Widget/Cover_photo.php new file mode 100644 index 000000000..d2eb1be92 --- /dev/null +++ b/Zotlabs/Widget/Cover_photo.php @@ -0,0 +1,59 @@ +') !== false) + $style = ''; + + if(array_key_exists('title', $arr) && isset($arr['title'])) + $title = $arr['title']; + else + $title = $channel['channel_name']; + + if(array_key_exists('subtitle', $arr) && isset($arr['subtitle'])) + $subtitle = $arr['subtitle']; + else + $subtitle = str_replace('@','@',$channel['xchan_addr']); + + $c = get_cover_photo($channel_id,'html'); + + if($c) { + $photo_html = (($style) ? str_replace('alt=',' style="' . $style . '" alt=',$c) : $c); + + $o = replace_macros(get_markup_template('cover_photo_widget.tpl'),array( + '$photo_html' => $photo_html, + '$title' => $title, + '$subtitle' => $subtitle, + '$hovertitle' => t('Click to show more'), + )); + } + return $o; + } +} diff --git a/Zotlabs/Widget/Dirsort.php b/Zotlabs/Widget/Dirsort.php new file mode 100644 index 000000000..e75a00e50 --- /dev/null +++ b/Zotlabs/Widget/Dirsort.php @@ -0,0 +1,11 @@ +'; + $o .= '

' . t('Forums') . '

'; + } + return $o; + + } +} diff --git a/Zotlabs/Widget/Helpindex.php b/Zotlabs/Widget/Helpindex.php new file mode 100644 index 000000000..62cecce1f --- /dev/null +++ b/Zotlabs/Widget/Helpindex.php @@ -0,0 +1,45 @@ +'; + + $level_0 = get_help_content('sitetoc'); + if(! $level_0) + $level_0 = get_help_content('toc'); + + $level_0 = preg_replace('/\/','