1 | <?php |
---|
2 | |
---|
3 | if ($fatal_error) |
---|
4 | return; |
---|
5 | |
---|
6 | $nea_forms = array(); |
---|
7 | |
---|
8 | $nea_forms['list_actions'] = array( |
---|
9 | __('Delete')=>'delete', |
---|
10 | __('Make not evil')=>'mknotevil', |
---|
11 | __('Make evil')=>'mkevil', |
---|
12 | __('Enable')=>'enable', |
---|
13 | __('Disable')=>'disable'); |
---|
14 | |
---|
15 | |
---|
16 | /* FORMULAIRE - Configuration |
---|
17 | --------------------------------------------------- */ |
---|
18 | |
---|
19 | $nea_forms['config'] = ' |
---|
20 | <form action="'.$p_url.'" method="post"> |
---|
21 | <fieldset class="two-cols"><legend>'.__('General configuration').'</legend> |
---|
22 | <p class="col"><label class="required" title="'.__('Required field').'">'.__('Not evil ads identifiers:').' '. |
---|
23 | form::field(array('nea_identifiers'),40,false,html::escapeHTML($nea_settings['identifiers']),'','',true).'</label></p> |
---|
24 | <div class="col"> |
---|
25 | <p><label class="classic">'.form::checkbox(array('nea_default'),1,$nea_settings['default']). |
---|
26 | ' '.__('Show ads by default').'</label></p> |
---|
27 | <p><label class="classic">'.form::checkbox(array('nea_nothome'),1,$nea_settings['nothome']). |
---|
28 | __('Do not show ads on home page by default').'</label></p> |
---|
29 | <p><label class="classic">'.form::checkbox(array('nea_notajax'),1,$nea_settings['notajax']). |
---|
30 | ' '.__('Disable Ajax').'</label></p> |
---|
31 | </div> |
---|
32 | </fieldset> |
---|
33 | |
---|
34 | <fieldset><legend>'.__('Cookie configuration').'</legend> |
---|
35 | <p><label class="required" title="'.__('Required field').'">'.__('Cookie name').' '. |
---|
36 | form::field(array('nea_cookiename'),20,128,html::escapeHTML($nea_settings['cookiename'])).'</label></p> |
---|
37 | <p><label class="classic">'.sprintf(__('Keep cookie %s days'), |
---|
38 | form::field(array('nea_cookiedays'),3,4,html::escapeHTML($nea_settings['cookiedays']))).'</label></p> |
---|
39 | <p><label class="classic">'.form::checkbox(array('nea_easycookie'),1,$nea_settings['easycookie']).' '. |
---|
40 | __('Do not use cookie advanced configuration (cookie domain and path parameters)').'</label></p> |
---|
41 | <div class="lockable two-cols"> |
---|
42 | <p class="col"><label>'.__('Cookie path').' '. |
---|
43 | form::field(array('nea_cookiepath'),20,false,html::escapeHTML($nea_settings['cookiepath'])).'</label></p> |
---|
44 | <p class="col"><label>'.__('Cookie domain').' '. |
---|
45 | form::field(array('nea_cookiedome'),20,256,html::escapeHTML($nea_settings['cookiedome'])).'</label></p> |
---|
46 | <br class="clear" /> |
---|
47 | <p class="form-note warn">'.__('Do not use path and domain parameters unless you know what you are doing').'</p> |
---|
48 | </div> |
---|
49 | |
---|
50 | <p><input type="submit" name="nea_action_config" value="'.__('Update configuration').'" />'. |
---|
51 | (is_callable(array($core,'formNonce')) ? $core->formNonce() : '').'</p> |
---|
52 | </form>'; |
---|
53 | |
---|
54 | /* FORMULAIRE - Liste des publicités |
---|
55 | --------------------------------------------------- */ |
---|
56 | |
---|
57 | $nea_forms['list'] = ' |
---|
58 | <form action="'.$p_url.'" id="nea-form-list" method="post"> |
---|
59 | <table class="maximal"> |
---|
60 | <thead><tr> |
---|
61 | <th colspan="2">'.__('Identifier').'</th> |
---|
62 | <th>'.__('Title').'</th> |
---|
63 | <th colspam="2">'.__('Status').'</th> |
---|
64 | </tr></thead> |
---|
65 | <tbody> |
---|
66 | '; |
---|
67 | |
---|
68 | foreach ($nea_ads as $ad) |
---|
69 | { |
---|
70 | $nea_forms['list'] .= |
---|
71 | '<tr class="line'.($ad['disable'] ? ' offline' : '').'" id="a'.$ad['identifier'].'">'. |
---|
72 | '<td class="nowrap">'. |
---|
73 | form::checkbox(array('nea_selected[]'),$ad['identifier'], |
---|
74 | (in_array($ad['identifier'],$nea_selected) ? true : false), |
---|
75 | '','',false,'title="'.__('Select this ad').'"').'</td>'. |
---|
76 | |
---|
77 | '<td class="nowrap">'.html::escapeHTML($ad['identifier']).'</td>'. |
---|
78 | |
---|
79 | '<td class="maximal">'.html::escapeHTML($ad['title']).'</td>'. |
---|
80 | |
---|
81 | '<td class="nowrap status">'.($ad['disable'] |
---|
82 | ? '<img src="images/check-off.png" alt="'.__('disabled').'" />' |
---|
83 | : ($ad['notevil'] |
---|
84 | ? '<img src="images/check-on.png" alt="'.__('not evil').'" />' |
---|
85 | : '<img src="images/check-wrn.png" alt="'.__('evil').'" />')). |
---|
86 | '</td>'. |
---|
87 | '<td class="nowrap status">'. |
---|
88 | '<a href="'.$p_url.'&edit='.$ad['identifier'].'" title="'.__('Edit this ad').'">'. |
---|
89 | '<img src="images/edit-mini.png" alt="'.__('edit').'" /></a></td>'. |
---|
90 | "</tr>\n"; |
---|
91 | } |
---|
92 | |
---|
93 | $nea_forms['list'] .= '</tbody> |
---|
94 | </table> |
---|
95 | |
---|
96 | <div class="two-cols"> |
---|
97 | <p class="col checkboxes-helpers"> </p> |
---|
98 | <p class="col right">'.__('Action for selected ads:').' '. |
---|
99 | form::combo(array('nea_action'),$nea_forms['list_actions']). |
---|
100 | (is_callable(array($core,'formNonce')) ? $core->formNonce() : ''). |
---|
101 | ' <input type="submit" name="nea_action_fromlist" value="'.__('ok').'" /></p> |
---|
102 | </div> |
---|
103 | <br class="clear" /> |
---|
104 | </form> |
---|
105 | <p class="status"><strong>'.__('Legend:').'</strong><br/> |
---|
106 | <img src="images/plus.png" alt="'.__('preview').'" /> - '.__('Preview').'<br/> |
---|
107 | <img src="images/edit-mini.png" alt="'.__('edit').'" /> - '.__('Edit').'<br/> |
---|
108 | <img src="images/check-on.png" alt="'.__('not evil').'" /> - '.__('This ad is not evil').'<br/> |
---|
109 | <img src="images/check-wrn.png" alt="'.__('evil').'" /> - '.__('This ad is evil').'<br/> |
---|
110 | <img src="images/check-off.png" alt="'.__('disabled').'" /> - '.__('This ad is disabled').'</p>'; |
---|
111 | |
---|
112 | |
---|
113 | /* FORMULAIRE - Ajout / modification d'une publicité |
---|
114 | --------------------------------------------------- */ |
---|
115 | |
---|
116 | $nea_forms['edit'] = ' |
---|
117 | <form action="'.$p_url.'" method="post"> |
---|
118 | <fieldset class="two-cols"><legend>'. |
---|
119 | (empty($_REQUEST['edit']) ? __('Add a new ad') |
---|
120 | : sprintf(__('Edit ad \'%s\''),$_REQUEST['edit'])).'</legend> |
---|
121 | <p class="col"><label class="required" title="'.__('Required field').'">'.__('HTML code:').'<br/>'. |
---|
122 | form::textArea(array('nea_htmlcode'),35,7,html::escapeHTML($nea_newad['htmlcode'])).'</label></p> |
---|
123 | <div class="col"> |
---|
124 | <p><label class="required" title="'.__('Required field').'">'.__('Identifier:'). |
---|
125 | form::field(array('nea_identifier'),20,256,html::escapeHTML($nea_newad['identifier'])).'</label></p> |
---|
126 | <p><label>'.__('Title:'). |
---|
127 | form::field(array('nea_title'),20,256,html::escapeHTML($nea_newad['title'])).'</label></p> |
---|
128 | <p><label>'.__('Extra DIV attributes:'). |
---|
129 | form::field(array('nea_attr'),20,256,html::escapeHTML($nea_newad['attr'])).'</label></p> |
---|
130 | </div> |
---|
131 | <br class="clear" /> |
---|
132 | |
---|
133 | <p><label class="classic"> '. |
---|
134 | form::checkbox(array('nea_notevil'),1,$nea_newad['notevil']). |
---|
135 | __('This ad is not evil').'</label></p> |
---|
136 | <p><label class="classic">'. |
---|
137 | form::checkbox(array('nea_nothome'),1,$nea_newad['nothome']). |
---|
138 | __('Do not show on home page').'</label></p> |
---|
139 | <p><label class="classic">'. |
---|
140 | form::checkbox(array('nea_notajax'),1,$nea_newad['notajax']). |
---|
141 | __('Disable Ajax for this ad').'</label></p> |
---|
142 | </fieldset> |
---|
143 | |
---|
144 | <p><input type="submit" name="nea_action_'.(empty($_REQUEST['edit']) ? 'add' : 'edit'). |
---|
145 | '" value="'.(empty($_REQUEST['edit']) ? __('Add') : __('Edit')).'" />'. |
---|
146 | (empty($_REQUEST['edit']) ? '' |
---|
147 | : form::hidden(array('edit'),html::escapeHTML($_REQUEST['edit']))). |
---|
148 | (is_callable(array($core,'formNonce')) ? $core->formNonce() : '').'</p> |
---|
149 | </form>'; |
---|
150 | |
---|
151 | /* FORMULAIRE - Aide |
---|
152 | --------------------------------------------------- */ |
---|
153 | |
---|
154 | $nea_forms['help'] = ' |
---|
155 | <p>'.sprintf(__('Unfortunately, help is not avaible in English. '. |
---|
156 | 'To read the up-to-date help in French, please go to the <a href="%s" title="Not Evil Ads online help">support webpage</a>.'), |
---|
157 | "http://sacha.xn--phnix-csa.net/post/2007/08/15/%5BDotclear%5D-Plugin-Not-Evil-Ads-un-nouveau-systeme-de-publicite-pour-votre-blog"). |
---|
158 | '</p>'; |
---|
159 | ?> |
---|