diff --git a/mod/locs.php b/mod/locs.php index 95aa7a579..b707f6bd9 100644 --- a/mod/locs.php +++ b/mod/locs.php @@ -1,34 +1,6 @@ get_channel(); + + $r = q("select * from hubloc where hubloc_hash = '%s'", + dbesc($channel['channel_hash']) + ); + + if(! $r) { + notice( t('No locations found.') . EOL); + return; + } + + + for($x = 0; $x < count($r); $x ++) { + $r[$x]['primary'] = (($r[$x]['hubloc_flags'] & HUBLOC_FLAGS_PRIMARY) ? true : false); + $r[$x]['deleted'] = (($r[$x]['hubloc_flags'] & HUBLOC_FLAGS_DELETED) ? true : false); + } + + + + $o = replace_macros(get_markup_template('locmanage.tpl'), array( + '$header' => t('Manage Channel Locations'), + '$loc' => t('Location (address)'), + '$mkprm' => t('Primary Location'), + '$drop' => t('Drop location'), + '$submit' => t('Submit'), + '$hubs' => $r + )); + + return $o; } \ No newline at end of file diff --git a/view/css/mod_locs.css b/view/css/mod_locs.css new file mode 100644 index 000000000..95aee6aef --- /dev/null +++ b/view/css/mod_locs.css @@ -0,0 +1,3 @@ +td { +padding: 10px; +} diff --git a/view/tpl/locmanage.tpl b/view/tpl/locmanage.tpl new file mode 100644 index 000000000..5a25850a1 --- /dev/null +++ b/view/tpl/locmanage.tpl @@ -0,0 +1,26 @@ +

{{$header}}

+ + + + + +{{foreach $hubs as $hub}} + + + + +{{/foreach}} +
{{$loc}}{{$mkprm}}{{$drop}}
+{{if $hub.deleted}}{{/if}} +{{$hub.hubloc_url}} ({{$hub.hubloc_addr}}){{if $hub.deleted}}{{/if}} + +{{if $hub.primary}}{{else}}{{/if}} +{{if $hub.primary}}{{else}}{{if ! $hub.deleted}}{{/if}}{{/if}}
+