Dotclear

Changeset 1183 for plugins/blocNotes


Ignore:
Timestamp:
05/23/09 19:11:41 (14 years ago)
Author:
Moe
Message:

Bloc-Notes 1.0.2 :

  • fixed bug with line breaks broken when using about:config, the strings are now encoded
  • removed legacy code for Dotclear beta versions
  • moved library to inc/ directory
  • replaced <div class="message"> by <p class="message">
Location:
plugins/blocNotes
Files:
2 added
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • plugins/blocNotes/_admin.php

    r459 r1183  
    33# 
    44# This file is part of Bloc-Notes. 
    5 # Copyright 2008 Moe (http://gniark.net/) 
     5# Copyright 2008,2009 Moe (http://gniark.net/) 
    66# 
    77# Bloc-Notes is free software; you can redistribute it and/or modify 
     
    1818# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
    1919# 
    20 # Icons (*.png) are from Tango Icon theme : http://tango.freedesktop.org/Tango_Icon_Gallery 
     20# Icons (*.png) are from Tango Icon theme : 
     21#    http://tango.freedesktop.org/Tango_Icon_Gallery 
    2122# 
    2223# ***** END LICENSE BLOCK ***** 
    23 if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    2424 
    25 require_once(dirname(__FILE__).'/lib.blocNotes.php'); 
     25if (!defined('DC_CONTEXT_ADMIN')) {return;} 
     26 
     27$__autoload['blocNotes'] = 
     28     dirname(__FILE__).'/inc/lib.blocNotes.php'; 
    2629 
    2730# dashboard 
    2831if ($core->auth->check('usage,contentadmin',$core->blog->id)) 
    2932{ 
    30      # <= 2.0-beta7 
    31      if (isset($__dashboard_icons)) { 
    32           $__dashboard_icons[] = array(__('Notebook'),'plugin.php?p=blocNotes','index.php?pf=blocNotes/icon-big.png'); 
    33      } 
    34      # > 2.0-beta7 
    35      $core->addBehavior('adminDashboardIcons',array('blocNotes','adminDashboardIcons')); 
     33     $core->addBehavior('adminDashboardIcons', 
     34          array('blocNotes','adminDashboardIcons')); 
    3635} 
    3736 
    3837# post 
    3938$core->addBehavior('adminPostForm',array('blocNotes','form')); 
    40 $core->addBehavior('adminAfterPostCreate',array('blocNotes','putSettings')); 
    41 $core->addBehavior('adminAfterPostUpdate',array('blocNotes','putSettings')); 
    42 $core->addBehavior('adminPostHeaders',array('blocNotes','adminPostHeaders')); 
     39$core->addBehavior('adminAfterPostCreate', 
     40     array('blocNotes','putSettings')); 
     41$core->addBehavior('adminAfterPostUpdate', 
     42     array('blocNotes','putSettings')); 
     43$core->addBehavior('adminPostHeaders', 
     44     array('blocNotes','adminPostHeaders')); 
    4345 
    4446$_menu['Plugins']->addItem(__('Notebook'), 
    45 'plugin.php?p=blocNotes', 
    46 'index.php?pf=blocNotes/icon.png', 
    47 preg_match('/plugin.php\?p=blocNotes(&.*)?$/',$_SERVER['REQUEST_URI']), 
    48 $core->auth->check('usage,contentadmin',$core->blog->id)); 
     47     'plugin.php?p=blocNotes', 
     48     'index.php?pf=blocNotes/icon.png', 
     49     preg_match('/plugin.php\?p=blocNotes(&.*)?$/', 
     50     $_SERVER['REQUEST_URI']), 
     51     $core->auth->check('usage,contentadmin',$core->blog->id)); 
     52      
    4953?> 
  • plugins/blocNotes/_define.php

    r459 r1183  
    33# 
    44# This file is part of Bloc-Notes. 
    5 # Copyright 2008 Moe (http://gniark.net/) 
     5# Copyright 2008,2009 Moe (http://gniark.net/) 
    66# 
    77# Bloc-Notes is free software; you can redistribute it and/or modify 
     
    1818# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
    1919# 
    20 # Icons (*.png) are from Tango Icon theme : http://tango.freedesktop.org/Tango_Icon_Gallery 
     20# Icons (*.png) are from Tango Icon theme : 
     21#    http://tango.freedesktop.org/Tango_Icon_Gallery 
    2122# 
    2223# ***** END LICENSE BLOCK ***** 
    23 if (!defined('DC_RC_PATH')) { return; } 
     24 
     25if (!defined('DC_RC_PATH')) {return;} 
    2426 
    2527$this->registerModule( 
    26         /* Name */                      "Bloc-Notes", 
    27         /* Description*/                "Display notebooks on the backend", 
    28         /* Author */                    "Moe (http://gniark.net/)", 
    29         /* Version */                   '1.0.1', 
    30         /* Permissions */               'usage,contentadmin' 
     28     /* Name */                                        'Bloc-Notes', 
     29     /* Description*/                        'Display notebooks on the backend', 
     30     /* Author */                                 'Moe (http://gniark.net/)', 
     31     /* Version */                                '1.0.2', 
     32     /* Permissions */                       'usage,contentadmin' 
    3133); 
    3234?> 
  • plugins/blocNotes/inc/lib.blocNotes.php

    r455 r1183  
    1818# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
    1919# 
    20 # Icon (icon.png) is from Silk Icons : http://www.famfamfam.com/lab/icons/silk/ 
     20# Icons (*.png) are from Tango Icon theme : 
     21#    http://tango.freedesktop.org/Tango_Icon_Gallery 
    2122# 
    2223# ***** END LICENSE BLOCK ***** 
     
    2627          public static function adminDashboardIcons(&$core, &$icons) 
    2728          { 
    28                $icons['blocNotes'] = array(__('Notebook'),'plugin.php?p=blocNotes', 
     29               $icons['blocNotes'] = array(__('Notebook'), 
     30                    'plugin.php?p=blocNotes', 
    2931                    'index.php?pf=blocNotes/icon-big.png'); 
    3032          } 
     
    3335          { 
    3436               global $core; 
     37                
     38               $set = $core->blog->settings; 
    3539 
    3640               echo '<p class="area" id="blocNotes_personal">'. 
     
    3943                    '</label>'. 
    4044                    form::textarea('blocNotes_personal_text',80,5, 
    41                     html::escapeHTML($core->blog->settings->{'blocNotes_text_'.$core->auth->userID()})). 
     45                    html::escapeHTML(base64_decode( 
     46                         $set->{'blocNotes_text_'.$core->auth->userID()}), 
     47                    'maximal')). 
    4248                    '</p>'. 
    4349                    '<p class="area" id="blocNotes">'. 
     
    4652                    '</label>'. 
    4753                    form::textarea('blocNotes_text',80,5, 
    48                     html::escapeHTML($core->blog->settings->blocNotes_text)). 
     54                    html::escapeHTML(base64_decode($set->blocNotes_text)), 
     55                    'maximal'). 
    4956                    '</p>'. 
    50                     '<p>'. 
     57                    '<p class="form-note">'. 
    5158                    __('These notes may be read by anyone, don\'t write some sensitive information (password, personal information, etc.)'). 
    5259                    '</p>'; 
     
    6168                    $core->blog->settings->setNameSpace('blocnotes'); 
    6269                    # Bloc-Notes' text 
    63                     $core->blog->settings->put('blocNotes_text_'.$core->auth->userID(), 
    64                          $_POST['blocNotes_personal_text'],'text','Bloc-Notes\' personal text',true,true); 
     70                    $core->blog->settings->put( 
     71                         'blocNotes_text_'.$core->auth->userID(), 
     72                         base64_encode($_POST['blocNotes_personal_text']),'text', 
     73                         'Bloc-Notes\' personal text',true,true); 
    6574                    $core->blog->settings->put('blocNotes_text', 
    66                          $_POST['blocNotes_text'],'text','Bloc-Notes\' text'); 
     75                         base64_encode($_POST['blocNotes_text']),'text', 
     76                         'Bloc-Notes\' text'); 
    6777               } 
    6878          } 
     
    7080          public static function adminPostHeaders() 
    7181          { 
    72                return '<script type="text/javascript" src="index.php?pf=blocNotes/post.js">'. 
    73                '</script>'."\n"; 
     82               return '<script type="text/javascript" '. 
     83                    'src="index.php?pf=blocNotes/post.js">'. 
     84                    '</script>'."\n"; 
    7485          } 
    7586     } 
  • plugins/blocNotes/index.php

    r459 r1183  
    33# 
    44# This file is part of Bloc-Notes. 
    5 # Copyright 2008 Moe (http://gniark.net/) 
     5# Copyright 2008,2009 Moe (http://gniark.net/) 
    66# 
    77# Bloc-Notes is free software; you can redistribute it and/or modify 
     
    1818# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
    1919# 
    20 # Icons (*.png) are from Tango Icon theme : http://tango.freedesktop.org/Tango_Icon_Gallery 
     20# Icons (*.png) are from Tango Icon theme : 
     21#    http://tango.freedesktop.org/Tango_Icon_Gallery 
    2122# 
    2223# ***** END LICENSE BLOCK ***** 
    23 if (!defined('DC_CONTEXT_ADMIN')) { return; } 
    2424 
    25      try 
     25if (!defined('DC_CONTEXT_ADMIN')) {return;} 
     26 
     27$msg = ''; 
     28 
     29try 
     30{ 
     31     if (!empty($_POST['saveconfig'])) 
    2632     { 
    27           if (!empty($_POST['saveconfig'])) 
    28           { 
    29                blocNotes::putSettings(); 
    30                http::redirect($p_url.'&saveconfig=1'); 
    31           } 
     33          blocNotes::putSettings(); 
     34          http::redirect($p_url.'&saveconfig=1'); 
    3235     } 
    33      catch (Exception $e) 
    34      { 
    35           $core->error->add($e->getMessage()); 
    36      } 
     36} 
     37catch (Exception $e) 
     38{ 
     39     $core->error->add($e->getMessage()); 
     40} 
    3741 
    38      if (isset($_GET['saveconfig'])) 
    39      { 
    40           $msg = __('Configuration successfully updated.'); 
    41      } 
     42if (isset($_GET['saveconfig'])) 
     43{ 
     44     $msg = __('Configuration successfully updated.'); 
     45} 
    4246 
    4347?> 
     
    4549<head> 
    4650     <title><?php echo __('Notebook'); ?></title> 
    47      <?php echo dcPage::jsPageTabs($default_tab); ?> 
    48      <style type="text/css"> 
    49           textarea {width:100%;} 
    50      </style> 
    5151</head> 
    5252<body> 
     
    5555 
    5656     <?php  
    57           if (!empty($msg)) {echo '<div class="message">'.$msg.'</div><p></p>';} 
     57          if (!empty($msg)) {echo '<p class="message">'.$msg.'</p>';} 
    5858     ?> 
    5959 
Note: See TracChangeset for help on using the changeset viewer.

Sites map