Dotclear

Changeset 3146


Ignore:
Timestamp:
07/31/13 20:41:02 (10 years ago)
Author:
brol
Message:

vversion 1.4, reprise de ce quickfix :  http://forum.dotclear.org/viewtopic.php?pid=297310#p297310

Location:
plugins/authorMode
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • plugins/authorMode/_admin.php

    r1154 r3146  
    2727class authorModeBehaviors 
    2828{ 
    29      public static function adminBeforeUserUpdate(&$cur,&$user_id = '') 
     29     public static function adminBeforeUserUpdate($cur,$user_id = '') 
    3030     { 
    3131          $cur->user_desc = $_POST['user_desc']; 
     
    3939     } 
    4040      
    41      public static function adminAuthorForm(&$rs) 
     41     public static function adminAuthorForm($rs) 
    4242     { 
    4343          if ($rs instanceof dcCore) { 
  • plugins/authorMode/_define.php

    r1154 r3146  
    1616     /* Description*/         "post entries per author + author desc handling", 
    1717     /* Author */             "xave", 
    18      /* Version */            '1.3', 
     18     /* Version */            '1.4', 
    1919     /* Permissions */        'admin,contentadmin' 
    2020); 
  • plugins/authorMode/_install.php

    r1154 r3146  
    1818} 
    1919 
    20 $core->blog->settings->setNameSpace('authormode'); 
     20$core->blog->settings->addNameSpace('authormode'); 
    2121if ($cur_version === null) 
    2222{ 
    23      $core->blog->settings->put('authormode_active',false,'boolean'); 
    24      $core->blog->settings->put('authormode_url_author','author','string'); 
    25      $core->blog->settings->put('authormode_url_authors','authors','string'); 
    26      $core->blog->settings->put('authormode_default_alpha_order',true,'boolean'); 
    27      $core->blog->settings->put('authormode_default_posts_only',true,'boolean'); 
     23     $core->blog->settings->authormode->put('authormode_active',false,'boolean'); 
     24     $core->blog->settings->authormode->put('authormode_url_author','author','string'); 
     25     $core->blog->settings->authormode->put('authormode_url_authors','authors','string'); 
     26     $core->blog->settings->authormode->put('authormode_default_alpha_order',true,'boolean'); 
     27     $core->blog->settings->authormode->put('authormode_default_posts_only',true,'boolean'); 
    2828} 
    2929elseif (version_compare($cur_version,'1.1','<=')) 
    3030{ 
    31      $core->blog->settings->put('authormode_default_alpha_order',true,'boolean'); 
    32      $core->blog->settings->put('authormode_default_posts_only',true,'boolean'); 
     31     $core->blog->settings->authormode->put('authormode_default_alpha_order',true,'boolean'); 
     32     $core->blog->settings->authormode->put('authormode_default_posts_only',true,'boolean'); 
    3333} 
    3434$core->setVersion('authorMode',$new_version); 
  • plugins/authorMode/_prepend.php

    r1154 r3146  
    1616class rsAuthor 
    1717{ 
    18      public static function getAuthorCN(&$rs) 
     18     public static function getAuthorCN($rs) 
    1919     { 
    2020          return dcUtils::getUserCN($rs->user_id, $rs->user_name, 
     
    2222     } 
    2323      
    24      public static function getAuthorLink(&$rs) 
     24     public static function getAuthorLink($rs) 
    2525     { 
    2626          $res = '%1$s'; 
     
    3333     } 
    3434      
    35      public static function getAuthorEmail(&$rs,$encoded=true) 
     35     public static function getAuthorEmail($rs,$encoded=true) 
    3636     { 
    3737          if ($encoded) { 
     
    4242} 
    4343 
    44 if ($core->blog->settings->authormode_active) 
     44if ($core->blog->settings->authormode->authormode_active) 
    4545{ 
    46      if ($core->blog->settings->authormode_url_author !== null) { 
    47           $url_prefix = $core->blog->settings->authormode_url_author; 
     46     if ($core->blog->settings->authormode->authormode_url_author !== null) { 
     47          $url_prefix = $core->blog->settings->authormode->authormode_url_author; 
    4848          if (empty($url_prefix)) { 
    4949               $url_prefix = 'author'; 
     
    5555     } 
    5656      
    57      if ($core->blog->settings->authormode_url_authors !== null) { 
    58           $url_prefix = $core->blog->settings->authormode_url_authors; 
     57     if ($core->blog->settings->authormode->authormode_url_authors !== null) { 
     58          $url_prefix = $core->blog->settings->authormode->authormode_url_authors; 
    5959          if (empty($url_prefix)) { 
    6060               $url_prefix = 'authors'; 
  • plugins/authorMode/_public.php

    r1154 r3146  
    1111# -- END LICENSE BLOCK ------------------------------------ 
    1212if (!defined('DC_RC_PATH')) { return; } 
    13 if (!$core->blog->settings->authormode_active) { return; } 
     13if (!$core->blog->settings->authormode->authormode_active) { return; } 
    1414 
    1515require_once dirname(__FILE__).'/_widgets.php'; 
     
    5252     } 
    5353      
    54      public static function addTplPath(&$core) 
     54     public static function addTplPath($core) 
    5555     { 
    5656          $core->tpl->setPath($core->tpl->getPath(),dirname(__FILE__).'/default-templates'); 
     
    302302               " AND P.post_type = '".$core->con->escape($params['post_type'])."' "; 
    303303          } 
    304           elseif ($core->blog->settings->authormode_default_posts_only) 
     304          elseif ($core->blog->settings->authormode->authormode_default_posts_only) 
    305305          { 
    306306               $strReq .= 
     
    315315               'ORDER BY '.$core->con->escape($params['order']).' '; 
    316316          } 
    317           elseif ($core->blog->settings->authormode_default_alpha_order) 
     317          elseif ($core->blog->settings->authormode->authormode_default_alpha_order) 
    318318          { 
    319319               $strReq .= 
  • plugins/authorMode/_widgets.php

    r1154 r3146  
    1616class widgetsAuthorMode 
    1717{ 
    18      public static function authors(&$w) 
     18     public static function authors($w) 
    1919     { 
    2020          global $core; 
    2121           
    22           if (!$core->blog->settings->authormode_active) return; 
     22          if (!$core->blog->settings->authormode->authormode_active) return; 
    2323           
    2424          $rs = authormodeUtils::getPostsUsers(); 
     
    6060     } 
    6161      
    62      public static function init(&$w) 
     62     public static function init($w) 
    6363     { 
    6464         $w->create('authors',__('Authors'),array('widgetsAuthorMode','authors')); 
  • plugins/authorMode/default-templates/author.html

    r1600 r3146  
    44<head> 
    55  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    6   <meta name="MSSmartTagsPreventParsing" content="TRUE" /> 
     6 
    77  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots robots="NOINDEX"}}" /> 
    88 
  • plugins/authorMode/default-templates/authors.html

    r250 r3146  
    44<head> 
    55  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
    6   <meta name="MSSmartTagsPreventParsing" content="TRUE" /> 
     6 
    77  <meta name="ROBOTS" content="{{tpl:BlogMetaRobots}}" /> 
    88 
  • plugins/authorMode/index.php

    r1154 r3146  
    1212if (!defined('DC_CONTEXT_ADMIN')) { exit; } 
    1313 
    14 $active      = $core->blog->settings->authormode_active; 
    15 $url_author  = $core->blog->settings->authormode_url_author; 
    16 $url_authors = $core->blog->settings->authormode_url_authors; 
    17 $posts_only  = $core->blog->settings->authormode_default_posts_only; 
    18 $alpha_order = $core->blog->settings->authormode_default_alpha_order; 
     14$active      = $core->blog->settings->authormode->authormode_active; 
     15$url_author  = $core->blog->settings->authormode->authormode_url_author; 
     16$url_authors = $core->blog->settings->authormode->authormode_url_authors; 
     17$posts_only  = $core->blog->settings->authormode->authormode_default_posts_only; 
     18$alpha_order = $core->blog->settings->authormode->authormode_default_alpha_order; 
    1919 
    2020if (!empty($_POST['saveconfig'])) { 
    2121     try 
    2222     { 
    23           $core->blog->settings->setNameSpace('authormode'); 
     23          $core->blog->settings->addNameSpace('authormode'); 
    2424           
    2525          $active = (empty($_POST['active']))?false:true; 
     
    3737          $alpha_order = (empty($_POST['alpha_order']))?false:true; 
    3838           
    39           $core->blog->settings->put('authormode_active',$active,'boolean'); 
    40           $core->blog->settings->put('authormode_url_author',$url_author,'string'); 
    41           $core->blog->settings->put('authormode_url_authors',$url_authors,'string'); 
    42           $core->blog->settings->put('authormode_default_posts_only',$posts_only,'boolean'); 
    43           $core->blog->settings->put('authormode_default_alpha_order',$alpha_order,'boolean'); 
     39          $core->blog->settings->authormode->put('authormode_active',$active,'boolean'); 
     40          $core->blog->settings->authormode->put('authormode_url_author',$url_author,'string'); 
     41          $core->blog->settings->authormode->put('authormode_url_authors',$url_authors,'string'); 
     42          $core->blog->settings->authormode->put('authormode_default_posts_only',$posts_only,'boolean'); 
     43          $core->blog->settings->authormode->put('authormode_default_alpha_order',$alpha_order,'boolean'); 
    4444          $core->blog->triggerBlog(); 
    4545           
Note: See TracChangeset for help on using the changeset viewer.

Sites map