diff --git a/Zotlabs/Extend/Hook.php b/Zotlabs/Extend/Hook.php index edfacfa3b..713165faf 100644 --- a/Zotlabs/Extend/Hook.php +++ b/Zotlabs/Extend/Hook.php @@ -20,6 +20,15 @@ class Hook { if($r) return true; + // To aid in upgrade and transition, remove old settings for any registered hooks that match in all respects except + // for priority or hook_version + + $r = q("DELETE FROM `hook` where `hook` = '%s' and `file` = '%s' and `function` = '%s'", + dbesc($hook), + dbesc($file), + dbesc($function) + ); + $r = q("INSERT INTO `hook` (`hook`, `file`, `function`, `priority`, `hook_version`) VALUES ( '%s', '%s', '%s', %d, %d )", dbesc($hook), dbesc($file), @@ -46,6 +55,18 @@ class Hook { return $r; } + // unregister all hooks with this file component. + // Useful for addon upgrades where you want to clean out old interfaces. + + static public function unregister_by_file($file) { + + $r = q("DELETE FROM hook WHERE `file` = '%s' ", + dbesc($file) + ); + + return $r; + } + /** * @brief Inserts a hook into a page request. diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php index 1ff9065cd..1d37b41bc 100644 --- a/Zotlabs/Module/Admin.php +++ b/Zotlabs/Module/Admin.php @@ -725,7 +725,7 @@ class Admin extends \Zotlabs\Web\Controller { '$embed_allow' => array('embed_allow', t('Allow embedded HTML content only from these domains'), $whiteembeds_str, t('One site per line. Leave empty to allow from any site by default')), '$embed_deny' => array('embed_deny', t('Block embedded HTML from these domains'), $blackembeds_str, ''), - '$embed_coop' => array('embed_coop', t('Cooperative embed security'), $embed_coop, t('Enable to share embed security with other compatible sites/hubs')), +// '$embed_coop' => array('embed_coop', t('Cooperative embed security'), $embed_coop, t('Enable to share embed security with other compatible sites/hubs')), '$submit' => t('Submit') )); } diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 74fbeed67..93570fdec 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -1243,14 +1243,14 @@ class Item extends \Zotlabs\Web\Controller { } if (!$iswebpage) { - $max = service_class_fetch($channel_id,'total_items'); + $max = engr_units_to_bytes(service_class_fetch($channel_id,'total_items')); if(! service_class_allows($channel_id,'total_items',$r[0]['total'])) { $result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f top level posts.'),$max); return $result; } } else { - $max = service_class_fetch($channel_id,'total_pages'); + $max = engr_units_to_bytes(service_class_fetch($channel_id,'total_pages')); if(! service_class_allows($channel_id,'total_pages',$r[0]['total'])) { $result['message'] .= upgrade_message() . sprintf( t('You have reached your limit of %1$.0f webpages.'),$max); return $result; diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index ce350666f..15a1f4d9c 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -615,7 +615,7 @@ class Photos extends \Zotlabs\Web\Controller { ); - $limit = service_class_fetch(\App::$data['channel']['channel_id'],'photo_upload_limit'); + $limit = engr_units_to_bytes(service_class_fetch(\App::$data['channel']['channel_id'],'photo_upload_limit')); if($limit !== false) { $usage_message = sprintf( t("%1$.2f MB of %2$.2f MB photo storage used."), $r[0]['total'] / 1024000, $limit / 1024000 ); } diff --git a/Zotlabs/Storage/Browser.php b/Zotlabs/Storage/Browser.php index 720940953..c75ebe41f 100644 --- a/Zotlabs/Storage/Browser.php +++ b/Zotlabs/Storage/Browser.php @@ -273,7 +273,7 @@ class Browser extends DAV\Browser\Plugin { return; // Storage and quota for the account (all channels of the owner of this directory)! - $limit = service_class_fetch($owner, 'attach_upload_limit'); + $limit = engr_units_to_bytes(service_class_fetch($owner, 'attach_upload_limit')); $r = q("SELECT SUM(filesize) AS total FROM attach WHERE aid = %d", intval($this->auth->channel_account_id) ); diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php index edbef5a95..3c0cff6ef 100644 --- a/Zotlabs/Storage/Directory.php +++ b/Zotlabs/Storage/Directory.php @@ -315,13 +315,13 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { } // check against service class quota - $limit = service_class_fetch($c[0]['channel_id'], 'attach_upload_limit'); + $limit = engr_units_to_bytes(service_class_fetch($c[0]['channel_id'], 'attach_upload_limit')); if ($limit !== false) { $x = q("SELECT SUM(filesize) AS total FROM attach WHERE aid = %d ", intval($c[0]['channel_account_id']) ); if (($x) && ($x[0]['total'] + $size > $limit)) { - logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . $limit); + logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . userReadableSize($limit)); attach_delete($c[0]['channel_id'], $hash); return; } @@ -549,7 +549,7 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota { intval($this->auth->owner_id) ); - $ulimit = service_class_fetch($c[0]['channel_id'], 'attach_upload_limit'); + $ulimit = engr_units_to_bytes(service_class_fetch($c[0]['channel_id'], 'attach_upload_limit')); $limit = (($ulimit) ? $ulimit : $limit); $x = q("select sum(filesize) as total from attach where aid = %d", diff --git a/Zotlabs/Storage/File.php b/Zotlabs/Storage/File.php index 897f24edd..d40fee0ea 100644 --- a/Zotlabs/Storage/File.php +++ b/Zotlabs/Storage/File.php @@ -208,13 +208,13 @@ class File extends DAV\Node implements DAV\IFile { return; } - $limit = service_class_fetch($c[0]['channel_id'], 'attach_upload_limit'); + $limit = engr_units_to_bytes(service_class_fetch($c[0]['channel_id'], 'attach_upload_limit')); if ($limit !== false) { $x = q("select sum(filesize) as total from attach where aid = %d ", intval($c[0]['channel_account_id']) ); if (($x) && ($x[0]['total'] + $size > $limit)) { - logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . $limit); + logger('service class limit exceeded for ' . $c[0]['channel_name'] . ' total usage is ' . $x[0]['total'] . ' limit is ' . userReadableSize($limit)); attach_delete($c[0]['channel_id'], $this->data['hash']); return; } diff --git a/doc/context/en/admin/logs/help.html b/doc/context/en/admin/logs/help.html new file mode 100644 index 000000000..708ec9bde --- /dev/null +++ b/doc/context/en/admin/logs/help.html @@ -0,0 +1,8 @@ +
+
General
+
This page allows you to adjust log settings and to view and existing log.
+
Log Settings
+
When you enable the Debugging option, system log information will begin appending to the file specified in the "Log File" box (path is relative to the hub root, for example /var/www). Note that this file must be writable by the web server.
+
Log Level
+
The log level option allows you to set how much information is appended to the log file. Warning: Increasing this level can quickly inflate the size of the log file to >100MB, especially on hubs with more than a few members.
+
\ No newline at end of file diff --git a/doc/context/en/admin/queue/help.html b/doc/context/en/admin/queue/help.html new file mode 100644 index 000000000..28885a154 --- /dev/null +++ b/doc/context/en/admin/queue/help.html @@ -0,0 +1,4 @@ +
+
General
+
The queue statistics display how many posts are in the queue for delivery to other hubs. The priority is related to how many times the delivery has been unsuccessfully attempted.
+
\ No newline at end of file diff --git a/doc/context/en/admin/security/help.html b/doc/context/en/admin/security/help.html index e9a741a5e..bfe81b132 100644 --- a/doc/context/en/admin/security/help.html +++ b/doc/context/en/admin/security/help.html @@ -1,3 +1,4 @@ -

Security Settings

-

This page contains various administrator settings related to security.

-

To save any changes you make to these settings, you must press the Submit button.

\ No newline at end of file +
+
General
+
This page contains various administrator settings related to security. To save any changes you make to these settings, you must press the Submit button.
+
\ No newline at end of file diff --git a/doc/context/en/chat/help.html b/doc/context/en/chat/help.html new file mode 100644 index 000000000..cc71686d8 --- /dev/null +++ b/doc/context/en/chat/help.html @@ -0,0 +1,8 @@ +
+
General
+
Create and use chat rooms to communicate in real-time, using the standard Hubzilla permissions system for chat room access control.
+
Create new chat room
+
Use the "Create New" button to create a new chat room. Enter a name and how long messages should be retained.
+
Chatting
+
Enter your message in the message box and press Submit. You can set a status by selecting the chat room menu button beside the Submit button. Other people "in the room" are visible in the side panel in the "Chat Members" panel.
+
\ No newline at end of file diff --git a/doc/context/en/connections/help.html b/doc/context/en/connections/help.html new file mode 100644 index 000000000..0f95fde63 --- /dev/null +++ b/doc/context/en/connections/help.html @@ -0,0 +1,8 @@ +
+
General
+
This page displays a list of all this channel's connections. The list can be sorted and filtered using the menu button beside the search button.
+
Connection Details
+
Each list entry shows the details of a specific connection. A translucent avatar image indicates an archived connection.
+
Connection Status
+
A connection can be in different states:
+
\ No newline at end of file diff --git a/doc/context/en/connections/ifpending/help.html b/doc/context/en/connections/ifpending/help.html new file mode 100644 index 000000000..0f95fde63 --- /dev/null +++ b/doc/context/en/connections/ifpending/help.html @@ -0,0 +1,8 @@ +
+
General
+
This page displays a list of all this channel's connections. The list can be sorted and filtered using the menu button beside the search button.
+
Connection Details
+
Each list entry shows the details of a specific connection. A translucent avatar image indicates an archived connection.
+
Connection Status
+
A connection can be in different states:
+
\ No newline at end of file diff --git a/doc/context/en/events/help.html b/doc/context/en/events/help.html new file mode 100644 index 000000000..8c0b1d4ab --- /dev/null +++ b/doc/context/en/events/help.html @@ -0,0 +1,8 @@ +
+
General
+
This page displays a calendar of events both owned by you and shared with you from other channels.
+
Calendar View
+
The calendar can be displayed in month, week, or day mode using the options in the side panel.
+
Export/Import
+
Export or import calendar events using standard iCalendar format (.ics) files.
+
\ No newline at end of file diff --git a/include/account.php b/include/account.php index c64197b49..5998609d4 100644 --- a/include/account.php +++ b/include/account.php @@ -591,6 +591,7 @@ function service_class_allows($uid, $property, $usage = false) { if($limit === false) return true; // No service class set => everything is allowed + $limit = engr_units_to_bytes($limit); if($usage === false) { // We use negative values for not allowed properties in a subscriber plan return ((x($limit)) ? (bool) $limit : true); @@ -627,6 +628,8 @@ function account_service_class_allows($aid, $property, $usage = false) { if($limit === false) return true; // No service class is set => everything is allowed + $limit = engr_units_to_bytes($limit); + if($usage === false) { // We use negative values for not allowed properties in a subscriber plan return ((x($limit)) ? (bool) $limit : true); diff --git a/include/items.php b/include/items.php index 7947f64a2..2720dd841 100755 --- a/include/items.php +++ b/include/items.php @@ -5616,3 +5616,18 @@ function send_profile_photo_activity($channel,$photo,$profile) { } + +function sync_an_item($channel_id,$item_id) { + + $r = q("select * from item where id = %d", + intval($item_id) + ); + if($r) { + xchan_query($r); + $sync_item = fetch_post_tags($r); + $rid = q("select * from item_id where iid = %d", + intval($item_id) + ); + build_sync_packet($channel_d,array('item' => array(encode_item($sync_item[0],true)),'item_id' => $rid)); + } +} \ No newline at end of file diff --git a/include/photos.php b/include/photos.php index 24e872890..73a29d8eb 100644 --- a/include/photos.php +++ b/include/photos.php @@ -131,7 +131,7 @@ function photo_upload($channel, $observer, $args) { intval($account_id) ); - $limit = service_class_fetch($channel_id,'photo_upload_limit'); + $limit = engr_units_to_bytes(service_class_fetch($channel_id,'photo_upload_limit')); if (($r) && ($limit !== false) && (($r[0]['total'] + strlen($imagedata)) > $limit)) { $ret['message'] = upgrade_message(); @@ -296,7 +296,7 @@ function photo_upload($channel, $observer, $args) { $photo_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' . t('a new photo') . '[/zrl]'; - $album_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album) . ']' . $album . '[/zrl]'; + $album_link = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/album/' . bin2hex($album) . ']' . ((strlen($album)) ? $album : '/') . '[/zrl]'; $activity_format = sprintf(t('%1$s posted %2$s to %3$s','photo_upload'), $author_link, $photo_link, $album_link); diff --git a/include/text.php b/include/text.php index 926e2eed6..f1043909d 100644 --- a/include/text.php +++ b/include/text.php @@ -1825,7 +1825,7 @@ function lang_selector() { } -function return_bytes ($size_str) { +function engr_units_to_bytes ($size_str) { switch (substr ($size_str, -1)) { case 'M': case 'm': return (int)$size_str * 1048576; case 'K': case 'k': return (int)$size_str * 1024; diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index bd5df5e63..290a1a697 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -210,6 +210,7 @@ header #banner #logo-text { display: block; position: fixed; top: 51px; + width: 100%; max-height: 50%; background: $comment_item_colour; padding: 20px; @@ -223,6 +224,24 @@ header #banner #logo-text { .contextual-help-content dd { margin-bottom: 1em; } + +.contextual-help-tool { + padding: 7px; + filter: alpha(opacity=20); + opacity: .2; +} + +.contextual-help-tool:hover { + filter: alpha(opacity=50); + opacity: .5; + text-decoration: none; +} + +.contextual-help-tool i { + color: #000; + font-size: 16px; +} + /* contextual help end */ /* footer */ diff --git a/view/tpl/admin_security.tpl b/view/tpl/admin_security.tpl index 691db2d88..3823d8235 100755 --- a/view/tpl/admin_security.tpl +++ b/view/tpl/admin_security.tpl @@ -15,9 +15,6 @@ {{include file="field_textarea.tpl" field=$whitelisted_channels}} {{include file="field_textarea.tpl" field=$blacklisted_channels}} - - {{include file="field_checkbox.tpl" field=$embed_coop}} - {{include file="field_textarea.tpl" field=$embed_allow}} {{include file="field_textarea.tpl" field=$embed_deny}} diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 03b48fd00..14fb8a982 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -36,10 +36,6 @@
  • {{$nav.admin.1}}
  • {{/if}} - {{if $nav.help.6}} - -
  • {{$nav.help.1}}
  • - {{/if}} {{if $nav.logout}}
  • {{$nav.logout.1}}
  • @@ -207,6 +203,9 @@ {{if $nav.help.6}}
    {{$nav.help.5}} - +
    + + +
    {{/if}}