finished uploading

This commit is contained in:
Logsol 2013-07-17 16:05:00 +02:00
parent 598081b2a8
commit f7f2163df5
7 changed files with 28 additions and 7 deletions

BIN
.DS_Store vendored

Binary file not shown.

View file

@ -25,6 +25,7 @@ class AdminPageController extends Katharsis_Controller_Abstract
} else {
$type = 'page';
}
$this->_view->type = $type;
$path = getcwd().'/public/img/' . $type . '/';
@ -48,6 +49,7 @@ class AdminPageController extends Katharsis_Controller_Abstract
if(isset($_GET['delete']))
{
$deleteFile = $path . $_GET['delete'];
if(file_exists($deleteFile)) {
unlink($deleteFile);
}
@ -63,7 +65,7 @@ class AdminPageController extends Katharsis_Controller_Abstract
closedir($handle);
}
$this->_view->type = $type;
$this->_view->files = $ar;
echo $this->_view->render('AdminPage/image');

View file

@ -37,7 +37,14 @@
<dl>
<dt>Inhalt</dt>
<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&nbsp;für&nbsp;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>
</dl>
<p>

View file

@ -3,6 +3,7 @@
<title>Seinheit</title>
<link rel="stylesheet" type="text/css" href="/style/main.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="<?php echo $this->base ?>/script/admin.js"></script>
</head>
<body>
@ -17,8 +18,8 @@
<ul style="padding-left: 16px; list-style-type: none">
<?php foreach($this->files as $file): ?>
<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="opener.document.getElementById('src').value='/img/<?php echo $this->type; ?>/<?php echo $file; ?>'; window.close();" >Einf&uuml;gen</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="adminPageInsertImage('<?php echo $this->type; ?>', '<?php echo $file; ?>'); window.close();" >Einf&uuml;gen</a>
<a href="?delete=<?php echo $file ?>" style="float:right; margin-top: 35px">L&ouml;schen</a>
</li>

View file

@ -1,10 +1,12 @@
<h2>Das Hochladen war erfolgreich.</h2>
<script src="<?php echo $this->base ?>/script/admin.js"></script>
<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() {
window.self.close();
}, 800);
</script>
</script>
<h2>Das Hochladen war erfolgreich.</h2>

View file

@ -12,6 +12,7 @@
<link rel="stylesheet" type="text/css" href="<?php echo $this->base ?>/style/main.css" />
<?php if(Access::isLogged()) { ?>
<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 } ?>
<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" />

8
public/script/admin.js Normal file
View 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="">';
}
}