Changeset 2402
- Timestamp:
- 06/27/10 15:57:03 (13 years ago)
- Location:
- plugins/cleanConfig
- Files:
-
- 2 added
- 2 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/cleanConfig/_admin.php
r1968 r2402 2 2 # ***** BEGIN LICENSE BLOCK ***** 3 3 # 4 # This file is part of clean:config .5 # Copyright 2007,2009Moe (http://gniark.net/)4 # This file is part of clean:config, a plugin for Dotclear 2 5 # Copyright (C) 2007,2009,2010 Moe (http://gniark.net/) 6 6 # 7 # clean:config is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 3 of the License, or 10 # (at your option) any later version. 7 # clean:config is free software; you can redistribute it and/or 8 # modify it under the terms of the GNU General Public License v2.0 9 # as published by the Free Software Foundation. 11 10 # 12 11 # clean:config is distributed in the hope that it will be useful, 13 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 14 # GNU General Public License for more details. 16 15 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 16 # You should have received a copy of the GNU General Public 17 # License along with this program. If not, see 18 # <http://www.gnu.org/licenses/>. 19 19 # 20 # Icon (icon.png) and images are from Silk Icons : http://www.famfamfam.com/lab/icons/silk/ 20 # Icon (icon.png) and images are from Silk Icons : 21 # <http://www.famfamfam.com/lab/icons/silk/> 21 22 # 22 23 # ***** END LICENSE BLOCK ***** -
plugins/cleanConfig/_define.php
r2100 r2402 2 2 # ***** BEGIN LICENSE BLOCK ***** 3 3 # 4 # This file is part of clean:config .5 # Copyright 2007,2009,2010 Moe (http://gniark.net/)4 # This file is part of clean:config, a plugin for Dotclear 2 5 # Copyright (C) 2007,2009,2010 Moe (http://gniark.net/) 6 6 # 7 # clean:config is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 3 of the License, or 10 # (at your option) any later version. 7 # clean:config is free software; you can redistribute it and/or 8 # modify it under the terms of the GNU General Public License v2.0 9 # as published by the Free Software Foundation. 11 10 # 12 11 # clean:config is distributed in the hope that it will be useful, 13 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 14 # GNU General Public License for more details. 16 15 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 16 # You should have received a copy of the GNU General Public 17 # License along with this program. If not, see 18 # <http://www.gnu.org/licenses/>. 19 19 # 20 # Icon (icon.png) and images are from Silk Icons : http://www.famfamfam.com/lab/icons/silk/ 20 # Icon (icon.png) and images are from Silk Icons : 21 # <http://www.famfamfam.com/lab/icons/silk/> 21 22 # 22 23 # ***** END LICENSE BLOCK ***** … … 25 26 26 27 $this->registerModule( 27 /* Name */"clean:config",28 /* Description*/ "Delete blog and global settings and plugins' versions",29 /* Author */"Moe (http://gniark.net/)",30 /* Version */ '1.3.3',31 /* Permissions */null28 /* Name */ "clean:config", 29 /* Description */ "Delete blog and global settings", 30 /* Author */ "Moe (http://gniark.net/)", 31 /* Version */ "1.4", 32 /* Permissions */ null 32 33 ); 33 34 ?> -
plugins/cleanConfig/inc/lib.cleanconfig.php
r2100 r2402 2 2 # ***** BEGIN LICENSE BLOCK ***** 3 3 # 4 # This file is part of clean:config .5 # Copyright 2007,2009Moe (http://gniark.net/)4 # This file is part of clean:config, a plugin for Dotclear 2 5 # Copyright (C) 2007,2009,2010 Moe (http://gniark.net/) 6 6 # 7 # clean:config is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 3 of the License, or 10 # (at your option) any later version. 7 # clean:config is free software; you can redistribute it and/or 8 # modify it under the terms of the GNU General Public License v2.0 9 # as published by the Free Software Foundation. 11 10 # 12 11 # clean:config is distributed in the hope that it will be useful, 13 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 14 # GNU General Public License for more details. 16 15 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 16 # You should have received a copy of the GNU General Public 17 # License along with this program. If not, see 18 # <http://www.gnu.org/licenses/>. 19 19 # 20 # Icon (icon.png) and images are from Silk Icons : http://www.famfamfam.com/lab/icons/silk/ 20 # Icon (icon.png) and images are from Silk Icons : 21 # <http://www.famfamfam.com/lab/icons/silk/> 21 22 # 22 23 # ***** END LICENSE BLOCK ***** 24 25 if (!defined('DC_RC_PATH')) {return;} 23 26 24 27 class cleanconfig … … 111 114 { 112 115 $table->row(); 113 $table->cell(__('namespace:').' <strong>'.$v['ns'].'</strong>','class="ns-name" colspan="5"'); 116 $table->cell(__('namespace:'). 117 ' <strong>'.$v['ns'].'</strong>', 118 'class="ns-name" colspan="5"'); 114 119 $echo_ns = true; 115 120 } … … 129 134 { 130 135 $value = form::field(html::escapeHTML($k.'_field'),40, 131 null,html::escapeHTML($v['value']),null,null,null,'readonly="readonly"'); 136 null,html::escapeHTML($v['value']),null,null,null, 137 'readonly="readonly"'); 132 138 } 133 139 $table->cell($value); 134 140 $table->cell($v['type']); 135 141 $table->cell($v['label'],'class="maximal"'); 142 136 143 $i++; 137 144 } … … 159 166 return($str); 160 167 } 161 162 public static function versions()163 {164 global $core;165 166 $table = new table('class="clear" summary="'.__('Settings').'"');167 168 $query = 'SELECT module, version FROM '.DC_DBPREFIX.'version WHERE (module != \'core\');';169 $rs = $core->con->select($query);170 171 # nothing to display172 if ($rs->isEmpty())173 {174 return('<p class="message">'.sprintf(__('%s is empty'),DC_DBPREFIX.'version').'</p>');175 }176 177 $str = '<form method="post" action="'.http::getSelfURI().'">'."\n";178 $table = new table('class="clear" summary="'.__('Versions').'"');179 $table->part('head');180 $table->row();181 $table->header(__('Module'),'colspan="2"');182 $table->header(__('Version'),'class="nowrap"');183 184 $table->part('body');185 186 while ($rs->fetch())187 {188 $module = $rs->module;189 $table->row('class="line"');190 $table->cell(form::checkbox(array('versions[]',html::escapeHTML($module)),html::escapeHTML($module)));191 $table->cell('<label for="'.html::escapeHTML(html::escapeHTML($module)).'">'.$module.'</label>');192 $table->cell($rs->version);193 }194 195 $str .= $table->get();196 $str .= ('<p class="checkboxes-helpers"></p>'.197 '<input type="submit" name="delete_versions" value="'.__('Delete selected versions').'" /></p>'."\n".198 '<p>'.$core->formNonce().'</p>');199 $str .= '</form>'."\n";200 201 return($str);202 }203 204 public static function delete_version($module)205 {206 global $core;207 208 # inspired by drop() function in /dotclear/inc/core/class.dc.settings.php209 $strReq = 'DELETE FROM '.$core->prefix.'version ';210 $strReq .= 'WHERE module = \''.$core->con->escape($module).'\';';211 212 $core->con->execute($strReq);213 }214 168 } 215 169 -
plugins/cleanConfig/index.php
r2100 r2402 2 2 # ***** BEGIN LICENSE BLOCK ***** 3 3 # 4 # This file is part of clean:config .5 # Copyright 2007,2009Moe (http://gniark.net/)4 # This file is part of clean:config, a plugin for Dotclear 2 5 # Copyright (C) 2007,2009,2010 Moe (http://gniark.net/) 6 6 # 7 # clean:config is free software; you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation; either version 3 of the License, or 10 # (at your option) any later version. 7 # clean:config is free software; you can redistribute it and/or 8 # modify it under the terms of the GNU General Public License v2.0 9 # as published by the Free Software Foundation. 11 10 # 12 11 # clean:config is distributed in the hope that it will be useful, 13 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 14 # GNU General Public License for more details. 16 15 # 17 # You should have received a copy of the GNU General Public License 18 # along with this program. If not, see <http://www.gnu.org/licenses/>. 16 # You should have received a copy of the GNU General Public 17 # License along with this program. If not, see 18 # <http://www.gnu.org/licenses/>. 19 19 # 20 # Icon (icon.png) and images are from Silk Icons : http://www.famfamfam.com/lab/icons/silk/ 20 # Icon (icon.png) and images are from Silk Icons : 21 # <http://www.famfamfam.com/lab/icons/silk/> 21 22 # 22 23 # ***** END LICENSE BLOCK ***** 23 24 24 25 if (!defined('DC_CONTEXT_ADMIN')) {exit;} 26 27 l10n::set(dirname(__FILE__).'/locales/'.$_lang.'/admin'); 25 28 26 29 require_once(dirname(__FILE__).'/php-xhtml-table/class.table.php'); … … 53 56 } 54 57 } 55 elseif (isset($_POST['delete_versions']))56 {57 if (count($_POST['versions']) == 0)58 {59 $msg = __('No version deleted.');60 $default_tab = 'versions';61 }62 else63 {64 foreach ($_POST['versions'] as $k)65 {66 cleanconfig::delete_version($k);67 }68 69 http::redirect($p_url.'&versionsdeleted=1');70 }71 }72 58 73 59 if (isset($_GET['settingsdeleted'])) … … 76 62 77 63 $default_tab = $limit.'_settings'; 78 }79 elseif (isset($_GET['versionsdeleted']))80 {81 $msg = __('Versions deleted.');82 64 } 83 65 … … 94 76 //<![CDATA[ 95 77 <?php echo dcPage::jsVar('dotclear.msg.confirm_cleanconfig_delete', 96 __('Are you sure you want to delete settings?')). 97 dcPage::jsVar('dotclear.msg.confirm_cleanconfig_delete_versions', 98 __('Are you sure you want to delete versions?')); ?> 78 __('Are you sure you want to delete settings?')); ?> 99 79 $(document).ready(function() { 100 80 $('.checkboxes-helpers').each(function() { … … 103 83 $('input[name="delete"]').click(function() { 104 84 return window.confirm(dotclear.msg.confirm_cleanconfig_delete); 105 });106 $('input[name="delete_versions"]').click(function() {107 return window.confirm(dotclear.msg.confirm_cleanconfig_delete_versions);108 85 }); 109 86 $('td[class="ns-name"]').css({ cursor:"pointer" }); … … 133 110 134 111 <div class="multi-part" id="versions" title="<?php echo __('versions'); ?>"> 135 <p><?php echo(__('Deletting the version of a plugin will reinstall it if the plugin has an install process.')); ?></p> 136 <?php echo(cleanconfig::versions()); ?> 112 <p><?php printf(__('This function has been moved to the %s plugin.'), 113 '<a href="http://plugins.dotaddict.org/dc2/details/versionsManager">'. 114 __('Versions Manager').'</a>'); ?></p> 137 115 </div> 138 116
Note: See TracChangeset
for help on using the changeset viewer.