diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/text.php | 28 | ||||
-rw-r--r-- | include/widgets.php | 14 |
2 files changed, 42 insertions, 0 deletions
diff --git a/include/text.php b/include/text.php index 986e3b56c..096c8a5aa 100644 --- a/include/text.php +++ b/include/text.php @@ -2246,6 +2246,34 @@ function design_tools() { )); } +/** + * @brief Creates website import tools menu + * + * @return string + */ +function website_import_tools() { + + $channel = App::get_channel(); + $sys = false; + + if(App::$is_sys && is_site_admin()) { + require_once('include/channel.php'); + $channel = get_sys_channel(); + $sys = true; + } + + $who = $channel['channel_address']; + + return replace_macros(get_markup_template('website_import_tools.tpl'), array( + '$title' => t('Import'), + //'$who' => $who, + '$import_label' => t('Import website...'), + '$import_placeholder' => t('Select folder to import'), + '$file_upload_text' => t('Import from a zipped folder:'), + '$file_import_text' => t('Import from cloud files:') + )); +} + /* case insensitive in_array() */ function in_arrayi($needle, $haystack) { diff --git a/include/widgets.php b/include/widgets.php index 2d4d5b799..352c844ee 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -770,6 +770,20 @@ function widget_design_tools($arr) { return design_tools(); } +function widget_website_import_tools($arr) { + + // mod menu doesn't load a profile. For any modules which load a profile, check it. + // otherwise local_channel() is sufficient for permissions. + + if(App::$profile['profile_uid']) + if((App::$profile['profile_uid'] != local_channel()) && (! App::$is_sys)) + return ''; + + if(! local_channel()) + return ''; + + return website_import_tools(); +} function widget_findpeople($arr) { return findpeople_widget(); |