1 | <?php |
---|
2 | # ***** BEGIN LICENSE BLOCK ***** |
---|
3 | # |
---|
4 | # This program is free software. It comes without any warranty, to |
---|
5 | # the extent permitted by applicable law. You can redistribute it |
---|
6 | # and/or modify it under the terms of the Do What The Fuck You Want |
---|
7 | # To Public License, Version 2, as published by Sam Hocevar. See |
---|
8 | # http://sam.zoy.org/wtfpl/COPYING for more details. |
---|
9 | # |
---|
10 | # Icon (icon.png) is from Silk Icons : |
---|
11 | # http://www.famfamfam.com/lab/icons/silk/ |
---|
12 | # |
---|
13 | # ***** END LICENSE BLOCK ***** |
---|
14 | |
---|
15 | l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin'); |
---|
16 | |
---|
17 | $default_tab = 'tab-1'; |
---|
18 | |
---|
19 | if (isset($_REQUEST['tab'])) { |
---|
20 | $default_tab = $_REQUEST['tab']; |
---|
21 | } |
---|
22 | |
---|
23 | $core->blog->settings->addNameSpace('adminExample'); |
---|
24 | |
---|
25 | $settings =& $core->blog->settings->adminExample; |
---|
26 | |
---|
27 | if (!empty($_POST['saveconfig'])) |
---|
28 | { |
---|
29 | $settings->put('adminexample_active', |
---|
30 | !empty($_POST['adminexample_active']), |
---|
31 | 'boolean','Enable Admin Example'); |
---|
32 | |
---|
33 | # redirect to the page, avoid conflicts with old settings |
---|
34 | http::redirect($p_url.'&tab=settings&saveconfig=1'); |
---|
35 | } |
---|
36 | |
---|
37 | if (isset($_GET['saveconfig'])) |
---|
38 | { |
---|
39 | $msg = __('Configuration successfully updated.'); |
---|
40 | } |
---|
41 | |
---|
42 | ?><html> |
---|
43 | <head> |
---|
44 | <title><?php echo(__('Admin example')); ?></title> |
---|
45 | <?php echo dcPage::jsPageTabs($default_tab); ?> |
---|
46 | </head> |
---|
47 | <body> |
---|
48 | |
---|
49 | <h2><?php echo html::escapeHTML($core->blog->name).' › '. |
---|
50 | __('Admin example'); ?></h2> |
---|
51 | |
---|
52 | <?php if (!empty($msg)) {echo '<p class="message">'.$msg.'</p>';} ?> |
---|
53 | |
---|
54 | <div class="multi-part" id="tab-1" title="<?php echo __('Tab 1'); ?>"> |
---|
55 | <?php |
---|
56 | $combo_values = array( |
---|
57 | # a group of values |
---|
58 | # un groupe de valeurs |
---|
59 | __('Numbers') => array( |
---|
60 | __('one') => 1, |
---|
61 | __('two') => 2 |
---|
62 | ), |
---|
63 | # only one value |
---|
64 | # une valeur seule |
---|
65 | __('Hello World!') => 'hello_world' |
---|
66 | ); |
---|
67 | ?> |
---|
68 | |
---|
69 | <fieldset> |
---|
70 | <legend><?php echo(__('Hello World!')); ?></legend> |
---|
71 | <p><label class="classic"><?php echo( |
---|
72 | form::checkbox('adminexample_active','1', |
---|
73 | $settings->adminexample_active). |
---|
74 | ' '.__('Enable')); ?></label></p> |
---|
75 | |
---|
76 | <p><label><?php echo(__('Title:'). |
---|
77 | form::combo('combo',$combo_values,'2')); ?> |
---|
78 | </label></p> |
---|
79 | <p class="form-note"> |
---|
80 | <?php echo(__('Hello World!')); ?> |
---|
81 | </p> |
---|
82 | |
---|
83 | <?php |
---|
84 | /* |
---|
85 | For Dotclear 2.3 |
---|
86 | echo |
---|
87 | '<p><label class="required" for="required_field_id"><abbr title="'. |
---|
88 | __('Required field').'">*</abbr> '.__('A required field:').'</label> '. |
---|
89 | form::field('required_field_id',30,32, |
---|
90 | html::escapeHTML(__('Hello World!'))).'</p>';*/ |
---|
91 | ?> |
---|
92 | </fieldset> |
---|
93 | |
---|
94 | <fieldset> |
---|
95 | <legend><?php echo(__('Hello World!')); ?></legend> |
---|
96 | <p> |
---|
97 | <?php echo __('Title:'); ?> |
---|
98 | <label class="classic"><?php echo( |
---|
99 | form::radio(array('radio'),html::escapeHTML('1'),false). |
---|
100 | __('one')); ?></label> |
---|
101 | <label class="classic"><?php echo( |
---|
102 | form::radio(array('radio'),html::escapeHTML('2'),true). |
---|
103 | __('two')); ?></label> |
---|
104 | </p> |
---|
105 | </fieldset> |
---|
106 | |
---|
107 | |
---|
108 | |
---|
109 | </div> |
---|
110 | |
---|
111 | <div class="multi-part" id="settings" |
---|
112 | title="<?php echo __('Settings'); ?>"> |
---|
113 | <form method="post" action="<?php echo($p_url); ?>"> |
---|
114 | <p><label class="classic"><?php echo( |
---|
115 | form::checkbox('adminexample_active','1', |
---|
116 | $settings->adminexample_active). |
---|
117 | ' '.__('Enable')); ?></label></p> |
---|
118 | <p class="form-note"> |
---|
119 | <?php echo(__('Hello World!')); ?> |
---|
120 | </p> |
---|
121 | <p><?php echo $core->formNonce(); ?></p> |
---|
122 | <p><input type="submit" name="saveconfig" |
---|
123 | value="<?php echo __('Save configuration'); ?>" /></p> |
---|
124 | </form> |
---|
125 | </div> |
---|
126 | |
---|
127 | <div class="multi-part" id="columns" |
---|
128 | title="<?php echo __('Columns'); ?>"> |
---|
129 | <h3><?php printf(__('%s columns'),2); ?></h3> |
---|
130 | <div class="two-cols"> |
---|
131 | <div class="col"> |
---|
132 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec velit mi, in iaculis magna. Fusce nec tellus nec magna faucibus iaculis sed quis eros. Nulla sem orci, consectetur ullamcorper volutpat non, semper non purus. |
---|
133 | </div> |
---|
134 | <div class="col"> |
---|
135 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec velit mi, in iaculis magna. Fusce nec tellus nec magna faucibus iaculis sed quis eros. Nulla sem orci, consectetur ullamcorper volutpat non, semper non purus. |
---|
136 | </div> |
---|
137 | </div> |
---|
138 | |
---|
139 | <h3><?php printf(__('%s columns'),3); ?></h3> |
---|
140 | <div class="three-cols class"> |
---|
141 | <div class="col"> |
---|
142 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec velit mi, in iaculis magna. Fusce nec tellus nec magna faucibus iaculis sed quis eros. Nulla sem orci, consectetur ullamcorper volutpat non, semper non purus. |
---|
143 | </div> |
---|
144 | <div class="col"> |
---|
145 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec velit mi, in iaculis magna. Fusce nec tellus nec magna faucibus iaculis sed quis eros. Nulla sem orci, consectetur ullamcorper volutpat non, semper non purus. |
---|
146 | </div> |
---|
147 | <div class="col"> |
---|
148 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec velit mi, in iaculis magna. Fusce nec tellus nec magna faucibus iaculis sed quis eros. Nulla sem orci, consectetur ullamcorper volutpat non, semper non purus. |
---|
149 | </div> |
---|
150 | </div> |
---|
151 | |
---|
152 | </div> |
---|
153 | |
---|
154 | </body> |
---|
155 | </html> |
---|