causefx 8 rokov pred
rodič
commit
23ccc71ac4

+ 2 - 1
api/config/default.php

@@ -119,5 +119,6 @@ return array(
     'calendarEnd' => '14',
     'calendarRefresh' => '60000',
     'calendarTimeFormat' => 'h(:mm)t',
-    'calendarLimit' => '1000'
+    'calendarLimit' => '1000',
+	'customCss' => ''
 );

+ 10 - 1
api/functions/organizr-functions.php

@@ -372,6 +372,7 @@ function loadAppearance(){
     $appearance['sidebarColor'] = $GLOBALS['sidebarColor'];
     $appearance['headerTextColor'] = $GLOBALS['headerTextColor'];
     $appearance['sidebarTextColor'] = $GLOBALS['sidebarTextColor'];
+    $appearance['customCss'] = $GLOBALS['customCss'];
     return $appearance;
 }
 function getCustomizeAppearance(){
@@ -466,7 +467,15 @@ function getCustomizeAppearance(){
                             'value' => 'horizontal'
                         )
                     )
-				)
+				),
+                array(
+                    'type' => 'textbox',
+                    'name' => 'customCss',
+                    'label' => 'Custom CSS [Can replace colors from above]',
+                    'value' => $GLOBALS['customCss'],
+                    'placeholder' => 'No <style> tags needed',
+                    'override' => 12
+                ),
             )
         );
     }

+ 1 - 0
index.php

@@ -28,6 +28,7 @@
 	<?php echo pluginFiles('css'); ?>
 	<link id="theme" href="css/themes/Organizr.css?v=<?php echo $GLOBALS['installedVersion']; ?>" rel="stylesheet">
 	<style type="text/css" id="user-appearance"></style>
+	<style type="text/css" id="custom-css"></style>
 	<!--[if lt IE 9]>
     <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
     <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>

+ 17 - 5
js/functions.js

@@ -531,6 +531,7 @@ function buildFormItem(item){
 	var id = (item.id) ? ' id="'+item.id+'"' : '';
 	var type = (item.type) ? ' data-type="'+item.type+'"' : '';
 	var value = (item.value) ? ' value="'+item.value+'"' : '';
+	var textarea = (item.value) ? item.value : '';
 	var name = (item.name) ? ' name="'+item.name+'"' : '';
 	var extraClass = (item.class) ? ' '+item.class : '';
 	var icon = (item.icon) ? ' '+item.icon : '';
@@ -541,8 +542,12 @@ function buildFormItem(item){
 	//+tof(item.value,'c')+`
 	switch (item.type) {
 		case 'input':
+		case 'text':
 			return '<input data-changed="false" lang=en" type="text" class="form-control'+extraClass+'"'+placeholder+value+id+name+disabled+type+attr+' autocomplete="new-password" />';
 			break;
+		case 'textbox':
+			return '<textarea data-changed="false" class="form-control'+extraClass+'"'+placeholder+id+name+disabled+type+attr+' autocomplete="new-password">'+textarea+'</textarea>';
+			break;
 		case 'password':
 			return '<input data-changed="false" lang=en" type="password" class="form-control'+extraClass+'"'+placeholder+value+id+name+disabled+type+attr+' autocomplete="new-password" />';
 			break;
@@ -718,11 +723,15 @@ function buildFormGroup(array){
 				<div class="row">
 			`;
 			$.each(v, function(i,v) {
+				var override = '6';
+				if(typeof v.override !== 'undefined'){
+					override = v.override;
+				}
 				count++;
 				if(count%2 !== 0 ){ group += '<div class="row start">'; };
 				group += `
 					<!-- INPUT BOX -->
-					<div class="col-md-6 p-b-10">
+					<div class="col-md-`+override+` p-b-10">
 						<div class="form-group">
 							<label class="control-label col-md-3" lang="en">`+v.label+`</label>
 							<div class="col-md-9">
@@ -1735,12 +1744,12 @@ function loadAppearance(appearance){
 	}
 	if(appearance.sidebarTextColor !== ''){
 		cssSettings += `
-		    #side-menu li a {
+		    #side-menu li a,
+			.sidebar .sidebar-head h3,
+			#side-menu > li > a.active, #side-menu > li > ul > li > a.active
+			{
 			    color: `+appearance.sidebarTextColor+`;
 		    }
-			#side-menu > li > a.active, #side-menu > li > ul > li > a.active {
-			   color: `+appearance.sidebarTextColor+`;
-		   }
 		`;
 	}
 	if(appearance.loginWallpaper !== ''){
@@ -1768,6 +1777,9 @@ function loadAppearance(appearance){
 	if(cssSettings !== ''){
 		$('#user-appearance').html(cssSettings);
 	}
+	if(appearance.customCss !== ''){
+		$('#custom-css').html(appearance.customCss);
+	}
 
 }
 function clearForm(form){