finished uploading
This commit is contained in:
parent
598081b2a8
commit
f7f2163df5
7 changed files with 28 additions and 7 deletions
BIN
.DS_Store
vendored
BIN
.DS_Store
vendored
Binary file not shown.
|
@ -25,6 +25,7 @@ class AdminPageController extends Katharsis_Controller_Abstract
|
||||||
} else {
|
} else {
|
||||||
$type = 'page';
|
$type = 'page';
|
||||||
}
|
}
|
||||||
|
$this->_view->type = $type;
|
||||||
|
|
||||||
$path = getcwd().'/public/img/' . $type . '/';
|
$path = getcwd().'/public/img/' . $type . '/';
|
||||||
|
|
||||||
|
@ -48,6 +49,7 @@ class AdminPageController extends Katharsis_Controller_Abstract
|
||||||
if(isset($_GET['delete']))
|
if(isset($_GET['delete']))
|
||||||
{
|
{
|
||||||
$deleteFile = $path . $_GET['delete'];
|
$deleteFile = $path . $_GET['delete'];
|
||||||
|
|
||||||
if(file_exists($deleteFile)) {
|
if(file_exists($deleteFile)) {
|
||||||
unlink($deleteFile);
|
unlink($deleteFile);
|
||||||
}
|
}
|
||||||
|
@ -63,7 +65,7 @@ class AdminPageController extends Katharsis_Controller_Abstract
|
||||||
|
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
$this->_view->type = $type;
|
|
||||||
$this->_view->files = $ar;
|
$this->_view->files = $ar;
|
||||||
echo $this->_view->render('AdminPage/image');
|
echo $this->_view->render('AdminPage/image');
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,14 @@
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Inhalt</dt>
|
<dt>Inhalt</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<textarea id="content" name="content" rows="15" cols="80"><?php echo htmlentities($this->page['content']) ?></textarea>
|
<textarea id="content" name="content" rows="15" cols="80"><?php echo /*htmlentities*/($this->page['content']) ?></textarea>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
<dl>
|
||||||
|
<dt>Bild für Inhalt</dt>
|
||||||
|
<dd>
|
||||||
|
|
||||||
|
<a href="javascript: void(0);" onclick="window.open('/adminPage/image/type/page', 'fenster2', 'width=600,height=400,status=yes,scrollbars=yes,resizable=yes');">Auswählen</a>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
<title>Seinheit</title>
|
<title>Seinheit</title>
|
||||||
<link rel="stylesheet" type="text/css" href="/style/main.css" />
|
<link rel="stylesheet" type="text/css" href="/style/main.css" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||||
|
<script src="<?php echo $this->base ?>/script/admin.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
@ -17,8 +18,8 @@
|
||||||
<ul style="padding-left: 16px; list-style-type: none">
|
<ul style="padding-left: 16px; list-style-type: none">
|
||||||
<?php foreach($this->files as $file): ?>
|
<?php foreach($this->files as $file): ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="javascript: void(0);" onclick="window.open('/img/page/<?php echo $file; ?>', 'Bild', 'width=400,height=300,status=yes,scrollbars=yes,resizable=yes');"><img src="/img/<?php echo $this->type; ?>/<?php echo $file; ?>" width="50" height="50" /></a>
|
<a href="javascript: void(0);" onclick="window.open('/img/<?php echo $this->type; ?>/<?php echo $file; ?>', 'Bild', 'width=500,height=400,status=yes,scrollbars=yes,resizable=yes');"><img src="/img/<?php echo $this->type; ?>/<?php echo $file; ?>" width="50" height="50" /></a>
|
||||||
<a href="javascript: void(0);" onclick="opener.document.getElementById('src').value='/img/<?php echo $this->type; ?>/<?php echo $file; ?>'; window.close();" >Einfügen</a>
|
<a href="javascript: void(0);" onclick="adminPageInsertImage('<?php echo $this->type; ?>', '<?php echo $file; ?>'); window.close();" >Einfügen</a>
|
||||||
<a href="?delete=<?php echo $file ?>" style="float:right; margin-top: 35px">Löschen</a>
|
<a href="?delete=<?php echo $file ?>" style="float:right; margin-top: 35px">Löschen</a>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
<h2>Das Hochladen war erfolgreich.</h2>
|
<script src="<?php echo $this->base ?>/script/admin.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
adminPageInsertImage('<?php echo $this->type; ?>', '<?php echo $this->imagePath;?>');
|
||||||
|
|
||||||
opener.document.forms[0].header_image.value = '<?php echo $this->imagePath;?>';
|
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
window.self.close();
|
window.self.close();
|
||||||
}, 800);
|
}, 800);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<h2>Das Hochladen war erfolgreich.</h2>
|
|
@ -12,6 +12,7 @@
|
||||||
<link rel="stylesheet" type="text/css" href="<?php echo $this->base ?>/style/main.css" />
|
<link rel="stylesheet" type="text/css" href="<?php echo $this->base ?>/style/main.css" />
|
||||||
<?php if(Access::isLogged()) { ?>
|
<?php if(Access::isLogged()) { ?>
|
||||||
<link rel="stylesheet" type="text/css" href="<?php echo $this->base ?>/style/admin.css" />
|
<link rel="stylesheet" type="text/css" href="<?php echo $this->base ?>/style/admin.css" />
|
||||||
|
<script src="<?php echo $this->base ?>/script/admin.js"></script>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<link rel="shortcut icon" href="<?php echo $this->base ?>/img/favicon.ico" type="image/x-icon" />
|
<link rel="shortcut icon" href="<?php echo $this->base ?>/img/favicon.ico" type="image/x-icon" />
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
|
8
public/script/admin.js
Normal file
8
public/script/admin.js
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
function adminPageInsertImage(type, img) {
|
||||||
|
if(type == 'header') {
|
||||||
|
opener.document.forms[0].header_image.value = img;
|
||||||
|
} else {
|
||||||
|
opener.document.forms[0].content.value += '<img src="{plugin=image ' + img + '}" alt="">';
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue