Dotclear

Changeset 2962 for plugins/blocNotes


Ignore:
Timestamp:
02/20/11 18:10:46 (13 years ago)
Author:
Moe
Message:

Bloc-Notes 1.0.3:

  • added importExport compatibility, need more tests (references #188)
  • Dotclear 2.2 settings support
Location:
plugins/blocNotes
Files:
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • plugins/blocNotes/_admin.php

    r2196 r2962  
    33# 
    44# This file is part of Bloc-Notes. 
    5 # Copyright 2008,2009,2010 Moe (http://gniark.net/) 
     5# Copyright 2008,2009,2010,2011 Moe (http://gniark.net/) 
    66# 
    77# Bloc-Notes is free software; you can redistribute it and/or modify 
     
    5050     $_SERVER['REQUEST_URI']), 
    5151     $core->auth->check('usage,contentadmin',$core->blog->id)); 
     52 
     53 
     54# backups 
     55 
     56/*$core->addBehavior('exportFull', 
     57     array('blocNotesExportImport','exportFull')); 
     58$core->addBehavior('exportSingle', 
     59     array('blocNotesExportImport','exportSingle')); 
     60$core->addBehavior('importInit', 
     61     array('blocNotesExportImport','importInit')); 
     62$core->addBehavior('importSingle', 
     63     array('blocNotesExportImport','importSingle')); 
     64$core->addBehavior('importFull', 
     65     array('blocNotesExportImport','importFull')); 
     66 
     67class blocNotesExportImport 
     68{ 
     69     public static function exportFull($core,$exp) 
     70     { 
     71          $exp->export('user', 
     72               'SELECT bloc_notes, user_id '. 
     73               'FROM '.$core->prefix.'user U '. 
     74               "WHERE U.bloc_notes != '' " 
     75          ); 
     76     } 
    5277      
     78     public static function exportSingle($core,$exp,$blog_id) 
     79     { 
     80          # from /dotclear/admin/blog_pref.php 
     81          $blog_users = $core->getBlogPermissions($blog_id,$core->auth->isSuperAdmin()); 
     82          $blog_users = array_keys($blog_users); 
     83           
     84          $exp->export('user', 
     85               'SELECT bloc_notes, user_id '. 
     86               'FROM '.$core->prefix.'user U '. 
     87               "WHERE U.bloc_notes != '' ". 
     88               "AND U.user_id ".$core->con->in($blog_users) 
     89          ); 
     90     } 
     91      
     92     public static function importInit($bk,$core) 
     93     { 
     94          $bk->cur_user = $core->con->openCursor($core->prefix.'user'); 
     95     } 
     96      
     97     public static function importFull($line,$bk,$core) 
     98     { 
     99          if ($line->__name == 'user') 
     100          { 
     101               $bk->cur_user->bloc_notes   = (string) $line->bloc_notes; 
     102               $bk->cur_meta->update('WHERE user_id = \''. 
     103                    $core->con->escape($line->user_id).'\''); 
     104          } 
     105     } 
     106      
     107     public static function importSingle($line,$bk,$core) 
     108     { 
     109          if ($line->__name == 'user') 
     110          { 
     111               $bk->cur_user->bloc_notes   = (string) $line->bloc_notes; 
     112               $bk->cur_meta->update('WHERE user_id = \''. 
     113                    $core->con->escape($line->user_id).'\''); 
     114          } 
     115     } 
     116}*/ 
     117 
    53118?> 
  • plugins/blocNotes/_define.php

    r2195 r2962  
    33# 
    44# This file is part of Bloc-Notes. 
    5 # Copyright 2008,2009,2010 Moe (http://gniark.net/) 
     5# Copyright 2008,2009,2010,2011 Moe (http://gniark.net/) 
    66# 
    77# Bloc-Notes is free software; you can redistribute it and/or modify 
     
    2929     /* Description*/    'Display notebooks on the backend', 
    3030     /* Author */        'Moe (http://gniark.net/)', 
    31      /* Version */       '1.0.5', 
     31     /* Version */       '1.0.6', 
    3232     /* Permissions */   'usage,contentadmin' 
    3333); 
  • plugins/blocNotes/_install.php

    r2195 r2962  
    33# 
    44# This file is part of Bloc-Notes. 
    5 # Copyright 2008,2009,2010 Moe (http://gniark.net/) 
     5# Copyright 2008,2009,2010,2011 Moe (http://gniark.net/) 
    66# 
    77# Bloc-Notes is free software; you can redistribute it and/or modify 
  • plugins/blocNotes/inc/lib.blocNotes.php

    r2195 r2962  
    33# 
    44# This file is part of Bloc-Notes. 
    5 # Copyright 2008,2010 Moe (http://gniark.net/) 
     5# Copyright 2008,2010,2011 Moe (http://gniark.net/) 
    66# 
    77# Bloc-Notes is free software; you can redistribute it and/or modify 
     
    3535          { 
    3636               global $core; 
     37 
     38               $core->blog->settings->addNameSpace('blocnotes'); 
    3739                
    38                $set = $core->blog->settings; 
     40               $set = $core->blog->settings->blocnotes; 
    3941                
    4042               $notes = $core->con->select('SELECT bloc_notes '. 
     
    7476                    $cur->update('WHERE user_id = \''.$core->con->escape($core->auth->userID()).'\''); 
    7577                     
    76                     $core->blog->settings->setNameSpace('blocnotes'); 
     78                    $core->blog->settings->addNameSpace('blocnotes'); 
    7779                    # Blog-specific notebook 
    78                     $core->blog->settings->put('blocNotes_text', 
     80                    $core->blog->settings->blocnotes->put('blocNotes_text', 
    7981                         base64_encode($_POST['blocNotes_text']),'text', 
    8082                         'Bloc-Notes\' text'); 
  • plugins/blocNotes/index.php

    r2196 r2962  
    33# 
    44# This file is part of Bloc-Notes. 
    5 # Copyright 2008,2009,2010 Moe (http://gniark.net/) 
     5# Copyright 2008,2009,2010,2011 Moe (http://gniark.net/) 
    66# 
    77# Bloc-Notes is free software; you can redistribute it and/or modify 
  • plugins/blocNotes/post.js

    r2196 r2962  
    22 
    33 This file is part of Bloc-Notes. 
    4  Copyright 2008,2009,2010 Moe (http://gniark.net/) 
     4 Copyright 2008,2009,2010 Moe,2011 (http://gniark.net/) 
    55 
    66 Bloc-Notes is free software; you can redistribute it and/or modify 
Note: See TracChangeset for help on using the changeset viewer.

Sites map