edited page mechanism

This commit is contained in:
Logsol 2013-07-10 12:15:34 +02:00
parent 4c21bbcefd
commit 79a0690fad
8 changed files with 51 additions and 37 deletions

View file

@ -5,21 +5,18 @@ class Page extends Katharsis_Model_Abstract
{
}
public function render($url, $preview)
public function getIdByUrl($url, $preview = false)
{
$activeTerm = '';
if(!$preview)
{
$activeTerm = 'AND active = 1';
}
$sql = $this->_con->createStatement("SELECT * FROM page WHERE url = :url " . $activeTerm, array("url" => $url));
if($result = $this->_con->fetchOne($sql))
{
return $result['content'];
}
else
{
throw new DidgeridooArtwork_Exception('Die von Ihnen angeforderte Seite (Page) "' . $url . '" konnte nicht gefunden werden.');
$sql = $this->_con->createStatement("SELECT id FROM page WHERE url = :url " . $activeTerm, array("url" => $url));
if($result = $this->_con->fetchOne($sql)){
return $result['id'];
}
}

View file

@ -6,10 +6,10 @@ class Upload extends Katharsis_Model_Abstract
}
public function header($id, $file)
public function header($file)
{
$dir = getcwd() . '/img/header';
return $this->_uploadFile($id, $file, $dir);
return $this->_uploadFile(null, $file, $dir);
}
public function page($file)
@ -33,7 +33,9 @@ class Upload extends Katharsis_Model_Abstract
}
$handle = new Verot_Upload($file);
return;
$handle->file_new_name_body = $name;
if ($handle->uploaded)
{
$handle->Process($dir);