First draft of website import tools
This commit is contained in:
parent
50e581d88a
commit
a338a97d5b
@ -2246,6 +2246,30 @@ 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('design_tools.tpl'), array(
|
||||
'$title' => t('Import'),
|
||||
'$who' => $who,
|
||||
));
|
||||
}
|
||||
|
||||
/* case insensitive in_array() */
|
||||
|
||||
function in_arrayi($needle, $haystack) {
|
||||
|
@ -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();
|
||||
|
@ -1,3 +1,4 @@
|
||||
[region=aside]
|
||||
[widget=design_tools][/widget]
|
||||
[widget=website_import_tools][/widget]
|
||||
[/region]
|
7
view/tpl/website_import_tools.tpl
Normal file
7
view/tpl/website_import_tools.tpl
Normal file
@ -0,0 +1,7 @@
|
||||
<div id="website-import-tools" class="widget design-tools">
|
||||
<h3>{{$title}}</h3>
|
||||
<p class="descriptive-text">Import website from cloud files</p>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><button class="btn-md btn-primary"><a href="/cloud/{{$who}}">Select folder...</a></button></li>
|
||||
</ul>
|
||||
</div>
|
Reference in New Issue
Block a user