Dotclear

source: plugins/carnaval/add.php @ 556

Revision 556, 2.6 KB checked in by Osku, 15 years ago (diff)

Carnaval 1.2RC - finally blowup friendly

Line 
1<?php /* -*- tab-width: 5; indent-tabs-mode: t; c-basic-offset: 5 -*- */
2/***************************************************************\
3 *  This is 'Carnaval', a plugin for Dotclear 2                *
4 *                                                             *
5 *  Copyright (c) 2007-2008                                    *
6 *  Osku and contributors.                                     *
7 *                                                             *
8 *  This is an open source software, distributed under the GNU *
9 *  General Public License (version 2) terms and  conditions.  *
10 *                                                             *
11 *  You should have received a copy of the GNU General Public  *
12 *  License along with 'Carnaval' (see COPYING.txt);           *
13 *  if not, write to the Free Software Foundation, Inc.,       *
14 *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA    *
15\***************************************************************/
16if (!defined('DC_CONTEXT_ADMIN')) { return; }
17
18$comment_author = $comment_author_mail = $comment_author_site = $comment_class = 
19$comment_text_color = $comment_background_color ='';
20
21$can_write_images = carnavalConfig::canWriteImages();
22
23# Add CSS Class
24if (!empty($_POST['add_class']))
25{
26     $comment_author = $_POST['comment_author'];
27     $comment_author_mail = $_POST['comment_author_mail'];
28     $comment_author_site = $_POST['comment_author_site'];
29     $comment_class = $_POST['comment_class'];
30     $comment_text_color = carnavalConfig::adjustColor($_POST['comment_text_color']);
31     $comment_background_color = carnavalConfig::adjustColor($_POST['comment_background_color']);
32     
33     try {
34          dcCarnaval::addClass($comment_author,$comment_author_mail,$comment_author_site,$comment_text_color,$comment_background_color,$comment_class);
35          if ($can_write_images || $comment_background_color )
36          {
37               carnavalConfig::createImages($comment_background_color,$comment_class);
38          }
39          http::redirect($p_url.'&addclass=1');
40     } catch (Exception $e) {
41          $core->error->add($e->getMessage());
42     }
43}
44?>
45<html><head>
46  <title>Carnaval</title>
47  <?php echo dcPage::jsColorPicker(); ?>
48</head><body>
49<?php
50require dirname(__FILE__).'/forms.php';
51echo '<p><a class="back" href="'.$p_url.'">'.__('Return to Carnaval').'</a></p>';
52echo '<form action="plugin.php" method="post">
53     <fieldset class="two-cols"><legend>'.__('Add a new CSS Class').'</legend>
54     '.$forms['form_fields'].'
55     <p>'.form::hidden('add',1).
56     form::hidden(array('p'),'carnaval').$core->formNonce().
57     '<input type="submit" name="add_class" accesskey="a" value="'.__('Add').' (a)" tabindex="6" /></p>
58     </fieldset>
59     </form>';
60?>
61<?php dcPage::helpBlock('carnaval');?>
62</body>
63</html>
Note: See TracBrowser for help on using the repository browser.

Sites map