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.
Source for: https://www.earthli.com/news/create_subscriber.php
Uses WebCore template(s):
00 <?php
01
02 /****************************************************************************
03
04 Copyright (c) 2002-2014 Marco Von Ballmoos
05
06 This file is part of earthli News.
07
08 earthli News is free software; you can redistribute it and/or modify
09 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 earthli News is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with earthli News; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 For more information about the earthli News, visit:
23
24 http://www.earthli.com/software/webcore/news
25
26 ****************************************************************************/
27
28 require_once ('news/start.php');
29 require_once ($App->page_template_for ('webcore/pages/create_subscriber.php'));
30 ?>
31
Source for template: webcore/pages/create_subscriber.php
00 <?php
01
02 /****************************************************************************
03
04 Copyright (c) 2002-2014 Marco Von Ballmoos
05
06 This file is part of earthli Webcore.
07
08 earthli Webcore is free software; you can redistribute it and/or modify
09 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 earthli Webcore is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with earthli Webcore; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
22 For more information about the earthli Webcore, visit:
23
24 http://www.earthli.com/software/webcore
25
26 ****************************************************************************/
27
28 $email = read_var ('email');
29
30 $subscriber_query = $App->subscriber_query ();
31
32 if (!empty($email))
33 {
34 $subscriber = $subscriber_query->object_at_email ($email);
35 }
36
37 if (isset ($subscriber))
38 {
39 $Env->redirect_local ($subscriber->home_page ());
40 }
41 else
42 {
43 $class_name = $App->final_class_name ('USER_SUBSCRIPTION_OPTIONS_FORM', 'webcore/forms/user_subscription_options_form.php');
44 /** @var $form USER_SUBSCRIPTION_OPTIONS_FORM */
45 $form = new $class_name ($App);
46
47 $subscriber = $App->new_subscriber ();
48
49 $form->process_new ($subscriber);
50 if ($form->committed ())
51 {
52 $Env->redirect_local ($subscriber->home_page ());
53 }
54
55 $Page->title->subject = "Create subscriber";
56
57 $Page->location->add_root_link ();
58 $Page->location->append ($Page->title->subject, '', '{icons}buttons/create');
59
60 $Page->start_display ();
61 ?>
62 <div class="main-box">
63 <div class="form-content">
64 <?php
65 $form->button = 'Create';
66 $form->button_icon = '{icons}buttons/create';
67 $form->display ();
68 ?>
69 </div>
70 </div>
71 <?php
72 $Page->finish_display ();
73 }
74 ?>