Changeset 3129 for plugins/licenseBootstrap
- Timestamp:
- 05/13/13 02:11:56 (10 years ago)
- Location:
- plugins/licenseBootstrap
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/licenseBootstrap/_admin.php
r2300 r3129 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of licenseBootstrap, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 13 15 if (!defined('DC_CONTEXT_ADMIN')){return;} 14 16 15 # Admin menu16 17 $_menu['Plugins']->addItem( 17 18 __('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', 19 21 preg_match('/plugin.php\?p=licenseBootstrap(&.*)?$/',$_SERVER['REQUEST_URI']), 20 $core->auth-> check('admin',$core->blog->id)22 $core->auth->isSuperAdmin() 21 23 ); 22 24 ?> -
plugins/licenseBootstrap/_define.php
r2300 r3129 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of licenseBootstrap, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 … … 16 18 /* Name */ "License bootstrap", 17 19 /* 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', 20 22 /* Permissions */ null 21 23 ); 22 /* date */ #2010060423 24 ?> -
plugins/licenseBootstrap/_install.php
r2300 r3129 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of licenseBootstrap, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 13 15 if (!defined('DC_CONTEXT_ADMIN')){return;} 14 16 17 $rdc_version = '2.5-alpha'; 15 18 $new_version = $core->plugins->moduleInfo('licenseBootstrap','version'); 16 19 $old_version = $core->getVersion('licenseBootstrap'); … … 20 23 try 21 24 { 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)); 25 27 } 28 26 29 $default_license = 'gpl2'; 27 30 $default_exts = licenseBootstrap::getDefaultExtensions(); -
plugins/licenseBootstrap/_prepend.php
r2300 r3129 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of licenseBootstrap, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 … … 15 17 global $__autoload,$core; 16 18 19 if ($core->blog === null) return; 20 17 21 $__autoload['licenseBootstrap'] = dirname(__FILE__).'/inc/class.license.bootstrap.php'; 18 22 $__autoload['libLicenseBootstrap'] = dirname(__FILE__).'/inc/lib.license.bootstrap.index.php'; 19 23 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')); 29 26 ?> -
plugins/licenseBootstrap/_uninstall.php
r2300 r3129 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of licenseBootstrap, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 -
plugins/licenseBootstrap/inc/class.license.bootstrap.php
r2300 r3129 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of licenseBootstrap, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 … … 241 243 global $core; 242 244 243 $core->blog->settings->addNamespace('licenseBootstrap'); 245 if (!$core->blog->settings->licenseBootstrap->licensebootstrap_packman_behavior) { 246 return; 247 } 244 248 245 249 $addfull = (boolean) $core->blog->settings->licenseBootstrap->licensebootstrap_addfull; … … 265 269 266 270 global $core; 271 272 if (!$core->blog->settings->licenseBootstrap->licensebootstrap_translater_behavior) { 273 return; 274 } 267 275 268 276 $id = ''; … … 346 354 $block = 347 355 "\r\n# -- BEGIN LICENSE BLOCK ----------------------------------\r\n". 356 "#\r\n". 348 357 '# '.str_replace("\n","\n# ",$license). 358 "\r\n#". 349 359 "\r\n# -- END LICENSE BLOCK ------------------------------------\r\n"; 350 360 … … 362 372 $block = 363 373 "/* -- BEGIN LICENSE BLOCK ----------------------------------\r\n". 374 " *\r\n". 364 375 ' * '.str_replace("\n","\n * ",$license). 376 "\r\n *". 365 377 "\r\n * -- END LICENSE BLOCK ------------------------------------*/\r\n\r\n"; 366 378 -
plugins/licenseBootstrap/inc/lib.license.bootstrap.index.php
r2300 r3129 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of licenseBootstrap, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 … … 19 21 if (!in_array($type,array('theme','plugin'))) return; 20 22 21 echo '<div>'.22 '<h3>'.($type == 'theme' ? __('Themes') : __('Extensions')).'</h3>';23 24 23 if (isset($_REQUEST['done']) && $_REQUEST['tab'] == $type) 25 24 { 26 echo '<p class="message">'.__('License successfully included').'</p>';25 dcPage::message(__('License successfully included')); 27 26 } 27 28 echo '<div id="licenseBootstrap-'.$type.'">'; 28 29 29 30 if (!empty($modules) && is_array($modules)) -
plugins/licenseBootstrap/index.php
r2300 r3129 1 1 <?php 2 2 # -- BEGIN LICENSE BLOCK ---------------------------------- 3 # 3 4 # This file is part of licenseBootstrap, a plugin for Dotclear 2. 4 5 # 5 # Copyright (c) 2009-201 0 JCDenis and contributors6 # jcdenis@gdwd.com6 # Copyright (c) 2009-2013 Jean-Christian Denis and contributors 7 # contact@jcdenis.fr 7 8 # 8 9 # Licensed under the GPL version 2.0 license. 9 10 # A copy of this license is available in LICENSE file or at 10 11 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 12 # 11 13 # -- END LICENSE BLOCK ------------------------------------ 12 14 … … 106 108 } 107 109 110 $title = ''; 111 if ($default_tab == 'plugin') { 112 $title = __('Plugins'); 113 } 114 elseif ($default_tab == 'theme') { 115 $title = __('Theme'); 116 } 117 elseif ($default_tab == 'setting') { 118 $title = __('Settings'); 119 } 120 $title = html::escapeHTML($title); 121 108 122 # Display 109 123 echo 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'); 125 if (!empty($title)) { 126 echo ' - '.$title; 127 } 128 echo 129 '</title></head><body>'. 130 '<h2>'.__('License bootstrap'); 131 if (!empty($title)) { 132 echo ' › <span class="page-title">'.$title.'</span>'; 133 } 134 echo 118 135 ' - <a class="button" href="'.$p_url.'&tab=plugin">'.__('Plugins').'</a>'. 119 136 ' - <a class="button" href="'.$p_url.'&tab=theme">'.__('Themes').'</a>'. 120 '</h2> <hr class="clear" />';137 '</h2>'; 121 138 122 139 if ($default_tab == 'plugin') … … 132 149 elseif ($default_tab == 'setting') 133 150 { 134 echo '<div><h3>'. __('Settings').'</h3>';135 136 151 if (isset($_REQUEST['done'])) 137 152 { 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 140 178 echo ' 141 <form id="setting-form" method="post" action="'.$p_url.'">142 179 <fieldset id="settingfile"><legend>'.__('Files').'</legend> 143 180 <p><label class="classic">'. … … 177 214 } 178 215 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 }200 216 201 217 echo ' -
plugins/licenseBootstrap/release.txt
r2300 r3129 1 2013.05.11 2 * Fixed page title and messages and contents 3 1 4 0.3 20100605 2 5 * Switched to DC 2.2
Note: See TracChangeset
for help on using the changeset viewer.