causefx преди 8 години
родител
ревизия
8b38089ca0
променени са 9 файла, в които са добавени 370 реда и са изтрити 11 реда
  1. 2 0
      .gitignore
  2. 2 1
      api/config/default.php
  3. 20 1
      api/functions/organizr-functions.php
  4. 3 1
      api/index.php
  5. 0 0
      css/style.css
  6. 323 0
      css/themes/Organizr.css
  7. 2 3
      index.php
  8. 3 0
      js/custom.js
  9. 15 5
      js/functions.js

+ 2 - 0
.gitignore

@@ -90,3 +90,5 @@ api/upgrade*
 cacert.pem
 wallpaper.jpg
 strings.json
+css/themes/*.css
+!css/themes/Organizr.css

+ 2 - 1
api/config/default.php

@@ -7,5 +7,6 @@ return array(
     'useLogo' => false,
     'headerColor' => '',
     'headerTextColor' => '',
-    'lockScreen' => false
+    'lockScreen' => false,
+    'theme'=>'Organizr'
 );

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

@@ -211,7 +211,15 @@ function getCustomizeAppearance(){
                     'value' => $GLOBALS['headerColor'],
                     'class' => 'colorpicker',
                     'disabled' => true
-                )
+                ),
+				array(
+					'type' => 'select',
+					'name' => 'theme',
+					'label' => 'Theme',
+					'class' => 'themeChanger',
+					'value' => $GLOBALS['theme'],
+					'options' => getThemes()
+				)
             ),
             'database' => array(
 
@@ -368,6 +376,17 @@ function editImages(){
     }
     return false;
 }
+function getThemes(){
+	$themes = array();
+	foreach (glob(dirname(__DIR__,2).DIRECTORY_SEPARATOR.'css' . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . "*.css") as $filename){
+
+		$themes[] = array(
+			'name' => preg_replace('/\\.[^.\\s]{3,4}$/', '', basename($filename)),
+			'value' => preg_replace('/\\.[^.\\s]{3,4}$/', '', basename($filename))
+		);
+	}
+	return $themes;
+}
 /*
 function sendEmail($email = null, $username = "Organizr User", $subject, $body, $cc = null, $bcc = null){
 	try {

+ 3 - 1
api/index.php

@@ -594,7 +594,9 @@ switch ($function) {
                 $status['categories'] = loadTabs()['categories'];
                 $status['tabs'] = loadTabs()['tabs'];
                 $result['data'] = $status;
-				$result['branch'] = $GLOBALS['branch'];
+                $result['branch'] = $GLOBALS['branch'];
+                $result['theme'] = $GLOBALS['theme'];
+				$result['version'] = $GLOBALS['installedVersion'];
                 break;
             default:
                 $result['status'] = 'error';

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
css/style.css


Файловите разлики са ограничени, защото са твърде много
+ 323 - 0
css/themes/Organizr.css


+ 2 - 3
index.php

@@ -22,10 +22,9 @@
 	<link href="plugins/bower_components/jquery-asColorPicker-master/css/asColorPicker.css" rel="stylesheet">
 	<link href="plugins/bower_components/dropzone-master/dist/dropzone.css" rel="stylesheet" type="text/css" />
 	<link href="css/style.css?v=<?php echo $GLOBALS['installedVersion']; ?>" rel="stylesheet">
-	<link href="css/colors/blue-dark.css?v=<?php echo $GLOBALS['installedVersion']; ?>" rel="stylesheet">
 	<?php echo pluginFiles('css'); ?>
-	<style type="text/css" id="user-appearance"></style>
 	<link id="theme" rel="stylesheet">
+	<style type="text/css" id="user-appearance"></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>
@@ -86,7 +85,7 @@
 		<!-- ============================================================== -->
 		<!-- Page Content -->
 		<!-- ============================================================== -->
-		<div class="error-page"></div>
+		<div class="error-page bg-theme-dark"></div>
 		<div class="login-area hidden"></div>
 		<div class="p-0" id="page-wrapper">
 			<div class="organizr-area"></div>

+ 3 - 0
js/custom.js

@@ -994,6 +994,9 @@ $(document).on('change asColorPicker::close', '#customize-appearance-form :input
 	var callbacks = $.Callbacks();
     //callbacks.add( buildCustomizeAppearance );
     settingsAPI(post,callbacks);
+    if($(this).hasClass('themeChanger')){
+        changeTheme(value);
+    }
 
 });
 //DELETE IMAGE

+ 15 - 5
js/functions.js

@@ -1669,7 +1669,6 @@ function buildErrorPage(error){
 			<p class="text-muted m-t-30 m-b-30" lang="en">`+message+`</p>
 			<a href="javascript:void(0);" class="btn btn-`+color+` btn-rounded waves-effect waves-light m-b-40 closeErrorPage" lang="en">OK</a>
 		</div>
-		<footer class="footer text-center">Organizr</footer>
 	</div>
 	`;
 }
@@ -1692,6 +1691,14 @@ function errorPage(error=null){
 	}
 
 }
+function changeTheme(theme){
+	//$("#preloader").fadeIn();
+	$('#theme').attr({
+        href: 'css/themes/' + theme + '.css?v='+activeInfo.version
+    });
+	//$("#preloader").fadeOut();
+	console.log('Theme: '+theme);
+}
 function launch(){
 	organizrConnect('api/?v1/launch_organizr').success(function (data) {
 		var json = JSON.parse(data);
@@ -1710,11 +1717,16 @@ function launch(){
 			serverOS:json.data.status.os,
 			phpVersion:json.data.status.php,
 			token:json.data.user.token,
-			branch:json.branch
+			branch:json.branch,
+			theme:json.theme,
+			version:json.version
 		};
 		console.log("%cOrganizr","color: #66D9EF; font-size: 24px; font-family: Monospace;");
 		console.log("%cVersion: "+currentVersion,"color: #AD80FD; font-size: 12px; font-family: Monospace;");
-		console.log("%cStarting Up...","color: #F92671; font-size: 12px; font-family: Monospace;")
+		console.log("%cStarting Up...","color: #F92671; font-size: 12px; font-family: Monospace;");
+		checkMessage();
+		errorPage();
+		changeTheme(activeInfo.theme);
 		switch (json.data.status.status) {
 			case "wizard":
 				buildWizard();
@@ -1733,6 +1745,4 @@ function launch(){
 				console.error('Organizr Function: Action not set or defined');
 		}
 	});
-	checkMessage();
-	errorPage();
 }

Някои файлове не бяха показани, защото твърде много файлове са промени