Exemple #1
0
function pagesmith_install(&$content)
{
    PHPWS_Core::initModClass('pagesmith', 'PS_Page.php');
    PHPWS_Core::initModClass('pagesmith', 'PS_Text.php');
    $page = new PS_Page();
    $page->setTitle('Welcome to phpWebSite!');
    $page->template = 'text_only';
    $page->front_page = 1;
    $page->save();
    $section = new PS_Text();
    $section->pid = $page->id;
    $section->content = '<p>Thank you for installing phpWebSite.
	Its developers hope you enjoy it.</p><p>
	The page you are reading was created under
	<a href="./index.php?module=pagesmith&aop=menu&authkey=be5c993fffbc1193e3763d43ef5b2c78">PageSmith</a>
	, which can be found in the <a href="index.php?module=controlpanel&command=panel_view">Control Panel</a> under the Content Tab.</p><p>
	PageSmith has many default templates to get you started. If you are comfortable with HTML, you may wish to just use the "Text Only"
	 template under the "No image" category.</p><p>This particular page was added to the home page by using the "
	 Show as home page" option found in the MiniAdmin or the "List" tab under the PageSmith administrative options. You may edit this page or remove it from the List view as well.</p>';
    $section->secname = 'text1';
    $section->sectype = 'text';
    $section->save($page->key_id);
    return true;
}
Exemple #2
0
 private function restorePage($id)
 {
     $id = (int) $id;
     $page = new PS_Page($id);
     $page->restore();
 }