diff options
-rwxr-xr-x | include/text.php | 23 | ||||
-rw-r--r-- | include/widgets.php | 16 | ||||
-rw-r--r-- | mod/blocks.php | 6 | ||||
-rw-r--r-- | mod/layouts.php | 6 | ||||
-rw-r--r-- | mod/menu.php | 2 | ||||
-rw-r--r-- | mod/settings.php | 108 | ||||
-rw-r--r-- | mod/webpages.php | 6 | ||||
-rw-r--r-- | version.inc | 2 | ||||
-rw-r--r-- | view/pdl/mod_blocks.pdl | 3 | ||||
-rw-r--r-- | view/pdl/mod_layouts.pdl | 3 | ||||
-rw-r--r-- | view/pdl/mod_menu.pdl | 3 | ||||
-rw-r--r-- | view/pdl/mod_webpages.pdl | 3 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 4 | ||||
-rw-r--r-- | view/tpl/design_tools.tpl | 2 |
14 files changed, 59 insertions, 128 deletions
diff --git a/include/text.php b/include/text.php index f808fb0a0..b3154d23e 100755 --- a/include/text.php +++ b/include/text.php @@ -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() */ diff --git a/include/widgets.php b/include/widgets.php index 9d6617aa2..ed155be9b 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -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(); }
\ No newline at end of file diff --git a/mod/blocks.php b/mod/blocks.php index 4604790c3..9a4e0b1ca 100644 --- a/mod/blocks.php +++ b/mod/blocks.php @@ -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()); + // } diff --git a/mod/layouts.php b/mod/layouts.php index b1f53d4d8..9ed349850 100644 --- a/mod/layouts.php +++ b/mod/layouts.php @@ -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( diff --git a/mod/menu.php b/mod/menu.php index 1ec3c7996..47eed6484 100644 --- a/mod/menu.php +++ b/mod/menu.php @@ -42,7 +42,7 @@ function menu_content(&$a) { } - $a->set_widget('design',design_tools()); +// $a->set_widget('design',design_tools()); if(argc() == 1) { diff --git a/mod/settings.php b/mod/settings.php index 7fb6f8317..5aa018cc2 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -16,14 +16,10 @@ function get_theme_config_file($theme){ } function settings_init(&$a) { - $a->profile_uid = local_user(); -} - - -function settings_aside(&$a) { + if(! local_user()) + return; -if (! local_user()) - return; + $a->profile_uid = local_user(); // 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, - )); -*/ } diff --git a/mod/webpages.php b/mod/webpages.php index 90004faa1..7e1b32f36 100644 --- a/mod/webpages.php +++ b/mod/webpages.php @@ -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'); diff --git a/version.inc b/version.inc index 50e01fa2c..8ba637b20 100644 --- a/version.inc +++ b/version.inc @@ -1 +1 @@ -2013-12-17.530 +2013-12-19.531 diff --git a/view/pdl/mod_blocks.pdl b/view/pdl/mod_blocks.pdl new file mode 100644 index 000000000..cef69f194 --- /dev/null +++ b/view/pdl/mod_blocks.pdl @@ -0,0 +1,3 @@ +[region=aside] +[widget=design_tools][/widget] +[/region]
\ No newline at end of file diff --git a/view/pdl/mod_layouts.pdl b/view/pdl/mod_layouts.pdl new file mode 100644 index 000000000..cef69f194 --- /dev/null +++ b/view/pdl/mod_layouts.pdl @@ -0,0 +1,3 @@ +[region=aside] +[widget=design_tools][/widget] +[/region]
\ No newline at end of file diff --git a/view/pdl/mod_menu.pdl b/view/pdl/mod_menu.pdl new file mode 100644 index 000000000..cef69f194 --- /dev/null +++ b/view/pdl/mod_menu.pdl @@ -0,0 +1,3 @@ +[region=aside] +[widget=design_tools][/widget] +[/region]
\ No newline at end of file diff --git a/view/pdl/mod_webpages.pdl b/view/pdl/mod_webpages.pdl new file mode 100644 index 000000000..cef69f194 --- /dev/null +++ b/view/pdl/mod_webpages.pdl @@ -0,0 +1,3 @@ +[region=aside] +[widget=design_tools][/widget] +[/region]
\ No newline at end of file diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 411356d80..5f532a861 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -2122,6 +2122,10 @@ a .drop-icons:hover { margin-right: 10px; } +.design-tools ul { + list-style-type: none; +} + .design-icons { margin-right: 10px; } diff --git a/view/tpl/design_tools.tpl b/view/tpl/design_tools.tpl index eb082dc37..80a538231 100644 --- a/view/tpl/design_tools.tpl +++ b/view/tpl/design_tools.tpl @@ -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> |