diabook: theme-settings: add a wide-option
0
view/theme/diabook/communityhome.tpl
Normal file → Executable file
|
@ -11,8 +11,9 @@ function theme_content(&$a){
|
|||
|
||||
$font_size = get_pconfig(local_user(), 'diabook', 'font_size' );
|
||||
$line_height = get_pconfig(local_user(), 'diabook', 'line_height' );
|
||||
$resolution = get_pconfig(local_user(), 'diabook', 'resolution' );
|
||||
|
||||
return diabook_form($a,$font_size, $line_height);
|
||||
return diabook_form($a,$font_size, $line_height, $resolution);
|
||||
}
|
||||
|
||||
function theme_post(&$a){
|
||||
|
@ -22,6 +23,7 @@ function theme_post(&$a){
|
|||
if (isset($_POST['diabook-settings-submit'])){
|
||||
set_pconfig(local_user(), 'diabook', 'font_size', $_POST['diabook_font_size']);
|
||||
set_pconfig(local_user(), 'diabook', 'line_height', $_POST['diabook_line_height']);
|
||||
set_pconfig(local_user(), 'diabook', 'resolution', $_POST['diabook_resolution']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,33 +31,43 @@ function theme_post(&$a){
|
|||
function theme_admin(&$a){
|
||||
$font_size = get_config('diabook', 'font_size' );
|
||||
$line_height = get_config('diabook', 'line_height' );
|
||||
$resolution = get_config('diabook', 'resolution' );
|
||||
|
||||
return diabook_form($a,$font_size, $line_height);
|
||||
return diabook_form($a,$font_size, $line_height, $resolution);
|
||||
}
|
||||
|
||||
function theme_admin_post(&$a){
|
||||
if (isset($_POST['diabook-settings-submit'])){
|
||||
set_config('diabook', 'font_size', $_POST['diabook_font_size']);
|
||||
set_config('diabook', 'line_height', $_POST['diabook_line_height']);
|
||||
set_config('diabook', 'resolution', $_POST['diabook_resolution']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function diabook_form(&$a, $font_size, $line_height){
|
||||
function diabook_form(&$a, $font_size, $line_height, $resolution){
|
||||
$line_heights = array(
|
||||
"1.4"=>"1.4",
|
||||
"1.3"=>"1.3",
|
||||
"---"=>"---",
|
||||
"1.5"=>"1.5",
|
||||
"1.4"=>"1.4",
|
||||
"1.2"=>"1.2",
|
||||
"1.1"=>"1.1",
|
||||
);
|
||||
|
||||
$font_sizes = array(
|
||||
'13'=>'13',
|
||||
"---"=>"---",
|
||||
"15"=>"15",
|
||||
'14'=>'14',
|
||||
'13.5'=>'13.5',
|
||||
'13'=>'13',
|
||||
'12.5'=>'12.5',
|
||||
'12'=>'12',
|
||||
);
|
||||
$resolutions = array(
|
||||
'normal'=>'normal',
|
||||
'wide'=>'wide',
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
@ -66,6 +78,7 @@ function diabook_form(&$a, $font_size, $line_height){
|
|||
'$title' => t("Theme settings"),
|
||||
'$font_size' => array('diabook_font_size', t('Set font-size for posts and comments'), $font_size, '', $font_sizes),
|
||||
'$line_height' => array('diabook_line_height', t('Set line-height for posts and comments'), $line_height, '', $line_heights),
|
||||
'$resolution' => array('diabook_resolution', t('Set resolution for middle column'), $resolution, '', $resolutions),
|
||||
));
|
||||
return $o;
|
||||
}
|
||||
|
|
0
view/theme/diabook/contact_template.tpl
Normal file → Executable file
0
view/theme/diabook/directory_item.tpl
Normal file → Executable file
0
view/theme/diabook/fpostit/fpostit.js
Normal file → Executable file
0
view/theme/diabook/group_side.tpl
Normal file → Executable file
0
view/theme/diabook/icons/attach.png
Normal file → Executable file
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
0
view/theme/diabook/icons/audio.png
Normal file → Executable file
Before Width: | Height: | Size: 762 B After Width: | Height: | Size: 762 B |
0
view/theme/diabook/icons/camera.png
Normal file → Executable file
Before Width: | Height: | Size: 685 B After Width: | Height: | Size: 685 B |
0
view/theme/diabook/icons/close_box.png
Normal file → Executable file
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 206 B |
0
view/theme/diabook/icons/contacts2.png
Normal file → Executable file
Before Width: | Height: | Size: 549 B After Width: | Height: | Size: 549 B |
0
view/theme/diabook/icons/drop.png
Normal file → Executable file
Before Width: | Height: | Size: 292 B After Width: | Height: | Size: 292 B |
0
view/theme/diabook/icons/expand.png
Normal file → Executable file
Before Width: | Height: | Size: 263 B After Width: | Height: | Size: 263 B |
0
view/theme/diabook/icons/file_as.png
Normal file → Executable file
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 352 B |
0
view/theme/diabook/icons/link.png
Normal file → Executable file
Before Width: | Height: | Size: 365 B After Width: | Height: | Size: 365 B |
0
view/theme/diabook/icons/lock.png
Normal file → Executable file
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 366 B |
0
view/theme/diabook/icons/lupe.png
Normal file → Executable file
Before Width: | Height: | Size: 697 B After Width: | Height: | Size: 697 B |
0
view/theme/diabook/icons/next.png
Normal file → Executable file
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 300 B |
0
view/theme/diabook/icons/notifications.png
Normal file → Executable file
Before Width: | Height: | Size: 926 B After Width: | Height: | Size: 926 B |
0
view/theme/diabook/icons/notifications3.png
Normal file → Executable file
Before Width: | Height: | Size: 714 B After Width: | Height: | Size: 714 B |
0
view/theme/diabook/icons/notify.png
Normal file → Executable file
Before Width: | Height: | Size: 1,001 B After Width: | Height: | Size: 1,001 B |
0
view/theme/diabook/icons/notify3.png
Normal file → Executable file
Before Width: | Height: | Size: 534 B After Width: | Height: | Size: 534 B |
0
view/theme/diabook/icons/pencil.png
Normal file → Executable file
Before Width: | Height: | Size: 286 B After Width: | Height: | Size: 286 B |
0
view/theme/diabook/icons/prev.png
Normal file → Executable file
Before Width: | Height: | Size: 336 B After Width: | Height: | Size: 336 B |
0
view/theme/diabook/icons/recycle.png
Normal file → Executable file
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 296 B |
0
view/theme/diabook/icons/remote.png
Normal file → Executable file
Before Width: | Height: | Size: 427 B After Width: | Height: | Size: 427 B |
0
view/theme/diabook/icons/scroll_top.png
Normal file → Executable file
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 296 B |
0
view/theme/diabook/icons/star.png
Normal file → Executable file
Before Width: | Height: | Size: 388 B After Width: | Height: | Size: 388 B |
0
view/theme/diabook/icons/starred.png
Normal file → Executable file
Before Width: | Height: | Size: 501 B After Width: | Height: | Size: 501 B |
0
view/theme/diabook/icons/tagged.png
Normal file → Executable file
Before Width: | Height: | Size: 353 B After Width: | Height: | Size: 353 B |
0
view/theme/diabook/icons/unlock.png
Normal file → Executable file
Before Width: | Height: | Size: 362 B After Width: | Height: | Size: 362 B |
0
view/theme/diabook/icons/unstarred.png
Normal file → Executable file
Before Width: | Height: | Size: 468 B After Width: | Height: | Size: 468 B |
0
view/theme/diabook/icons/video.png
Normal file → Executable file
Before Width: | Height: | Size: 472 B After Width: | Height: | Size: 472 B |
0
view/theme/diabook/icons/weblink.png
Normal file → Executable file
Before Width: | Height: | Size: 505 B After Width: | Height: | Size: 505 B |
0
view/theme/diabook/jot.tpl
Normal file → Executable file
0
view/theme/diabook/mail_conv.tpl
Normal file → Executable file
0
view/theme/diabook/search_item.tpl
Normal file → Executable file
2578
view/theme/diabook/style-network-wide.css
Normal file
2560
view/theme/diabook/style-profile-wide.css
Normal file
2821
view/theme/diabook/style-wide.css
Normal file
|
@ -1,24 +1,42 @@
|
|||
<?php
|
||||
$line_height=false;
|
||||
$diabook_font_size=false;
|
||||
$resolution=false;
|
||||
$site_line_height = get_config("diabook","line_height");
|
||||
$site_diabook_font_size = get_config("diabook", "font_size" );
|
||||
$site_resolution = get_config("diabook", "resolution" );
|
||||
|
||||
|
||||
if (local_user()) {
|
||||
$line_height = get_pconfig(local_user(), "diabook","line_height");
|
||||
$diabook_font_size = get_pconfig(local_user(), "diabook", "font_size");
|
||||
$resolution = get_pconfig(local_user(), "diabook", "resolution");
|
||||
}
|
||||
|
||||
if ($line_height===false) $line_height=$site_line_height;
|
||||
if ($line_height===false) $line_height="1.3";
|
||||
if ($diabook_font_size===false) $diabook_font_size=$site_diabook_font_size;
|
||||
if ($diabook_font_size===false) $diabook_font_size="13";
|
||||
if ($resolution===false) $resolution=$site_resolution;
|
||||
if ($resolution===false) $resolution="normal";
|
||||
|
||||
|
||||
|
||||
if($resolution == "normal") {
|
||||
if (file_exists("$THEMEPATH/style.css")){
|
||||
echo file_get_contents("$THEMEPATH/style.css");
|
||||
}
|
||||
|
||||
if($diabook_font_size == "15"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
font-size: 15px;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($diabook_font_size == "14"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
|
@ -74,6 +92,17 @@
|
|||
}
|
||||
";
|
||||
}
|
||||
if($line_height == "1.5"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
line-height: 1.5;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($line_height == "1.4"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
|
@ -118,3 +147,131 @@
|
|||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
if($resolution == "wide") {
|
||||
if (file_exists("$THEMEPATH/style-wide.css")){
|
||||
echo file_get_contents("$THEMEPATH/style-wide.css");
|
||||
}
|
||||
if($diabook_font_size == "15"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
font-size: 15px;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($diabook_font_size == "14"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
font-size: 14px;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($diabook_font_size == "13.5"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
font-size: 13.5px;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
font-size: 13.5px;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($diabook_font_size == "13"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
font-size: 13px;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($diabook_font_size == "12.5"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
font-size: 12.5px;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
font-size: 12.5px;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($diabook_font_size == "12"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
font-size: 12px;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($line_height == "1.5"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
line-height: 1.5;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($line_height == "1.4"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
line-height: 1.4;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($line_height == "1.3"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
line-height: 1.3;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($line_height == "1.2"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
line-height: 1.2;
|
||||
}
|
||||
";
|
||||
}
|
||||
if($line_height == "1.1"){
|
||||
echo "
|
||||
.wall-item-container .wall-item-content {
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.wall-item-photo-container .wall-item-content {
|
||||
line-height: 1.1;
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
15
view/theme/diabook/theme.php
Normal file → Executable file
|
@ -14,7 +14,9 @@ $a->page['htmlhead'] .= sprintf('<script "%s" ></script>', $diabook_version);
|
|||
|
||||
//change css on network and profilepages
|
||||
$cssFile = null;
|
||||
|
||||
$resolution=false;
|
||||
$resolution = get_pconfig(local_user(), "diabook", "resolution");
|
||||
if ($resolution===false) $resolution="normal";
|
||||
|
||||
/**
|
||||
* prints last community activity
|
||||
|
@ -267,9 +269,10 @@ if ($a->argv[0] === "network" && local_user()){
|
|||
if($ccCookie != "8") {
|
||||
// COMMUNITY
|
||||
diabook_community_info();
|
||||
|
||||
|
||||
// CUSTOM CSS
|
||||
$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook/style-network.css";
|
||||
if($resolution == "normal") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook/style-network.css";}
|
||||
if($resolution == "wide") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook/style-network-wide.css";}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -282,8 +285,8 @@ if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){
|
|||
diabook_community_info();
|
||||
|
||||
// CUSTOM CSS
|
||||
$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook/style-profile.css";
|
||||
|
||||
if($resolution == "normal") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook/style-profile.css";}
|
||||
if($resolution == "wide") {$cssFile = $a->get_baseurl($ssl_state)."/view/theme/diabook/style-profile-wide.css";}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -291,6 +294,8 @@ if ($a->argv[0].$a->argv[1] === "profile".$a->user['nickname']){
|
|||
// custom css
|
||||
if (!is_null($cssFile)) $a->page['htmlhead'] .= sprintf('<link rel="stylesheet" type="text/css" href="%s" />', $cssFile);
|
||||
|
||||
|
||||
|
||||
//load jquery.cookie.js
|
||||
$cookieJS = $a->get_baseurl($ssl_state)."/view/theme/diabook/js/jquery.cookie.js";
|
||||
$a->page['htmlhead'] .= sprintf('<script language="JavaScript" src="%s"></script>', $cookieJS);
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
{{inc field_select.tpl with $field=$line_height}}{{endinc}}
|
||||
|
||||
{{inc field_select.tpl with $field=$resolution}}{{endinc}}
|
||||
|
||||
<div class="settings-submit-wrapper">
|
||||
<input type="submit" value="$submit" class="settings-submit" name="diabook-settings-submit" />
|
||||
</div>
|
||||
|
|