| 136 | | $page->name = __gettext('Main'); |
|---|
| 137 | | $page->uri = pages_build_uri($page->name); |
|---|
| 138 | | $page->title = __gettext('Main page'); |
|---|
| 139 | | $page->content = pages_html_wrap('p', __gettext('This is your first page. Edit me!')); |
|---|
| 140 | | $page->content .= pages_html_wrap('p', __gettext('Installed on ') . pages_html_wrap('a', '{{url}}', array('href' => '{{url}}'))); |
|---|
| 141 | | if (pages_php_allowed()) { |
|---|
| 142 | | $page->content .= pages_html_wrap('p', __gettext('Current time: ') . ' <?php echo strftime("%Y-%m-%d, %H:%m") ?>'); |
|---|
| 143 | | } |
|---|
| 144 | | $page->content .= pages_html_wrap('h2', __gettext('Blog summary')); |
|---|
| 145 | | $page->content .= pages_html_wrap('div', '{{blogsummary:5}}'); |
|---|
| 146 | | |
|---|
| 147 | | $rs = insert_record('pages', $page); |
|---|
| 148 | | $page->ident = $rs; |
|---|
| 149 | | |
|---|
| 150 | | set_config('pages_default', $page->ident); |
|---|
| 151 | | |
|---|
| 152 | | if ($rs) { |
|---|
| 153 | | // first child |
|---|
| 154 | | $page2 = new StdClass; |
|---|
| 155 | | $page2->name = 'Example page'; |
|---|
| 156 | | $page2->uri = pages_build_uri('Example page'); |
|---|
| 157 | | $page2->title = __gettext('Example page for ') . $CFG->sitename; |
|---|
| 158 | | $page2->content = pages_html_wrap('p', __gettext('Example content')); |
|---|
| 159 | | $page2->content .= pages_html_wrap('p', __gettext('Random users: {{randomusers}}')); |
|---|
| 160 | | $page2->content .= pages_html_wrap('p', __gettext('Top tags: {{toptags}}')); |
|---|
| 161 | | $page2->parent = $page->ident; |
|---|
| 162 | | |
|---|
| 163 | | $rs = insert_record('pages', $page2); |
|---|
| 164 | | $page2->ident = $rs; |
|---|
| 165 | | } |
|---|
| | 138 | $page->name = __gettext('About'); |
|---|
| | 139 | $page->title = __gettext('About') . " {{sitename}}"; |
|---|
| | 140 | $page->content = @file_get_contents(dirname(__FILE__).'/legacy/content_about.html'); |
|---|
| | 141 | |
|---|
| | 142 | $page = pages_create_page($page); |
|---|
| | 143 | |
|---|
| | 144 | if ($page) { |
|---|
| | 145 | set_config('pages_default', $page->ident); |
|---|
| | 146 | |
|---|
| | 147 | $_page = new StdClass; |
|---|
| | 148 | $_page->uri = 'privacy.php'; //backward compatibility |
|---|
| | 149 | $_page->title = __gettext('Privacy Policy'); |
|---|
| | 150 | $_page->content = @file_get_contents(dirname(__FILE__).'/legacy/content_privacy.html'); |
|---|
| | 151 | $_page->parent = $page->ident; |
|---|
| | 152 | $_page = pages_create_page($_page); |
|---|
| | 153 | |
|---|
| | 154 | $_page = new StdClass; |
|---|
| | 155 | $_page->uri = 'terms.php'; //backward compatibility |
|---|
| | 156 | $_page->title = __gettext('Terms and Conditions'); |
|---|
| | 157 | $_page->content = @file_get_contents(dirname(__FILE__).'/legacy/content_terms.html'); |
|---|
| | 158 | $_page->parent = $page->ident; |
|---|
| | 159 | $_page = pages_create_page($_page); |
|---|
| | 160 | } |
|---|
| | 161 | |
|---|
| | 162 | $page = new StdClass; |
|---|
| | 163 | $page->name = __gettext('FAQ'); |
|---|
| | 164 | $page->title = __gettext('Frequently Asked Questions'); |
|---|
| | 165 | $page->content = @file_get_contents(dirname(__FILE__).'/legacy/content_faq.html'); |
|---|
| | 166 | |
|---|
| | 167 | $page = pages_create_page($page); |
|---|
| | 478 | } |
|---|
| | 479 | |
|---|
| | 480 | function pages_html_form($name, $body, $method='post', $action='', $attrs=null) { |
|---|
| | 481 | $body .= pages_html_input('hidden', array('name'=>'form_key', 'value'=>elggform_get_key())); |
|---|
| | 482 | $attrs = array_merge(array('id'=>$name, 'name'=>$name, 'method'=>$method, 'action'=>$action,), $attrs); |
|---|
| | 483 | return pages_html_wrap('form', $body, $attrs); |
|---|