| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
class SampleWebsiteProfile |
|---|
| 42 |
{ |
|---|
| 43 |
var $Installer; |
|---|
| 44 |
var $priority = 10; |
|---|
| 45 |
|
|---|
| 46 |
function install() |
|---|
| 47 |
{ |
|---|
| 48 |
$this->_createDefaultHomePage(); |
|---|
| 49 |
} |
|---|
| 50 |
|
|---|
| 51 |
function uninstall() |
|---|
| 52 |
{ |
|---|
| 53 |
|
|---|
| 54 |
} |
|---|
| 55 |
|
|---|
| 56 |
function _createDefaultHomePage() |
|---|
| 57 |
{ |
|---|
| 58 |
Ak::import(array('page', 'page_part', 'user', 'content_layout')); |
|---|
| 59 |
|
|---|
| 60 |
$User =& new User(); |
|---|
| 61 |
$ContentLayout =& new ContentLayout(); |
|---|
| 62 |
|
|---|
| 63 |
if (!$Admin =& $User->find(1) || !$Layout =& $ContentLayout->findFirstBy('name', 'Default')){ |
|---|
| 64 |
return; |
|---|
| 65 |
} |
|---|
| 66 |
|
|---|
| 67 |
$Page =& new Page(array( |
|---|
| 68 |
'title' => 'Welcome to your new Editam Site!', |
|---|
| 69 |
'slug' => '/', |
|---|
| 70 |
'breadcrumb' => 'Home', |
|---|
| 71 |
'status' => 'published', |
|---|
| 72 |
'layout_id' => $Layout->getId(), |
|---|
| 73 |
'created_at' => Ak::getDate(), |
|---|
| 74 |
'created_by' => $Admin->getId(), |
|---|
| 75 |
'updated_at' => Ak::getDate(), |
|---|
| 76 |
'updated_by' => $Admin->getId())); |
|---|
| 77 |
|
|---|
| 78 |
$Page->part->create(array( |
|---|
| 79 |
'name' => 'body', |
|---|
| 80 |
'filter' => 'markdown', |
|---|
| 81 |
'content' => |
|---|
| 82 |
"Please login <a href='{base}/admin'>login</a> using the username and password you provided when you installed Editam. |
|---|
| 83 |
|
|---|
| 84 |
Editam is a content management platform based in these core principles and objectives |
|---|
| 85 |
|
|---|
| 86 |
* Simplicity |
|---|
| 87 |
* Usability |
|---|
| 88 |
* Findability |
|---|
| 89 |
* Standard awareness |
|---|
| 90 |
* Efficiency |
|---|
| 91 |
* Openness |
|---|
| 92 |
* Internationalization |
|---|
| 93 |
* Extendability |
|---|
| 94 |
* Compatibility |
|---|
| 95 |
|
|---|
| 96 |
Out of the box Editam has less features than other CMS on purpose, so you can start creating content immediately. |
|---|
| 97 |
|
|---|
| 98 |
Editam is available open-source under the GPL3 license." |
|---|
| 99 |
)); |
|---|
| 100 |
|
|---|
| 101 |
$Page->part->create(array( |
|---|
| 102 |
'name' => 'sidebar', |
|---|
| 103 |
'content' => |
|---|
| 104 |
'<div id="logo"> |
|---|
| 105 |
<a href="/" title="_{Home page}"><img src="{base}/images/editam_light_bg.png" alt="Editam by Akelos Media S.L." /></a> |
|---|
| 106 |
</div> |
|---|
| 107 |
|
|---|
| 108 |
<ul class="sidebar_menu"> |
|---|
| 109 |
<li><a title="Administrate your site" href="{base}/admin">Administrate your site</a></li> |
|---|
| 110 |
<li><a title="Development Site" href="http://trac.editam.com">Editam development site</a></li> |
|---|
| 111 |
</ul>' |
|---|
| 112 |
)); |
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
$Page->part->create(array( |
|---|
| 116 |
'name' => 'footer', |
|---|
| 117 |
'content' => |
|---|
| 118 |
'Powered by <a href="http://www.editam.com">Editam</a>.' |
|---|
| 119 |
)); |
|---|
| 120 |
|
|---|
| 121 |
$Page->save(); |
|---|
| 122 |
} |
|---|
| 123 |
|
|---|
| 124 |
} |
|---|
| 125 |
|
|---|
| 126 |
?> |
|---|