git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1551 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
40 lines
964 B
PHP
40 lines
964 B
PHP
<?php
|
|
/** DomFramework Blog
|
|
@package domframework-blog
|
|
@author Dominique Fournier <dominique@fournier38.fr> */
|
|
|
|
/** Display the articles of the blog */
|
|
class view_blog
|
|
{
|
|
/** Return the datas
|
|
@param array $data The list of titles */
|
|
public function get ($data, $variable)
|
|
{
|
|
$res = "<a href='".$variable["articleid"]."/edit'>Edit</a><br/>";
|
|
$res.= "<h1>".$variable["title"]."</h1>\n";
|
|
$res.= "<p>".$variable["content"]."</p>\n";
|
|
return $res;
|
|
}
|
|
|
|
/** Display the list of titles
|
|
@param array $data The list of titles */
|
|
public function listing ($data, $variable)
|
|
{
|
|
$content = "<ul>\n";
|
|
foreach ($data as $val)
|
|
{
|
|
$content .= " <li>";
|
|
$content .= "<a href='".urlencode ($val)."'>".htmlentities ($val)."</a>";
|
|
$content .= "</li>\n";
|
|
}
|
|
$content .= "</ul>\n";
|
|
return $content;
|
|
}
|
|
|
|
/** Create/Edit a blog */
|
|
public function edit ($data, $variable)
|
|
{
|
|
return $data;
|
|
}
|
|
}
|