more comanche migration

This commit is contained in:
friendica 2013-12-19 02:16:14 -08:00
parent 2089a1379a
commit 125543aded
14 changed files with 58 additions and 127 deletions

View File

@ -1889,18 +1889,17 @@ function json_decode_plus($s) {
function design_tools() {
$channel = get_app()->get_channel();
$who = $channel['channel_address'];
return replace_macros(get_markup_template('design_tools.tpl'), array(
'$title' => t('Design'),
'$who' => $who,
'$blocks' => t('Blocks'),
'$menus' => t('Menus'),
'$layout' => t('Layouts'),
'$pages' => t('Pages')
));
$channel = get_app()->get_channel();
$who = $channel['channel_address'];
return replace_macros(get_markup_template('design_tools.tpl'), array(
'$title' => t('Design'),
'$who' => $who,
'$blocks' => t('Blocks'),
'$menus' => t('Menus'),
'$layout' => t('Layouts'),
'$pages' => t('Pages')
));
}
/* case insensitive in_array() */

View File

@ -494,4 +494,20 @@ function widget_mailmenu($arr) {
));
}
function widget_design_tools($arr) {
$a = get_app();
// mod menu doesn't load a profile. For any modules which load a profile, check it.
// otherwise local_user() is sufficient for permissions.
if($a->profile['profile_uid'])
if($a->profile['profile_uid'] != local_user())
return '';
if(! local_user())
return '';
return design_tools();
}

View File

@ -45,9 +45,9 @@ function blocks_content(&$a) {
return;
}
if(local_user() && local_user() == $owner) {
$a->set_widget('design',design_tools());
}
// if(local_user() && local_user() == $owner) {
// $a->set_widget('design',design_tools());
// }

View File

@ -43,9 +43,9 @@ function layouts_content(&$a) {
return;
}
if(local_user() && local_user() == $owner) {
$a->set_widget('design',design_tools());
}
// if(local_user() && local_user() == $owner) {
// $a->set_widget('design',design_tools());
// }
$tabs = array(
array(

View File

@ -42,7 +42,7 @@ function menu_content(&$a) {
}
$a->set_widget('design',design_tools());
// $a->set_widget('design',design_tools());
if(argc() == 1) {

View File

@ -16,14 +16,10 @@ function get_theme_config_file($theme){
}
function settings_init(&$a) {
if(! local_user())
return;
$a->profile_uid = local_user();
}
function settings_aside(&$a) {
if (! local_user())
return;
// default is channel settings in the absence of other arguments
@ -32,107 +28,9 @@ if (! local_user())
$a->argc = 2;
$a->argv[] = 'channel';
}
/*
$channel = $a->get_channel();
$abook_self_id = 0;
// Retrieve the 'self' address book entry for use in the auto-permissions link
if(local_user()) {
$abk = q("select abook_id from abook where abook_channel = %d and ( abook_flags & %d ) limit 1",
intval(local_user()),
intval(ABOOK_FLAG_SELF)
);
if($abk)
$abook_self_id = $abk[0]['abook_id'];
}
$tabs = array(
array(
'label' => t('Account settings'),
'url' => $a->get_baseurl(true).'/settings/account',
'selected' => ((argv(1) === 'account') ? 'active' : ''),
),
array(
'label' => t('Channel settings'),
'url' => $a->get_baseurl(true).'/settings/channel',
'selected' => ((argv(1) === 'channel') ? 'active' : ''),
),
array(
'label' => t('Additional features'),
'url' => $a->get_baseurl(true).'/settings/features',
'selected' => ((argv(1) === 'features') ? 'active' : ''),
),
array(
'label' => t('Feature settings'),
'url' => $a->get_baseurl(true).'/settings/featured',
'selected' => ((argv(1) === 'featured') ? 'active' : ''),
),
array(
'label' => t('Display settings'),
'url' => $a->get_baseurl(true).'/settings/display',
'selected' => ((argv(1) === 'display') ? 'active' : ''),
),
array(
'label' => t('Connected apps'),
'url' => $a->get_baseurl(true) . '/settings/oauth',
'selected' => ((argv(1) === 'oauth') ? 'active' : ''),
),
array(
'label' => t('Export channel'),
'url' => $a->get_baseurl(true) . '/uexport/basic',
'selected' => ''
),
// array(
// 'label' => t('Export account'),
// 'url' => $a->get_baseurl(true) . '/uexport/complete',
// 'selected' => ''
// ),
array(
'label' => t('Automatic Permissions (Advanced)'),
'url' => $a->get_baseurl(true) . '/connedit/' . $abook_self_id,
'selected' => ''
),
);
if(feature_enabled(local_user(),'premium_channel')) {
$tabs[] = array(
'label' => t('Premium Channel Settings'),
'url' => $a->get_baseurl(true) . '/connect/' . $channel['channel_address'],
'selected' => ''
);
}
if(feature_enabled(local_user(),'channel_sources')) {
$tabs[] = array(
'label' => t('Channel Sources'),
'url' => $a->get_baseurl(true) . '/sources',
'selected' => ''
);
}
$tabtpl = get_markup_template("generic_links_widget.tpl");
$a->page['aside'] = replace_macros($tabtpl, array(
'$title' => t('Settings'),
'$class' => 'settings-widget',
'$items' => $tabs,
));
*/
}

View File

@ -41,9 +41,9 @@ function webpages_content(&$a) {
return;
}
if(local_user() && local_user() == $owner) {
$a->set_widget('design',design_tools());
}
// if(local_user() && local_user() == $owner) {
// $a->set_widget('design',design_tools());
// }
$mimetype = get_config('system','page_mimetype');

View File

@ -1 +1 @@
2013-12-17.530
2013-12-19.531

3
view/pdl/mod_blocks.pdl Normal file
View File

@ -0,0 +1,3 @@
[region=aside]
[widget=design_tools][/widget]
[/region]

3
view/pdl/mod_layouts.pdl Normal file
View File

@ -0,0 +1,3 @@
[region=aside]
[widget=design_tools][/widget]
[/region]

3
view/pdl/mod_menu.pdl Normal file
View File

@ -0,0 +1,3 @@
[region=aside]
[widget=design_tools][/widget]
[/region]

View File

@ -0,0 +1,3 @@
[region=aside]
[widget=design_tools][/widget]
[/region]

View File

@ -2122,6 +2122,10 @@ a .drop-icons:hover {
margin-right: 10px;
}
.design-tools ul {
list-style-type: none;
}
.design-icons {
margin-right: 10px;
}

View File

@ -1,7 +1,9 @@
<div id="design-tools" class="widget design-tools">
<h3>{{$title}}</h3>
<ul>
<li><a href="blocks/{{$who}}">{{$blocks}}</a></li>
<li><a href="menu">{{$menus}}</a></li>
<li><a href="layouts/{{$who}}">{{$layout}}</a></li>
<li><a href="webpages/{{$who}}">{{$pages}}</a></li>
</ul>
</div>