Dotclear


Ignore:
Timestamp:
05/13/13 02:11:56 (10 years ago)
Author:
JcDenis
Message:
  • Fixed page title and messages and contents
Location:
plugins/licenseBootstrap
Files:
1 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • plugins/licenseBootstrap/_admin.php

    r2300 r3129  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
    34# This file is part of licenseBootstrap, a plugin for Dotclear 2. 
    45#  
    5 # Copyright (c) 2009-2010 JC Denis and contributors 
    6 # jcdenis@gdwd.com 
     6# Copyright (c) 2009-2013 Jean-Christian Denis and contributors 
     7# contact@jcdenis.fr 
    78#  
    89# Licensed under the GPL version 2.0 license. 
    910# A copy of this license is available in LICENSE file or at 
    1011# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     12# 
    1113# -- END LICENSE BLOCK ------------------------------------ 
    1214 
    1315if (!defined('DC_CONTEXT_ADMIN')){return;} 
    1416 
    15 # Admin menu 
    1617$_menu['Plugins']->addItem( 
    1718     __('License bootstrap'), 
    18      'plugin.php?p=licenseBootstrap','index.php?pf=licenseBootstrap/icon.png', 
     19     'plugin.php?p=licenseBootstrap', 
     20     'index.php?pf=licenseBootstrap/icon.png', 
    1921     preg_match('/plugin.php\?p=licenseBootstrap(&.*)?$/',$_SERVER['REQUEST_URI']), 
    20      $core->auth->check('admin',$core->blog->id) 
     22     $core->auth->isSuperAdmin() 
    2123); 
    2224?> 
  • plugins/licenseBootstrap/_define.php

    r2300 r3129  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
    34# This file is part of licenseBootstrap, a plugin for Dotclear 2. 
    45#  
    5 # Copyright (c) 2009-2010 JC Denis and contributors 
    6 # jcdenis@gdwd.com 
     6# Copyright (c) 2009-2013 Jean-Christian Denis and contributors 
     7# contact@jcdenis.fr 
    78#  
    89# Licensed under the GPL version 2.0 license. 
    910# A copy of this license is available in LICENSE file or at 
    1011# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     12# 
    1113# -- END LICENSE BLOCK ------------------------------------ 
    1214 
     
    1618     /* Name */               "License bootstrap", 
    1719     /* Description*/         "Add license to your plugins and themes", 
    18      /* Author */        "JC Denis", 
    19      /* Version */       '0.3', 
     20     /* Author */             "JC Denis", 
     21     /* Version */            '2013.05.11', 
    2022     /* Permissions */        null 
    2123); 
    22      /* date */          #20100604 
    2324?> 
  • plugins/licenseBootstrap/_install.php

    r2300 r3129  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
    34# This file is part of licenseBootstrap, a plugin for Dotclear 2. 
    45#  
    5 # Copyright (c) 2009-2010 JC Denis and contributors 
    6 # jcdenis@gdwd.com 
     6# Copyright (c) 2009-2013 Jean-Christian Denis and contributors 
     7# contact@jcdenis.fr 
    78#  
    89# Licensed under the GPL version 2.0 license. 
    910# A copy of this license is available in LICENSE file or at 
    1011# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     12# 
    1113# -- END LICENSE BLOCK ------------------------------------ 
    1214 
    1315if (!defined('DC_CONTEXT_ADMIN')){return;} 
    1416 
     17$rdc_version = '2.5-alpha'; 
    1518$new_version = $core->plugins->moduleInfo('licenseBootstrap','version'); 
    1619$old_version = $core->getVersion('licenseBootstrap'); 
     
    2023try 
    2124{ 
    22      if (version_compare(DC_VERSION,'2.2-beta','<')) 
    23      { 
    24           throw new Exception('licenseBootstrap plugin requires Dotclear 2.2'); 
     25     if (version_compare(str_replace("-r","-p",DC_VERSION),$rdc_version,'<')) { 
     26          throw new Exception(sprintf('%s requires Dotclear %s','licenseBootstrap',$rdc_version)); 
    2527     } 
     28      
    2629     $default_license = 'gpl2'; 
    2730     $default_exts = licenseBootstrap::getDefaultExtensions(); 
  • plugins/licenseBootstrap/_prepend.php

    r2300 r3129  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
    34# This file is part of licenseBootstrap, a plugin for Dotclear 2. 
    45#  
    5 # Copyright (c) 2009-2010 JC Denis and contributors 
    6 # jcdenis@gdwd.com 
     6# Copyright (c) 2009-2013 Jean-Christian Denis and contributors 
     7# contact@jcdenis.fr 
    78#  
    89# Licensed under the GPL version 2.0 license. 
    910# A copy of this license is available in LICENSE file or at 
    1011# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     12# 
    1113# -- END LICENSE BLOCK ------------------------------------ 
    1214 
     
    1517global $__autoload,$core; 
    1618 
     19if ($core->blog === null) return; 
     20 
    1721$__autoload['licenseBootstrap'] = dirname(__FILE__).'/inc/class.license.bootstrap.php'; 
    1822$__autoload['libLicenseBootstrap'] = dirname(__FILE__).'/inc/lib.license.bootstrap.index.php'; 
    1923 
    20 $core->blog->settings->addNamespace('licenseBootstrap'); 
    21 if ($core->blog->settings->licenseBootstrap->licensebootstrap_packman_behavior) 
    22 { 
    23      $core->addBehavior('packmanBeforeCreatePackage',array('licenseBootstrap','packmanBeforeCreatePackage')); 
    24 } 
    25 if ($core->blog->settings->licenseBootstrap->licensebootstrap_translater_behavior) 
    26 { 
    27      $core->addBehavior('dcTranslaterAfterWriteLangFile',array('licenseBootstrap','dcTranslaterAfterWriteLangFile')); 
    28 } 
     24$core->addBehavior('packmanBeforeCreatePackage',array('licenseBootstrap','packmanBeforeCreatePackage')); 
     25$core->addBehavior('dcTranslaterAfterWriteLangFile',array('licenseBootstrap','dcTranslaterAfterWriteLangFile')); 
    2926?> 
  • plugins/licenseBootstrap/_uninstall.php

    r2300 r3129  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
    34# This file is part of licenseBootstrap, a plugin for Dotclear 2. 
    45#  
    5 # Copyright (c) 2009-2010 JC Denis and contributors 
    6 # jcdenis@gdwd.com 
     6# Copyright (c) 2009-2013 Jean-Christian Denis and contributors 
     7# contact@jcdenis.fr 
    78#  
    89# Licensed under the GPL version 2.0 license. 
    910# A copy of this license is available in LICENSE file or at 
    1011# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     12# 
    1113# -- END LICENSE BLOCK ------------------------------------ 
    1214 
  • plugins/licenseBootstrap/inc/class.license.bootstrap.php

    r2300 r3129  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
    34# This file is part of licenseBootstrap, a plugin for Dotclear 2. 
    45#  
    5 # Copyright (c) 2009-2010 JC Denis and contributors 
    6 # jcdenis@gdwd.com 
     6# Copyright (c) 2009-2013 Jean-Christian Denis and contributors 
     7# contact@jcdenis.fr 
    78#  
    89# Licensed under the GPL version 2.0 license. 
    910# A copy of this license is available in LICENSE file or at 
    1011# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     12# 
    1113# -- END LICENSE BLOCK ------------------------------------ 
    1214 
     
    241243          global $core; 
    242244           
    243           $core->blog->settings->addNamespace('licenseBootstrap'); 
     245          if (!$core->blog->settings->licenseBootstrap->licensebootstrap_packman_behavior) { 
     246               return; 
     247          } 
    244248           
    245249          $addfull = (boolean) $core->blog->settings->licenseBootstrap->licensebootstrap_addfull; 
     
    265269           
    266270          global $core; 
     271           
     272          if (!$core->blog->settings->licenseBootstrap->licensebootstrap_translater_behavior) { 
     273               return; 
     274          } 
    267275           
    268276          $id = ''; 
     
    346354          $block =  
    347355          "\r\n# -- BEGIN LICENSE BLOCK ----------------------------------\r\n". 
     356          "#\r\n". 
    348357          '# '.str_replace("\n","\n# ",$license). 
     358          "\r\n#". 
    349359          "\r\n# -- END LICENSE BLOCK ------------------------------------\r\n"; 
    350360 
     
    362372          $block =  
    363373          "/* -- BEGIN LICENSE BLOCK ----------------------------------\r\n". 
     374          " *\r\n". 
    364375          ' * '.str_replace("\n","\n * ",$license). 
     376          "\r\n *". 
    365377          "\r\n * -- END LICENSE BLOCK ------------------------------------*/\r\n\r\n"; 
    366378 
  • plugins/licenseBootstrap/inc/lib.license.bootstrap.index.php

    r2300 r3129  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
    34# This file is part of licenseBootstrap, a plugin for Dotclear 2. 
    45#  
    5 # Copyright (c) 2009-2010 JC Denis and contributors 
    6 # jcdenis@gdwd.com 
     6# Copyright (c) 2009-2013 Jean-Christian Denis and contributors 
     7# contact@jcdenis.fr 
    78#  
    89# Licensed under the GPL version 2.0 license. 
    910# A copy of this license is available in LICENSE file or at 
    1011# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     12# 
    1113# -- END LICENSE BLOCK ------------------------------------ 
    1214 
     
    1921          if (!in_array($type,array('theme','plugin'))) return; 
    2022           
    21           echo '<div>'. 
    22           '<h3>'.($type == 'theme' ? __('Themes') : __('Extensions')).'</h3>'; 
    23            
    2423          if (isset($_REQUEST['done']) && $_REQUEST['tab'] == $type) 
    2524          { 
    26                echo '<p class="message">'.__('License successfully included').'</p>'; 
     25               dcPage::message(__('License successfully included')); 
    2726          } 
     27           
     28          echo '<div id="licenseBootstrap-'.$type.'">'; 
    2829           
    2930          if (!empty($modules) && is_array($modules)) 
  • plugins/licenseBootstrap/index.php

    r2300 r3129  
    11<?php 
    22# -- BEGIN LICENSE BLOCK ---------------------------------- 
     3# 
    34# This file is part of licenseBootstrap, a plugin for Dotclear 2. 
    45#  
    5 # Copyright (c) 2009-2010 JC Denis and contributors 
    6 # jcdenis@gdwd.com 
     6# Copyright (c) 2009-2013 Jean-Christian Denis and contributors 
     7# contact@jcdenis.fr 
    78#  
    89# Licensed under the GPL version 2.0 license. 
    910# A copy of this license is available in LICENSE file or at 
    1011# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
     12# 
    1113# -- END LICENSE BLOCK ------------------------------------ 
    1214 
     
    106108} 
    107109 
     110$title = ''; 
     111if ($default_tab == 'plugin') { 
     112     $title = __('Plugins'); 
     113} 
     114elseif ($default_tab == 'theme') { 
     115     $title = __('Theme'); 
     116} 
     117elseif ($default_tab == 'setting') { 
     118     $title = __('Settings'); 
     119} 
     120$title = html::escapeHTML($title); 
     121 
    108122# Display 
    109123echo  
    110 '<html><head><title>'.__('License bootstrap').'</title>'. 
    111 dcPage::jsLoad('index.php?pf=licenseBootstrap/js/main.js'). 
    112 '<script type="text/javascript">'."\n//<![CDATA[\n". 
    113 dcPage::jsVar('jcToolsBox.prototype.text_wait',__('Please wait')). 
    114 dcPage::jsVar('jcToolsBox.prototype.section',$section). 
    115 "\n//]]>\n</script>\n". 
    116 '</head><body>'. 
    117 '<h2>'.__('License bootstrap'). 
     124'<html><head><title>'.__('License bootstrap'); 
     125if (!empty($title)) { 
     126     echo ' - '.$title; 
     127} 
     128echo  
     129'</title></head><body>'. 
     130'<h2>'.__('License bootstrap'); 
     131if (!empty($title)) { 
     132     echo ' &rsaquo; <span class="page-title">'.$title.'</span>'; 
     133} 
     134echo  
    118135' - <a class="button" href="'.$p_url.'&amp;tab=plugin">'.__('Plugins').'</a>'. 
    119136' - <a class="button" href="'.$p_url.'&amp;tab=theme">'.__('Themes').'</a>'. 
    120 '</h2><hr class="clear" />'; 
     137'</h2>'; 
    121138 
    122139if ($default_tab == 'plugin') 
     
    132149elseif ($default_tab == 'setting') 
    133150{ 
    134      echo '<div><h3>'. __('Settings').'</h3>'; 
    135       
    136151     if (isset($_REQUEST['done'])) 
    137152     { 
    138           echo '<p class="message">'.__('Configuration successfully saved').'</p>'; 
    139      } 
     153          dcPage::message(__('Configuration successfully saved')); 
     154     } 
     155     echo '<form id="setting-form" method="post" action="'.$p_url.'">'; 
     156      
     157     if ($core->plugins->moduleExists('pacKman') || $core->plugins->moduleExists('translater')) 
     158     { 
     159          echo '<fieldset id="settingbehavior"><legend>'.__('Behaviors').'</legend>'; 
     160           
     161          if ($core->plugins->moduleExists('pacKman')) 
     162          { 
     163               echo ' 
     164               <p><label class="classic">'. 
     165               form::checkbox(array('packman_behavior'),'1',$packman_behavior).' '. 
     166               __('Add license before create package with plugin pacKman').'</label></p>'; 
     167          } 
     168          if ($core->plugins->moduleExists('translater')) 
     169          { 
     170               echo ' 
     171               <p><label class="classic">'. 
     172               form::checkbox(array('translater_behavior'),'1',$translater_behavior).' '. 
     173               __('Add license after create lang file with plugin translater').'</label></p>'; 
     174          } 
     175          echo '</fieldset>'; 
     176     } 
     177      
    140178     echo ' 
    141      <form id="setting-form" method="post" action="'.$p_url.'"> 
    142179     <fieldset id="settingfile"><legend>'.__('Files').'</legend> 
    143180     <p><label class="classic">'. 
     
    177214     } 
    178215     echo '</fieldset>'; 
    179       
    180      if ($core->plugins->moduleExists('pacKman') || $core->plugins->moduleExists('translater')) 
    181      { 
    182           echo '<fieldset id="settingbehavior"><legend>'.__('Behaviors').'</legend>'; 
    183            
    184           if ($core->plugins->moduleExists('pacKman')) 
    185           { 
    186                echo ' 
    187                <p><label class="classic">'. 
    188                form::checkbox(array('packman_behavior'),'1',$packman_behavior).' '. 
    189                __('Add license before create package with plugin pacKman').'</label></p>'; 
    190           } 
    191           if ($core->plugins->moduleExists('translater')) 
    192           { 
    193                echo ' 
    194                <p><label class="classic">'. 
    195                form::checkbox(array('translater_behavior'),'1',$translater_behavior).' '. 
    196                __('Add license after create lang file with plugin translater').'</label></p>'; 
    197           } 
    198           echo '</fieldset>'; 
    199      } 
    200216      
    201217     echo ' 
  • plugins/licenseBootstrap/release.txt

    r2300 r3129  
     12013.05.11 
     2 * Fixed page title and messages and contents 
     3 
    140.3 20100605 
    25 * Switched to DC 2.2 
Note: See TracChangeset for help on using the changeset viewer.

Sites map