edited page mechanism
This commit is contained in:
parent
4c21bbcefd
commit
79a0690fad
8 changed files with 51 additions and 37 deletions
|
@ -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'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue