The best way to learn how to use the WebCore is by example. See the documentation for more information.
The requested URL is always shown first; if a page uses one or more WebCore templates, those are shown afterwards.
00 <?php
01 include_once ('software/webcore_init.php');
02
03 $Page->title->subject = 'First run';
04 $Page->location->append ('WebCore', './');
05 $Page->location->append ('First run');
06
07 $display_mode = read_var ('display_mode');
08 $print_preview_url = $Page->resolve_file_for_alias (Folder_name_apps, 'albums/multiple_print.php?id=241&entry_type=picture');
09
10 $Page->start_display ();
11 ?>
12 <div class="top-box">
13 <div class="button-content">
14 <a href="install.php" class="button">< Install</a>
15 <?php
16 if ($display_mode)
17 {
18 $controls_renderer = $Page->make_controls_renderer();
19 echo $controls_renderer->button_as_html('Reset', $Page->url(Url_part_path), '{icons}/buttons/restore');
20 }
21 ?>
22 <a href="develop.php" class="button">Develop ></a>
23 </div>
24 </div>
25 <div class="main-box">
26 <div class="text-flow">
27 <?php
28 if (! $display_mode)
29 {
30 ?>
31 <p>Once you've <a href="install.php">installed</a> a WebCore application, you need to
32 set it up. This guide will show you how to get started.</p>
33 <h2>
34 Select display mode
35 </h2>
36 <ul>
37 <li><a href="?display_mode=wizard">Wizard</a>: Show one step at a time w/clickable thumbnails</li>
38 <li><a href="?display_mode=all">Full</a>: Show all steps at once w/clickable thumbnails</li>
39 <li><a href="<?php echo $print_preview_url; ?>">Print preview</a>: Print with <a href="app_albums.php">earthli Albums</a> (full size images)</li>
40 </ul>
41 <p class="info-box-bottom">The guide was created using the <a href="app_albums.php">earthli Albums</a> application.</p>
42 <?php
43 }
44 else
45 {
46 ?>
47 <h2>Getting started with an earthli Application</h2>
48 <br>
49 <?php
50 include_once ('albums/init.php');
51 $albums_app = $Page->make_application (Album_application_id);
52
53 $folder_query = $albums_app->login->folder_query ();
54 /** @var FOLDER $folder */
55 $folder = $folder_query->object_at_id (241); // WebCore guide album
56 $entry_query = $folder->entry_query ();
57 $entry_query->set_type ('picture');
58 $entry_query->set_order ('date ASC');
59
60 $class_name = $albums_app->final_class_name ('GUIDE_PICTURE_GRID', 'plugins/albums/guide_picture_grid.php');
61 /** @var GRID $grid */
62 $grid = new $class_name ($albums_app);
63
64 if ($display_mode == 'all')
65 {
66 $grid->set_page_size (100);
67 }
68 else
69 {
70 $grid->set_page_size (1);
71 $grid->pager->pages_to_show = 1;
72 $grid->pager->entry_type = 'Steps';
73 }
74
75 $grid->set_query ($entry_query);
76 $grid->display ();
77 }
78 ?>
79 </div>
80 </div>
81 <?php $Page->finish_display (); ?>
82