Dotclear

source: plugins/adminExample/index.php @ 3043

Revision 3043, 4.7 KB checked in by Moe, 12 years ago (diff)

Admin Example 0.2:

  • Dotclear 2.3:
    • added behaviours and images for the new dashboard
    • added required field
  • Property svn:executable set to *
Line 
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# Icons by http://dryicons.com
11#
12# ***** END LICENSE BLOCK *****
13
14l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin');
15
16$default_tab = 'tab-1';
17 
18if (isset($_REQUEST['tab'])) {
19     $default_tab = $_REQUEST['tab'];
20}
21
22$core->blog->settings->addNameSpace('adminExample');
23
24$settings =& $core->blog->settings->adminExample;
25 
26if (!empty($_POST['saveconfig']))
27{
28     $settings->put('adminexample_active',
29          !empty($_POST['adminexample_active']),
30          'boolean','Enable Admin Example');
31 
32     # redirect to the page, avoid conflicts with old settings
33     http::redirect($p_url.'&tab=settings&saveconfig=1');
34}
35
36if (isset($_GET['saveconfig']))
37{
38     $msg = __('Configuration successfully updated.');
39}
40
41?><html>
42<head>
43     <title><?php echo(__('Admin example')); ?></title>
44     <?php echo dcPage::jsPageTabs($default_tab); ?>
45</head>
46<body>
47 
48<h2><?php echo html::escapeHTML($core->blog->name).' &rsaquo; '.
49     __('Admin example'); ?></h2>
50
51<?php if (!empty($msg)) {echo '<p class="message">'.$msg.'</p>';} ?>
52
53<div class="multi-part" id="tab-1" title="<?php echo __('Tab 1'); ?>">
54     <?php
55     $combo_values = array(
56          # a group of values
57          # un groupe de valeurs
58          __('Numbers') => array(
59               __('one') => 1,
60               __('two') => 2
61          ),
62          # only  one value
63          # une valeur seule
64          __('Hello World!') => 'hello_world'
65     );
66     ?>
67     
68     <fieldset>
69          <legend><?php echo(__('Hello World!')); ?></legend>
70          <p><label class="classic"><?php echo(
71                    form::checkbox('adminexample_active','1',
72                    $settings->adminexample_active).
73                    ' '.__('Enable')); ?></label></p>
74         
75          <p><label><?php echo(__('Title:').
76               form::combo('combo',$combo_values,'2')); ?>
77               </label></p>
78          <p class="form-note">
79               <?php echo(__('Hello World!')); ?>
80          </p>
81
82          <?php
83               echo
84               '<p><label class="required" for="required_field_id"><abbr title="'.
85               __('Required field').'">*</abbr> '.__('A required field:').'</label> '.
86               form::field('required_field_id',30,32,
87                    html::escapeHTML(__('Hello World'))).'</p>';
88          ?>
89     </fieldset>
90     
91     <fieldset>
92          <legend><?php echo(__('Hello World!')); ?></legend>
93          <p>
94               <?php echo __('Title:'); ?>
95               <label class="classic"><?php echo(
96                    form::radio(array('radio'),html::escapeHTML('1'),false).
97                    __('one')); ?></label>
98               <label class="classic"><?php echo(
99                    form::radio(array('radio'),html::escapeHTML('2'),true).
100                    __('two')); ?></label>
101          </p>
102     </fieldset>
103         
104     
105
106</div>
107
108<div class="multi-part" id="settings"
109     title="<?php echo __('Settings'); ?>">
110     <form method="post" action="<?php echo($p_url); ?>">
111          <p><label class="classic"><?php echo(
112               form::checkbox('adminexample_active','1',
113                    $settings->adminexample_active).
114                    ' '.__('Enable')); ?></label></p>
115          <p class="form-note">
116               <?php echo(__('Hello World!')); ?>
117          </p>
118          <p><?php echo $core->formNonce(); ?></p>
119          <p><input type="submit" name="saveconfig"
120          value="<?php echo __('Save configuration'); ?>" /></p>
121     </form>
122</div>
123
124<div class="multi-part" id="columns"
125     title="<?php echo __('Columns'); ?>">
126     <h3><?php printf(__('%s columns'),2); ?></h3>
127     <div class="two-cols">
128          <div class="col">
129               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.
130          </div>
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>
135     
136     <h3><?php printf(__('%s columns'),3); ?></h3>
137     <div class="three-cols class">
138          <div class="col">
139               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.
140          </div>
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>
148
149</div>
150 
151</body>
152</html>
Note: See TracBrowser for help on using the repository browser.

Sites map