Merge pull request #401 from sasiflo/master
Extended theme redbasic: Allow to center the content (aside + converse)
This commit is contained in:
commit
d25e902761
5
view/theme/redbasic/css/converse_center.css
Normal file
5
view/theme/redbasic/css/converse_center.css
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
body {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
max-width: $body_width;
|
||||||
|
}
|
@ -29,6 +29,7 @@ function theme_content(&$a) {
|
|||||||
$arr['radius'] = get_pconfig(local_user(),'redbasic', 'radius' );
|
$arr['radius'] = get_pconfig(local_user(),'redbasic', 'radius' );
|
||||||
$arr['shadow'] = get_pconfig(local_user(),'redbasic', 'photo_shadow' );
|
$arr['shadow'] = get_pconfig(local_user(),'redbasic', 'photo_shadow' );
|
||||||
$arr['converse_width']=get_pconfig(local_user(),"redbasic","converse_width");
|
$arr['converse_width']=get_pconfig(local_user(),"redbasic","converse_width");
|
||||||
|
$arr['converse_center']=get_pconfig(local_user(),"redbasic","converse_center");
|
||||||
$arr['nav_min_opacity']=get_pconfig(local_user(),"redbasic","nav_min_opacity");
|
$arr['nav_min_opacity']=get_pconfig(local_user(),"redbasic","nav_min_opacity");
|
||||||
$arr['top_photo']=get_pconfig(local_user(),"redbasic","top_photo");
|
$arr['top_photo']=get_pconfig(local_user(),"redbasic","top_photo");
|
||||||
$arr['reply_photo']=get_pconfig(local_user(),"redbasic","reply_photo");
|
$arr['reply_photo']=get_pconfig(local_user(),"redbasic","reply_photo");
|
||||||
@ -64,6 +65,7 @@ function theme_post(&$a) {
|
|||||||
set_pconfig(local_user(), 'redbasic', 'radius', $_POST['redbasic_radius']);
|
set_pconfig(local_user(), 'redbasic', 'radius', $_POST['redbasic_radius']);
|
||||||
set_pconfig(local_user(), 'redbasic', 'photo_shadow', $_POST['redbasic_shadow']);
|
set_pconfig(local_user(), 'redbasic', 'photo_shadow', $_POST['redbasic_shadow']);
|
||||||
set_pconfig(local_user(), 'redbasic', 'converse_width', $_POST['redbasic_converse_width']);
|
set_pconfig(local_user(), 'redbasic', 'converse_width', $_POST['redbasic_converse_width']);
|
||||||
|
set_pconfig(local_user(), 'redbasic', 'converse_center', $_POST['redbasic_converse_center']);
|
||||||
set_pconfig(local_user(), 'redbasic', 'nav_min_opacity', $_POST['redbasic_nav_min_opacity']);
|
set_pconfig(local_user(), 'redbasic', 'nav_min_opacity', $_POST['redbasic_nav_min_opacity']);
|
||||||
set_pconfig(local_user(), 'redbasic', 'top_photo', $_POST['redbasic_top_photo']);
|
set_pconfig(local_user(), 'redbasic', 'top_photo', $_POST['redbasic_top_photo']);
|
||||||
set_pconfig(local_user(), 'redbasic', 'reply_photo', $_POST['redbasic_reply_photo']);
|
set_pconfig(local_user(), 'redbasic', 'reply_photo', $_POST['redbasic_reply_photo']);
|
||||||
@ -118,6 +120,7 @@ if(feature_enabled(local_user(),'expert'))
|
|||||||
'$radius' => array('redbasic_radius', t('Set radius of corners'), $arr['radius']),
|
'$radius' => array('redbasic_radius', t('Set radius of corners'), $arr['radius']),
|
||||||
'$shadow' => array('redbasic_shadow', t('Set shadow depth of photos'), $arr['shadow']),
|
'$shadow' => array('redbasic_shadow', t('Set shadow depth of photos'), $arr['shadow']),
|
||||||
'$converse_width' => array('redbasic_converse_width',t('Set maximum width of conversation regions'),$arr['converse_width']),
|
'$converse_width' => array('redbasic_converse_width',t('Set maximum width of conversation regions'),$arr['converse_width']),
|
||||||
|
'$converse_center' => array('redbasic_converse_center',t('Center conversation regions'),$arr['converse_center']),
|
||||||
'$nav_min_opacity' => array('redbasic_nav_min_opacity',t('Set minimum opacity of nav bar - to hide it'),$arr['nav_min_opacity']),
|
'$nav_min_opacity' => array('redbasic_nav_min_opacity',t('Set minimum opacity of nav bar - to hide it'),$arr['nav_min_opacity']),
|
||||||
'$top_photo' => array('redbasic_top_photo', t('Set size of conversation author photo'), $arr['top_photo']),
|
'$top_photo' => array('redbasic_top_photo', t('Set size of conversation author photo'), $arr['top_photo']),
|
||||||
'$reply_photo' => array('redbasic_reply_photo', t('Set size of followup author photos'), $arr['reply_photo']),
|
'$reply_photo' => array('redbasic_reply_photo', t('Set size of followup author photos'), $arr['reply_photo']),
|
||||||
|
@ -32,6 +32,7 @@ if(! $a->install) {
|
|||||||
$radius = get_pconfig($uid, "redbasic", "radius");
|
$radius = get_pconfig($uid, "redbasic", "radius");
|
||||||
$shadow = get_pconfig($uid,"redbasic","photo_shadow");
|
$shadow = get_pconfig($uid,"redbasic","photo_shadow");
|
||||||
$converse_width=get_pconfig($uid,"redbasic","converse_width");
|
$converse_width=get_pconfig($uid,"redbasic","converse_width");
|
||||||
|
$converse_center=get_pconfig($uid,"redbasic","converse_center");
|
||||||
$nav_min_opacity=get_pconfig($uid,'redbasic','nav_min_opacity');
|
$nav_min_opacity=get_pconfig($uid,'redbasic','nav_min_opacity');
|
||||||
$sloppy_photos=get_pconfig($uid,'redbasic','sloppy_photos');
|
$sloppy_photos=get_pconfig($uid,'redbasic','sloppy_photos');
|
||||||
$top_photo=get_pconfig($uid,'redbasic','top_photo');
|
$top_photo=get_pconfig($uid,'redbasic','top_photo');
|
||||||
@ -116,8 +117,9 @@ if(! $a->install) {
|
|||||||
$shadow = "0";
|
$shadow = "0";
|
||||||
if(! $active_colour)
|
if(! $active_colour)
|
||||||
$active_colour = '#FFFFFF';
|
$active_colour = '#FFFFFF';
|
||||||
if (! $converse_width)
|
if (! $converse_width) {
|
||||||
$converse_width="1024px";
|
$converse_width="1024px";
|
||||||
|
}
|
||||||
if(! $top_photo)
|
if(! $top_photo)
|
||||||
$top_photo = '48px';
|
$top_photo = '48px';
|
||||||
$pmenu_top = intval($top_photo) - 16 . 'px';
|
$pmenu_top = intval($top_photo) - 16 . 'px';
|
||||||
@ -141,6 +143,8 @@ if(! $a->install) {
|
|||||||
if(file_exists('view/theme/redbasic/css/style.css')) {
|
if(file_exists('view/theme/redbasic/css/style.css')) {
|
||||||
$x = file_get_contents('view/theme/redbasic/css/style.css');
|
$x = file_get_contents('view/theme/redbasic/css/style.css');
|
||||||
|
|
||||||
|
$body_width = (231 + $converse_width) . 'px'; // aside is 231px + converse width; have to find a way for calculation with 'px', cannot handle '%'
|
||||||
|
|
||||||
$options = array (
|
$options = array (
|
||||||
'$nav_bg' => $nav_bg,
|
'$nav_bg' => $nav_bg,
|
||||||
'$nav_gradient_top' => $nav_gradient_top,
|
'$nav_gradient_top' => $nav_gradient_top,
|
||||||
@ -173,7 +177,8 @@ $options = array (
|
|||||||
'$pmenu_top' => $pmenu_top,
|
'$pmenu_top' => $pmenu_top,
|
||||||
'$pmenu_reply' => $pmenu_reply,
|
'$pmenu_reply' => $pmenu_reply,
|
||||||
'$wwtop' => $wwtop,
|
'$wwtop' => $wwtop,
|
||||||
'$comment_indent' => $comment_indent
|
'$comment_indent' => $comment_indent,
|
||||||
|
'$body_width' => $body_width
|
||||||
);
|
);
|
||||||
|
|
||||||
echo str_replace(array_keys($options), array_values($options), $x);
|
echo str_replace(array_keys($options), array_values($options), $x);
|
||||||
@ -185,3 +190,7 @@ if($sloppy_photos && file_exists('view/theme/redbasic/css/sloppy_photos.css')) {
|
|||||||
if($narrow_navbar && file_exists('view/theme/redbasic/css/narrow_navbar.css')) {
|
if($narrow_navbar && file_exists('view/theme/redbasic/css/narrow_navbar.css')) {
|
||||||
echo file_get_contents('view/theme/redbasic/css/narrow_navbar.css');
|
echo file_get_contents('view/theme/redbasic/css/narrow_navbar.css');
|
||||||
}
|
}
|
||||||
|
if($converse_center && file_exists('view/theme/redbasic/css/converse_center.css')) {
|
||||||
|
$x = file_get_contents('view/theme/redbasic/css/converse_center.css');
|
||||||
|
echo str_replace(array_keys($options), array_values($options), $x);
|
||||||
|
}
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
{{include file="field_input.tpl" field=$radius}}
|
{{include file="field_input.tpl" field=$radius}}
|
||||||
{{include file="field_input.tpl" field=$shadow}}
|
{{include file="field_input.tpl" field=$shadow}}
|
||||||
{{include file="field_input.tpl" field=$converse_width}}
|
{{include file="field_input.tpl" field=$converse_width}}
|
||||||
|
{{include file="field_checkbox.tpl" field=$converse_center}}
|
||||||
{{include file="field_input.tpl" field=$nav_min_opacity}}
|
{{include file="field_input.tpl" field=$nav_min_opacity}}
|
||||||
{{include file="field_input.tpl" field=$top_photo}}
|
{{include file="field_input.tpl" field=$top_photo}}
|
||||||
{{include file="field_input.tpl" field=$reply_photo}}
|
{{include file="field_input.tpl" field=$reply_photo}}
|
||||||
|
Reference in New Issue
Block a user