mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 23:55:19 +00:00
move firefox social api configuration to plugin
This commit is contained in:
parent
a91e7cbe8d
commit
c62df39ce3
4 changed files with 25 additions and 76 deletions
|
@ -1,71 +0,0 @@
|
||||||
<?php
|
|
||||||
namespace Zotlabs\Module;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Ffsapi extends \Zotlabs\Web\Controller {
|
|
||||||
|
|
||||||
function get() {
|
|
||||||
|
|
||||||
$baseurl = z_root();
|
|
||||||
$name = get_config('system','sitename');
|
|
||||||
$description = t('Share content from Firefox to $Projectname');
|
|
||||||
$author = 'Mike Macgirvin';
|
|
||||||
$homepage = 'http://hubzilla.org';
|
|
||||||
$activate = t('Activate the Firefox $Projectname provider');
|
|
||||||
|
|
||||||
$s = <<< EOT
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
var baseurl = '$baseurl';
|
|
||||||
|
|
||||||
var data = {
|
|
||||||
"origin": baseurl,
|
|
||||||
// currently required
|
|
||||||
"name": '$name',
|
|
||||||
"iconURL": baseurl+"/images/hz-16.png",
|
|
||||||
"icon32URL": baseurl+"/images/hz-32.png",
|
|
||||||
"icon64URL": baseurl+"/images/hz-64.png",
|
|
||||||
|
|
||||||
// at least one of these must be defined
|
|
||||||
// "workerURL": baseurl+"/worker.js",
|
|
||||||
// "sidebarURL": baseurl+"/sidebar.htm",
|
|
||||||
"shareURL": baseurl+"/rpost?f=&url=%{url}",
|
|
||||||
|
|
||||||
// status buttons are scheduled for Firefox 26 or 27
|
|
||||||
//"statusURL": baseurl+"/statusPanel.html",
|
|
||||||
|
|
||||||
// social bookmarks are available in Firefox 26
|
|
||||||
"markURL": baseurl+"/rbmark?f=&url=%{url}&title=%{title}",
|
|
||||||
// icons should be 32x32 pixels
|
|
||||||
// "markedIcon": baseurl+"/images/checkbox-checked-32.png",
|
|
||||||
// "unmarkedIcon": baseurl+"/images/checkbox-unchecked-32.png",
|
|
||||||
"unmarkedIcon": baseurl+"/images/hz-bookmark-32.png",
|
|
||||||
|
|
||||||
// should be available for display purposes
|
|
||||||
"description": "$description",
|
|
||||||
"author": "$author",
|
|
||||||
"homepageURL": "$homepage",
|
|
||||||
|
|
||||||
// optional
|
|
||||||
"version": "1.0"
|
|
||||||
}
|
|
||||||
|
|
||||||
function activate(node) {
|
|
||||||
var event = new CustomEvent("ActivateSocialFeature");
|
|
||||||
var jdata = JSON.stringify(data);
|
|
||||||
node.setAttribute("data-service", JSON.stringify(data));
|
|
||||||
node.dispatchEvent(event);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<button onclick="activate(this)" title="$activate" class="btn btn-primary">$activate</button>
|
|
||||||
|
|
||||||
EOT;
|
|
||||||
|
|
||||||
return $s;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -448,7 +448,10 @@ class Channel {
|
||||||
$always_show_in_notices = get_pconfig(local_channel(),'system','always_show_in_notices');
|
$always_show_in_notices = get_pconfig(local_channel(),'system','always_show_in_notices');
|
||||||
if($vnotify === false)
|
if($vnotify === false)
|
||||||
$vnotify = (-1);
|
$vnotify = (-1);
|
||||||
|
|
||||||
|
$plugin = [ 'basic' => '', 'security' => '', 'notify' => '', 'misc' => '' ];
|
||||||
|
call_hooks('channel_settings',$plugin);
|
||||||
|
|
||||||
$o .= replace_macros($stpl,array(
|
$o .= replace_macros($stpl,array(
|
||||||
'$ptitle' => t('Channel Settings'),
|
'$ptitle' => t('Channel Settings'),
|
||||||
|
|
||||||
|
@ -537,6 +540,10 @@ class Channel {
|
||||||
'$always_show_in_notices' => array('always_show_in_notices', t('Also show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no),
|
'$always_show_in_notices' => array('always_show_in_notices', t('Also show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no),
|
||||||
|
|
||||||
'$evdays' => array('evdays', t('Notify me of events this many days in advance'), $evdays, t('Must be greater than 0')),
|
'$evdays' => array('evdays', t('Notify me of events this many days in advance'), $evdays, t('Must be greater than 0')),
|
||||||
|
'$basic_addon' => $plugin['basic'],
|
||||||
|
'$sec_addon' => $plugin['security'],
|
||||||
|
'$notify_addon' => $plugin['notify'],
|
||||||
|
'$misc_addon' => $plugin['misc'],
|
||||||
|
|
||||||
'$h_advn' => t('Advanced Account/Page Type Settings'),
|
'$h_advn' => t('Advanced Account/Page Type Settings'),
|
||||||
'$h_descadvn' => t('Change the behaviour of this account for special situations'),
|
'$h_descadvn' => t('Change the behaviour of this account for special situations'),
|
||||||
|
|
|
@ -85,6 +85,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
|
||||||
[zrl=[baseurl]/help/hook/channel_remove]channel_remove[/zrl]
|
[zrl=[baseurl]/help/hook/channel_remove]channel_remove[/zrl]
|
||||||
Called when removing a channel
|
Called when removing a channel
|
||||||
|
|
||||||
|
[zrl=[baseurl]/help/hook/channel_settings]channel_settings[/zrl]
|
||||||
|
Called when displaying the channel settings page
|
||||||
|
|
||||||
[zrl=[baseurl]/help/hook/chat_message]chat_message[/zrl]
|
[zrl=[baseurl]/help/hook/chat_message]chat_message[/zrl]
|
||||||
Called to create a chat message.
|
Called to create a chat message.
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,9 @@
|
||||||
{{include file="field_checkbox.tpl" field=$adult}}
|
{{include file="field_checkbox.tpl" field=$adult}}
|
||||||
{{include file="field_input.tpl" field=$photo_path}}
|
{{include file="field_input.tpl" field=$photo_path}}
|
||||||
{{include file="field_input.tpl" field=$attach_path}}
|
{{include file="field_input.tpl" field=$attach_path}}
|
||||||
|
{{if $basic_addon}}
|
||||||
|
{{$basic_addon}}
|
||||||
|
{{/if}}
|
||||||
<div class="settings-submit-wrapper" >
|
<div class="settings-submit-wrapper" >
|
||||||
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -82,6 +84,9 @@
|
||||||
{{include file="field_checkbox.tpl" field=$blocktags}}
|
{{include file="field_checkbox.tpl" field=$blocktags}}
|
||||||
{{include file="field_input.tpl" field=$expire}}
|
{{include file="field_input.tpl" field=$expire}}
|
||||||
</div>
|
</div>
|
||||||
|
{{if $sec_addon}}
|
||||||
|
{{$sec_addon}}
|
||||||
|
{{/if}}
|
||||||
<div class="settings-submit-wrapper" >
|
<div class="settings-submit-wrapper" >
|
||||||
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -135,6 +140,9 @@
|
||||||
{{include file="field_input.tpl" field=$evdays}}
|
{{include file="field_input.tpl" field=$evdays}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{if $notify_addon}}
|
||||||
|
{{$notify_addon}}
|
||||||
|
{{/if}}
|
||||||
<div class="settings-submit-wrapper" >
|
<div class="settings-submit-wrapper" >
|
||||||
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
@ -152,9 +160,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="miscellaneous-settings-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="miscellaneous-settings">
|
<div id="miscellaneous-settings-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="miscellaneous-settings">
|
||||||
<div class="section-content-tools-wrapper">
|
<div class="section-content-tools-wrapper">
|
||||||
<div class="ffsapilink">
|
|
||||||
<a type="button" class="btn btn-default" href="/ffsapi">{{$firefoxshare}}</a>
|
|
||||||
</div>
|
|
||||||
{{if $menus}}
|
{{if $menus}}
|
||||||
<div class="form-group channel-menu">
|
<div class="form-group channel-menu">
|
||||||
<label for="channel_menu">{{$menu_desc}}</label>
|
<label for="channel_menu">{{$menu_desc}}</label>
|
||||||
|
@ -166,6 +171,11 @@
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{include file="field_checkbox.tpl" field=$cal_first_day}}
|
{{include file="field_checkbox.tpl" field=$cal_first_day}}
|
||||||
|
|
||||||
|
{{if $misc_addon}}
|
||||||
|
{{$misc_addon}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<div class="settings-submit-wrapper" >
|
<div class="settings-submit-wrapper" >
|
||||||
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
<button type="submit" name="submit" class="btn btn-primary">{{$submit}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue