Jelajahi Sumber

added UI in TableAjax, fix title

Piotr Labudda 9 tahun lalu
induk
melakukan
2ec4a6ec34
1 mengubah file dengan 14 tambahan dan 16 penghapusan
  1. 14 16
      SE/se-lib/TableAjax.php

+ 14 - 16
SE/se-lib/TableAjax.php

@@ -3,7 +3,7 @@
 Lib::loadClass('ViewAjax');
 Lib::loadClass('TableAjaxMap');
 Lib::loadClass('Typespecial');
-Lib::loadClass('SE_Layout');
+Lib::loadClass('UI');
 Lib::loadClass('FoldersConfig');
 Lib::loadClass('FileUploader');
 Lib::loadClass('UserProfile');
@@ -250,7 +250,7 @@ class TableAjax extends ViewAjax {
 		?>
 
 		<div class="container">
-			<?php SE_Layout::showMessagesForTable($this->_tbl); ?>
+			<?php UI::showMessagesForTable($this->_tbl); ?>
 		</div>
 
 		<?php if ($tblAjaxMap) $tblAjaxMap->printCSS(); ?>
@@ -3753,11 +3753,9 @@ function <?php echo $jsToogleFiltrProcesuFunctionName; ?>(n) {
 	});
 	return false;
 }
-		</script>
-		<script>
-document.title = '<?php echo $this->_acl->getRawLabel(100) . " - " . SE_Layout::getTitle(); ?>';
 		</script>
 		<?php
+		UI::setTitleJsTag($this->_acl->getRawLabel(100) . " - " . UI::getTitle());
 		$out = ob_get_contents();
 		ob_end_clean();
 		return $out;
@@ -3869,10 +3867,10 @@ document.title = '<?php echo $this->_acl->getRawLabel(100) . " - " . SE_Layout::
 				} catch (HttpException $e) {
 					Http::sendHeaderByCode($e->getCode());
 					echo $e->getMessage();
-					//SE_Layout::alert('danger', $e->getMessage());
+					//UI::alert('danger', $e->getMessage());
 				} catch (Exception $e) {
 					echo '<div class="container">';
-						SE_Layout::alert('danger', $e->getMessage());
+						UI::alert('danger', $e->getMessage());
 					echo '</div>';
 				}
 				break;
@@ -4039,7 +4037,7 @@ document.title = '<?php echo $this->_acl->getRawLabel(100) . " - " . SE_Layout::
 				echo '</div>';
 			} catch (Exception $e) {
 				echo '<div style="display:none">';
-				SE_Layout::alert('danger', $e->getMessage());
+				UI::alert('danger', $e->getMessage());
 				echo '</div>';
 			}
 		}
@@ -4049,17 +4047,17 @@ document.title = '<?php echo $this->_acl->getRawLabel(100) . " - " . SE_Layout::
 			<strong title="<?php echo "[{$fieldID}] {$fieldName}"; ?>"><?php echo "{$vCol['label']}"; ?></strong>
 			<?php if (!empty($vCol['opis'])) : ?>
 				<em><?php echo $vCol['opis']; ?></em>
-				<?php $perms = $this->_acl->getFieldPerms($fieldID); SE_Layout::hotKeyDBG($perms); ?>
+				<?php $perms = $this->_acl->getFieldPerms($fieldID); UI::hotKeyDBG($perms); ?>
 			<?php endif; ?>
 		</label>
 		<?php
 			if (!$this->_acl->isAllowed($fieldID, 'W', $row)) {
 				// TODO: hide Zapisz btn on frontend side
 				if (!$this->_acl->isAllowed($fieldID, 'R', $row)) {
-					SE_Layout::alert('warning', "Brak uprawnień do odczytu i zapisu");
+					UI::alert('warning', "Brak uprawnień do odczytu i zapisu");
 				} else {
 					echo '<p style="margin-top:16px">' . $fieldVal . '</p>';
-					SE_Layout::alert('warning', "Brak uprawnień do zapisu");
+					UI::alert('warning', "Brak uprawnień do zapisu");
 				}
 			} else {
 				echo $this->_acl->showFormItem('W', $fieldID, "f{$fieldID}", $fieldVal, $fieldParams, $row);
@@ -4187,7 +4185,7 @@ document.title = '<?php echo $this->_acl->getRawLabel(100) . " - " . SE_Layout::
 						<div class="form-group">
 							<label class="col-xs-12 col-sm-3 col-md-2 control-label" for="<?php echo "f{$kID}"; ?>"><?php echo $vCol['label']; ?>
 								<i class="glyphicon glyphicon-info-sign frm-help" data-toggle="popover" data-trigger="hover" title="" data-content="<?php echo htmlspecialchars($vCol['opis']); ?>" data-original-title="<?php echo "[{$kID}] {$vCol['name']}"; ?>"></i>
-								<?php $perms = $this->_acl->getFieldPerms($kID); SE_Layout::hotKeyDBG($perms); ?>
+								<?php $perms = $this->_acl->getFieldPerms($kID); UI::hotKeyDBG($perms); ?>
 							</label>
 							<div class="col-xs-12 col-sm-9 col-md-10">
 								<?php
@@ -4203,7 +4201,7 @@ document.title = '<?php echo $this->_acl->getRawLabel(100) . " - " . SE_Layout::
 						<div class="form-group">
 							<label class="col-xs-12 col-sm-3 col-md-2 control-label" for="<?php echo "f{$kID}"; ?>"><?php echo $vCol['label']; ?>
 								<i class="glyphicon glyphicon-info-sign frm-help" data-toggle="popover" data-trigger="hover" title="" data-content="<?php echo htmlspecialchars($vCol['opis']); ?>" data-original-title="<?php echo "[{$kID}] {$vCol['name']}"; ?>"></i>
-								<?php $perms = $this->_acl->getFieldPerms($kID); SE_Layout::hotKeyDBG($perms); ?>
+								<?php $perms = $this->_acl->getFieldPerms($kID); UI::hotKeyDBG($perms); ?>
 							</label>
 							<div class="col-xs-12 col-sm-9 col-md-10">
 								<p style="margin-top:5px;">
@@ -4455,7 +4453,7 @@ jQuery(document).ready(function(){
 						<div class="form-group">
 							<label class="col-xs-12 col-sm-3 col-md-2 control-label" for="<?php echo "f{$kID}"; ?>"><?php echo $vCol['label']; ?>
 								<i class="glyphicon glyphicon-info-sign frm-help" data-toggle="popover" data-trigger="hover" title="" data-content="<?php echo htmlspecialchars($vCol['opis']); ?>" data-original-title="<?php echo "[{$kID}] {$vCol['name']}"; ?>"></i>
-								<?php $perms = $this->_acl->getFieldPerms($kID); SE_Layout::hotKeyDBG($perms); ?>
+								<?php $perms = $this->_acl->getFieldPerms($kID); UI::hotKeyDBG($perms); ?>
 							</label>
 							<div class="col-xs-12 col-sm-9 col-md-10">
 								<?php
@@ -5151,11 +5149,11 @@ jQuery(document).ready(function(){
 			$destFolderPath = $uploader->getDestLocalPath(true);
 			$folderCreated = $uploader->tryCreateDestFolder($destFolderPath);
 			if ($folderCreated) {
-				//SE_Layout::alert('info', "Utworzono katalog");
+				//UI::alert('info', "Utworzono katalog");
 				$uploader->findFolder();
 				$mainFolder = $uploader->getDestFolder();
 			} else {
-				SE_Layout::alert('warning', "Nie udało się utworzyć katalogu");
+				UI::alert('warning', "Nie udało się utworzyć katalogu");
 			}
 		}