Changeset 1183 for plugins/blocNotes
- Timestamp:
- 05/23/09 19:11:41 (14 years ago)
- Location:
- plugins/blocNotes
- Files:
-
- 2 added
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
plugins/blocNotes/_admin.php
r459 r1183 3 3 # 4 4 # This file is part of Bloc-Notes. 5 # Copyright 2008 Moe (http://gniark.net/)5 # Copyright 2008,2009 Moe (http://gniark.net/) 6 6 # 7 7 # Bloc-Notes is free software; you can redistribute it and/or modify … … 18 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 19 19 # 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 21 22 # 22 23 # ***** END LICENSE BLOCK ***** 23 if (!defined('DC_CONTEXT_ADMIN')) { return; }24 24 25 require_once(dirname(__FILE__).'/lib.blocNotes.php'); 25 if (!defined('DC_CONTEXT_ADMIN')) {return;} 26 27 $__autoload['blocNotes'] = 28 dirname(__FILE__).'/inc/lib.blocNotes.php'; 26 29 27 30 # dashboard 28 31 if ($core->auth->check('usage,contentadmin',$core->blog->id)) 29 32 { 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')); 36 35 } 37 36 38 37 # post 39 38 $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')); 43 45 44 46 $_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 49 53 ?> -
plugins/blocNotes/_define.php
r459 r1183 3 3 # 4 4 # This file is part of Bloc-Notes. 5 # Copyright 2008 Moe (http://gniark.net/)5 # Copyright 2008,2009 Moe (http://gniark.net/) 6 6 # 7 7 # Bloc-Notes is free software; you can redistribute it and/or modify … … 18 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 19 19 # 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 21 22 # 22 23 # ***** END LICENSE BLOCK ***** 23 if (!defined('DC_RC_PATH')) { return; } 24 25 if (!defined('DC_RC_PATH')) {return;} 24 26 25 27 $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' 31 33 ); 32 34 ?> -
plugins/blocNotes/inc/lib.blocNotes.php
r455 r1183 18 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 19 19 # 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 21 22 # 22 23 # ***** END LICENSE BLOCK ***** … … 26 27 public static function adminDashboardIcons(&$core, &$icons) 27 28 { 28 $icons['blocNotes'] = array(__('Notebook'),'plugin.php?p=blocNotes', 29 $icons['blocNotes'] = array(__('Notebook'), 30 'plugin.php?p=blocNotes', 29 31 'index.php?pf=blocNotes/icon-big.png'); 30 32 } … … 33 35 { 34 36 global $core; 37 38 $set = $core->blog->settings; 35 39 36 40 echo '<p class="area" id="blocNotes_personal">'. … … 39 43 '</label>'. 40 44 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')). 42 48 '</p>'. 43 49 '<p class="area" id="blocNotes">'. … … 46 52 '</label>'. 47 53 form::textarea('blocNotes_text',80,5, 48 html::escapeHTML($core->blog->settings->blocNotes_text)). 54 html::escapeHTML(base64_decode($set->blocNotes_text)), 55 'maximal'). 49 56 '</p>'. 50 '<p >'.57 '<p class="form-note">'. 51 58 __('These notes may be read by anyone, don\'t write some sensitive information (password, personal information, etc.)'). 52 59 '</p>'; … … 61 68 $core->blog->settings->setNameSpace('blocnotes'); 62 69 # 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); 65 74 $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'); 67 77 } 68 78 } … … 70 80 public static function adminPostHeaders() 71 81 { 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"; 74 85 } 75 86 } -
plugins/blocNotes/index.php
r459 r1183 3 3 # 4 4 # This file is part of Bloc-Notes. 5 # Copyright 2008 Moe (http://gniark.net/)5 # Copyright 2008,2009 Moe (http://gniark.net/) 6 6 # 7 7 # Bloc-Notes is free software; you can redistribute it and/or modify … … 18 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 19 19 # 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 21 22 # 22 23 # ***** END LICENSE BLOCK ***** 23 if (!defined('DC_CONTEXT_ADMIN')) { return; }24 24 25 try 25 if (!defined('DC_CONTEXT_ADMIN')) {return;} 26 27 $msg = ''; 28 29 try 30 { 31 if (!empty($_POST['saveconfig'])) 26 32 { 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'); 32 35 } 33 catch (Exception $e) 34 { 35 $core->error->add($e->getMessage()); 36 } 36 } 37 catch (Exception $e) 38 { 39 $core->error->add($e->getMessage()); 40 } 37 41 38 39 40 41 42 if (isset($_GET['saveconfig'])) 43 { 44 $msg = __('Configuration successfully updated.'); 45 } 42 46 43 47 ?> … … 45 49 <head> 46 50 <title><?php echo __('Notebook'); ?></title> 47 <?php echo dcPage::jsPageTabs($default_tab); ?>48 <style type="text/css">49 textarea {width:100%;}50 </style>51 51 </head> 52 52 <body> … … 55 55 56 56 <?php 57 if (!empty($msg)) {echo '< div class="message">'.$msg.'</div><p></p>';}57 if (!empty($msg)) {echo '<p class="message">'.$msg.'</p>';} 58 58 ?> 59 59
Note: See TracChangeset
for help on using the changeset viewer.