Explorar el Código

Merge pull request #357 from causefx/develop

Develop
causefx hace 8 años
padre
commit
2efcb29ea7
Se han modificado 5 ficheros con 72 adiciones y 36 borrados
  1. 2 2
      css/style.css
  2. 18 12
      functions.php
  3. 38 15
      homepage.php
  4. 13 6
      index.php
  5. 1 1
      settings.php

+ 2 - 2
css/style.css

@@ -1,4 +1,4 @@
-@charset "UTF-8";
+@charset "UTF-8";
 /*
  *
  *   ADVANTAGE - Responsive Admin Theme
@@ -5700,7 +5700,7 @@ label {
 
 .progress-widget tr td, .progress-widget tr th {
   vertical-align: middle !important;
-  padding: 8px 20px !important;
+  padding: 8px 20px;
 }
 
 .progress-widget tr td + td {

+ 18 - 12
functions.php

@@ -2,7 +2,7 @@
 
 // ===================================
 // Define Version
- define('INSTALLEDVERSION', '1.342');
+ define('INSTALLEDVERSION', '1.343');
 // ===================================
 
 // Debugging output functions
@@ -557,7 +557,8 @@ function outputCarousel($header, $size, $type, $items, $script = false) {
 function getEmbyStreams($size) {
 	$address = qualifyURL(EMBYURL);
 	
-	$api = json_decode(file_get_contents($address.'/Sessions?api_key='.EMBYTOKEN),true);
+	$api = json_decode(@file_get_contents($address.'/Sessions?api_key='.EMBYTOKEN),true);
+	if (!is_array($api)) { return 'Could not load!'; }
 	
 	$playingItems = array();
 	foreach($api as $key => $value) {
@@ -585,8 +586,9 @@ function getPlexStreams($size){
 	// Perform API requests
     $api = file_get_contents($address."/status/sessions?X-Plex-Token=".PLEXTOKEN);
     $api = simplexml_load_string($api);
-    $getServer = simplexml_load_string(file_get_contents($address."/?X-Plex-Token=".PLEXTOKEN));
-    
+    $getServer = simplexml_load_string(@file_get_contents($address."/?X-Plex-Token=".PLEXTOKEN));
+    if (!is_array($getServer)) { return 'Could not load!'; }
+	
 	// Identify the local machine
     $gotServer = $getServer['machineIdentifier'];
 	
@@ -637,7 +639,9 @@ function getEmbyRecent($type, $size) {
 	}
 	
 	// Get A User
-	$userIds = json_decode(file_get_contents($address.'/Users?api_key='.EMBYTOKEN),true);
+	$userIds = json_decode(@file_get_contents($address.'/Users?api_key='.EMBYTOKEN),true);
+	if (!is_array($userIds)) { return 'Could not load!'; }
+	
 	$showPlayed = true;
 	foreach ($userIds as $value) { // Scan for admin user
 		if (isset($value['Policy']) && isset($value['Policy']['IsAdministrator']) && $value['Policy']['IsAdministrator']) {
@@ -684,7 +688,8 @@ function getPlexRecent($type, $size){
 	// Perform Requests
     $api = file_get_contents($address."/library/recentlyAdded?X-Plex-Token=".PLEXTOKEN);
     $api = simplexml_load_string($api);
-    $getServer = simplexml_load_string(file_get_contents($address."/?X-Plex-Token=".PLEXTOKEN));
+    $getServer = simplexml_load_string(@file_get_contents($address."/?X-Plex-Token=".PLEXTOKEN));
+	if (!is_array($getServer)) { return 'Could not load!'; }
 	
 	// Identify the local machine
     $gotServer = $getServer['machineIdentifier'];
@@ -711,7 +716,7 @@ function getEmbyImage() {
 	if(isset($itemId)) {
 		$image_src = $embyAddress . '/Items/'.$itemId.'/Images/Primary?'.implode('&', $imgParams);
 		header('Content-type: image/jpeg');
-		readfile($image_src);
+		@readfile($image_src);
 		die();
 	} else {
 		debug_out('Invalid Request',1);
@@ -729,7 +734,7 @@ function getPlexImage() {
 	if(isset($image_url) && isset($image_height) && isset($image_width)) {
 		$image_src = $plexAddress . '/photo/:/transcode?height='.$image_height.'&width='.$image_width.'&upscale=1&url=' . $image_url . '&X-Plex-Token=' . PLEXTOKEN;
 		header('Content-type: image/jpeg');
-		readfile($image_src);
+		@readfile($image_src);
 		die();
 	} else {
 		echo "Invalid Plex Request";	
@@ -1515,6 +1520,7 @@ function printTabRow($data) {
 					'.buildField(array(
 						'type' => 'button',
 						'icon' => 'trash',
+                        'buttonType' => 'danger',
 						'labelTranslate' => 'REMOVE',
 						'onclick' => "$(this).parents('li').remove();",
 					),12,1,1).'
@@ -1894,10 +1900,10 @@ function nzbgetConnect($list = 'listgroups') {
         }
         
         $gotNZB[] = '<tr>
-                        <td>'.$downloadName.'</td>
-                        <td>'.$downloadStatus.'</td>
-                        <td>'.$downloadCategory.'</td>
-                        <td>
+                        <td class="col-xs-7 nzbtable-file-row">'.$downloadName.'</td>
+                        <td class="col-xs-2 nzbtable nzbtable-row">'.$downloadStatus.'</td>
+                        <td class="col-xs-1 nzbtable nzbtable-row">'.$downloadCategory.'</td>
+                        <td class="col-xs-2 nzbtable nzbtable-row">
                             <div class="progress">
                                 <div class="progress-bar progress-bar-'.$downloadHealth.' '.$progressBar.'" role="progressbar" aria-valuenow="'.$downloadPercent.'" aria-valuemin="0" aria-valuemax="100" style="width: '.$downloadPercent.'%">
                                     <p class="text-center">'.round($downloadPercent).'%</p>

+ 38 - 15
homepage.php

@@ -189,7 +189,30 @@ $endDate = date('Y-m-d',strtotime("+".CALENDARENDDAY." days"));
                 text-align: left;
                 padding-bottom: 2px !important;
                 overflow: hidden !important;
-            }<?php if(CUSTOMCSS == "true") : 
+            } @media screen and (max-width: 576px) {
+				.nzbtable {
+					padding-left: 5px !important;
+					padding-right: 2px !important;
+					font-size: 10px !important;
+					word-break: break-word !important;
+				}
+				.nzbtable-file-row {
+					padding-left: 5px !important;
+					padding-right: 2px !important;
+					font-size: 10px !important;
+					white-space: normal !important;
+					word-break: break-all !important;
+					width: 0% !important;
+				}
+            } .nzbtable-file-row {
+				white-space: normal !important;
+				word-break: break-all !important;
+				width: 0% !important;
+			}.nzbtable-row {
+				white-space: normal !important;
+				width: 0% !important;
+				font-size: 12px; !important;
+			}<?php if(CUSTOMCSS == "true") : 
 $template_file = "custom.css";
 $file_handle = fopen($template_file, "rb");
 echo fread($file_handle, filesize($template_file));
@@ -204,6 +227,12 @@ endif; ?>
             <div id="content" class="container-fluid">
 <!-- <button id="numBnt">Numerical</button> -->
                 <br/>
+
+				 <?php if (qualifyUser(HOMEPAGECUSTOMHTML1AUTH) && HOMEPAGECUSTOMHTML1) { ?>
+				<div>
+					<?php echo HOMEPAGECUSTOMHTML1; ?>
+				</div>
+                <?php } ?>
                 <?php if((NZBGETURL != "" && qualifyUser(NZBGETHOMEAUTH)) || (SABNZBDURL != "" && qualifyUser(SABNZBDHOMEAUTH))) { ?>
                 <div id="downloadClientRow" class="row">
                     <sort>2</sort>
@@ -241,10 +270,10 @@ endif; ?>
                                                 <table class="table table-striped progress-widget zero-m" style="max-height: 300px">
                                                     <thead>
                                                         <tr>
-                                                            <th><?php echo $language->translate("FILE");?></th>
-                                                            <th><?php echo $language->translate("STATUS");?></th>
-                                                            <th><?php echo $language->translate("CATEGORY");?></th>
-                                                            <th><?php echo $language->translate("PROGRESS");?></th>
+                                                            <th class="col-xs-7 nzbtable-file-row"><?php echo $language->translate("FILE");?></th>
+                                                            <th class="col-xs-2 nzbtable"><?php echo $language->translate("STATUS");?></th>
+                                                            <th class="col-xs-1 nzbtable"><?php echo $language->translate("CATEGORY");?></th>
+                                                            <th class="col-xs-2 nzbtable"><?php echo $language->translate("PROGRESS");?></th>
                                                         </tr>
                                                     </thead>
                                                     <tbody class="dl-queue sabnzbd"></tbody>
@@ -257,10 +286,10 @@ endif; ?>
                                                 <table class="table table-striped progress-widget zero-m" style="max-height: 300px">
                                                     <thead>
                                                         <tr>
-                                                            <th><?php echo $language->translate("FILE");?></th>
-                                                            <th><?php echo $language->translate("STATUS");?></th>
-                                                            <th><?php echo $language->translate("CATEGORY");?></th>
-                                                            <th><?php echo $language->translate("PROGRESS");?></th>
+                                                            <th class="col-xs-7 nzbtable-file-row"><?php echo $language->translate("FILE");?></th>
+                                                            <th class="col-xs-2 nzbtable"><?php echo $language->translate("STATUS");?></th>
+                                                            <th class="col-xs-1 nzbtable"><?php echo $language->translate("CATEGORY");?></th>
+                                                            <th class="col-xs-2 nzbtable"><?php echo $language->translate("PROGRESS");?></th>
                                                         </tr>
                                                     </thead>
                                                     <tbody class="dl-history sabnzbd"></tbody>
@@ -329,12 +358,6 @@ endif; ?>
                     </div>
                 </div>
                 <?php } ?>
-				
-                <?php if (qualifyUser(HOMEPAGECUSTOMHTML1AUTH) && HOMEPAGECUSTOMHTML1) { ?>
-				<div>
-					<?php echo HOMEPAGECUSTOMHTML1; ?>
-				</div>
-                <?php } ?>
             </div>    
         </div>
         <script>

+ 13 - 6
index.php

@@ -273,8 +273,10 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
         <![endif]-->
     </head>
     <style>
-
-        .bottom-bnts a {
+        .TabOpened {
+            -webkit-filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
+            filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
+        }.bottom-bnts a {
 
             background: <?=$bottombar;?> !important;
             color: <?=$topbartext;?> !important;
@@ -1246,12 +1248,14 @@ endif; ?>
                 event.preventDefault();
             });
             defaultTab = $("li[class^='tab-item active']").attr("id");
+            $("li[class^='tab-item active']").first().find("img").addClass("TabOpened");
             if (defaultTab){
                 defaultTab = defaultTab.substr(0, defaultTab.length-1);
             }else{
                 defaultTabNone = $("li[class^='tab-item']").attr("id");
                 if (defaultTabNone){
                     $("li[class^='tab-item']").first().attr("class", "tab-item active");
+                    $("li[class^='tab-item']").first().find("img").addClass("TabOpened");
                     defaultTab = defaultTabNone.substr(0, defaultTabNone.length-1);
                 }
             }
@@ -1377,13 +1381,13 @@ endif; ?>
         <?php if($iconRotate == "true") : ?>   
         $("li[id^='settings.phpx']").on('click tap', function(){
 
-            $("img[id^='settings-icon']").attr("class", "fa-spin");
-            $("i[id^='settings-icon']").attr("class", "fa fa-cog fa-spin");
+            $("img[id^='settings-icon']").addClass("fa-spin");
+            $("i[id^='settings-icon']").addClass("fa-spin");
 
             setTimeout(function(){
 
-                $("img[id^='settings-icon']").attr("class", "");
-                $("i[id^='settings-icon']").attr("class", "fa fa-cog");
+                $("img[id^='settings-icon']").removeClass("fa-spin");
+                $("i[id^='settings-icon']").removeClass("fa-spin");
 
             },1000);
 
@@ -1446,6 +1450,8 @@ endif; ?>
                     $("li[class^='tab-item active']").attr("class", "tab-item");
 
                     $(this).attr("class", "tab-item active");
+                    jQuery(this).find("img").addClass("TabOpened");
+                    
                 }
 
             }
@@ -1499,6 +1505,7 @@ endif; ?>
                     $("li[class^='tab-item rightActive']").attr("class", "tab-item");
 
                     $(this).attr("class", "tab-item rightActive");
+                    jQuery(this).find("img").addClass("TabOpened");
                 }
 
             }

+ 1 - 1
settings.php

@@ -329,7 +329,7 @@ endif; ?>
 									<form id="submitTabs" onsubmit="submitTabs(this); return false;">
 										<div class="sort-todo">
 											<button id="newtab" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float" onclick="addTab()">
-												<span class="btn-label"><i class="fa fa-picture-o"></i></span><?php echo translate("NEW_TAB");?>
+												<span class="btn-label"><i class="fa fa-plus"></i></span><?php echo translate("NEW_TAB");?>
 											</button>
 											<button id="iconHide" type="button" class="btn waves btn-labeled btn-warning btn-sm text-uppercase waves-effect waves-float">
 												<span class="btn-label"><i class="fa fa-upload"></i></span><?php echo $language->translate("UPLOAD_ICONS");?>