Changeset 3473
- Timestamp:
- Jun 29, 2009, 1:55:17 PM (15 years ago)
- Location:
- extensions/CommentEditor
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/CommentEditor/administration.php
r3465 r3473 1 1 <?php 2 /* $Id: administration.php,v 1. 2 2009/06/26 14:40:27Criss Exp $ */2 /* $Id: administration.php,v 1.3 2009/06/29 11:43:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); … … 49 49 // Define common values 50 50 $ce_common = array( 51 'version' => CE_VERSION,51 'version' => $ce_plugin->getVersion(), 52 52 'title' => $ce_plugin->plugin_id, 53 53 ); -
extensions/CommentEditor/classes/ce_config.class.php
r3462 r3473 89 89 REPLACE INTO '.CONFIG_TABLE.' 90 90 VALUES( 91 \'' .$plugin_id.'\',92 \'' .serialize($default_config).'\',91 \'' . $plugin_id . '\', 92 \'' . serialize($default_config) . '\', 93 93 \'Factory settings for '. $plugin_id . '\') 94 94 ;'; … … 104 104 $query = ' 105 105 DELETE FROM '.CONFIG_TABLE.' 106 WHERE param = \'' .$plugin_id.'\'106 WHERE param = \'' . $plugin_id . '\' 107 107 ;'; 108 108 $result = pwg_query($query); -
extensions/CommentEditor/classes/ce_plugin.class.php
r3462 r3473 1 1 <?php 2 /* $Id: ce_plugin.class.php,v 1.1 1 2009/06/26 09:17:01Criss Exp $ */2 /* $Id: ce_plugin.class.php,v 1.12 2009/06/29 11:43:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 … … 110 110 function loc_begin_picture() { 111 111 $this->doAction(); 112 } 113 114 /* ************************ */ 115 /* ** Accessors ** */ 116 /* ************************ */ 117 118 function getVersion() { 119 if (isset($this->config->config_values[CE_CFG_VERSION])) { 120 return $this->config->config_values[CE_CFG_VERSION]; 121 } 122 return CE_VERSION; 112 123 } 113 124 -
extensions/CommentEditor/include/ce_common.inc.php
r3462 r3473 1 1 <?php 2 /* $Id: ce_common.inc.php,v 1.1 1 2009/06/26 09:49:27Criss Exp $ */2 /* $Id: ce_common.inc.php,v 1.12 2009/06/29 11:43:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 5 /* ************************** */ 6 /* ** Constants ** */ 7 /* ************************** */ 8 9 // Version update 10 define('CE_VERSION', '1.0.j'); 4 11 5 12 // Define constants … … 16 23 define('CE_AMDIN_TPL', CE_ROOT.CE_ADMIN_DIR.CE_TEMPLATE_DIR); 17 24 25 define('CE_OBSOLETE', 'obsolete.list'); 18 26 define('CE_ERRORS', CE_INCLUDE.'errors.png'); 19 27 define('CE_INFOS', CE_INCLUDE.'infos.png'); … … 29 37 define('CE_ACTION_ERROR', 'error_comment'); 30 38 39 // Config keys 40 if (isset($plugin)) { 41 define('CE_CFG_DB_KEY', $plugin['id']); 42 define('CE_CFG_DB_COMMENT', 'Configuration of plugin ' . $plugin['id']); 43 } 44 define('CE_CFG_DISPLAY_ERROR', 'display_error'); 45 define('CE_CFG_DISPLAY_INFO', 'display_info'); 46 define('CE_CFG_VERSION', 'version'); 47 48 // Templates usage 49 define('CE_CHECKED', 'checked="checked"'); 50 51 /* ************************** */ 52 /* ** Includes ** */ 53 /* ************************** */ 54 31 55 // Include plugin functions 32 56 @include_once(CE_INCLUDE.'ce_functions.inc.php'); … … 37 61 ce_require_class("CE_Plugin"); 38 62 39 // Config keys 40 if (isset($plugin)) { 41 define('CE_CFG_DB_KEY', $plugin['id']); 42 define('CE_CFG_DB_COMMENT', 'Configuration of plugin ' . $plugin['id']); 43 } 44 define('CE_CFG_DISPLAY_ERROR', 'display_error'); 45 define('CE_CFG_DISPLAY_INFO', 'display_info'); 63 /* ************************** */ 64 /* ** Variable definitions ** */ 65 /* ************************** */ 46 66 47 67 // Config default values … … 49 69 $ce_config_default[CE_CFG_DISPLAY_INFO] = true; 50 70 51 // Templates usage52 define('CE_CHECKED', 'checked="checked"')53 71 ?> -
extensions/CommentEditor/include/ce_functions.inc.php
r3462 r3473 1 1 <?php 2 /* $Id: ce_functions.inc.php,v 1. 6 2009/06/26 08:56:32Criss Exp $ */2 /* $Id: ce_functions.inc.php,v 1.7 2009/06/29 11:43:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 … … 10 10 function ce_require_class($aClassName) { 11 11 require_once CE_CLASSES .strtolower($aClassName) . '.class.php'; 12 } 13 14 function ce_clean_obsolete_files($obsolete_file_list) { 15 if (!file_exists(CE_PATH.$obsolete_file_list)) { 16 return TRUE; 17 } 18 $obsolete = file(CE_PATH.$obsolete_file_list); 19 array_push($obsolete, $obsolete_file_list); 20 return ce_clean_obsolete_list($obsolete); 21 } 22 23 function ce_clean_obsolete_list($file_list = array(), &$errors = array()) { 24 if (!function_exists('unlink')) { 25 // No unlink available... 26 array_push($errors, l10n('ce_no_unlink')); 27 return FALSE; 28 } 29 $success = TRUE; 30 foreach ($file_list as $file) { 31 $file = CE_PATH . $file; 32 if (file_exists($file)) { 33 // Remove obsolete file 34 $success &= unlink($file); 35 } 36 } 37 if (!$success) { 38 array_push($errors, l10n('ce_unlink_errors')); 39 } 40 return $success; 12 41 } 13 42 -
extensions/CommentEditor/language/en_UK/plugin.lang.php
r3465 r3473 1 1 <?php 2 /* $Id: plugin.lang.php,v 1. 5 2009/06/26 14:40:27Criss Exp $ */2 /* $Id: plugin.lang.php,v 1.6 2009/06/29 11:43:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 global $lang; … … 22 22 // ================================================================== 23 23 // Config 24 $lang['ce_inconsistent_version'] = '%s: inconsistent version numbers'; 25 $lang['ce_no_unlink'] = 'Function \'unlink\' not available...'; 26 $lang['ce_unlink_errors'] = 'Error occured during file deletion'; 24 27 $lang['ce_config_saved'] = 'Configuration successfully saved'; 25 28 $lang['ce_config_saved_with_errors'] = 'Configuration saved with errors'; -
extensions/CommentEditor/language/fr_FR/plugin.lang.php
r3465 r3473 1 1 <?php 2 /* $Id: plugin.lang.php,v 1. 6 2009/06/26 14:40:27Criss Exp $ */2 /* $Id: plugin.lang.php,v 1.7 2009/06/29 11:43:18 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 global $lang; … … 21 21 // ================================================================== 22 22 // Config 23 $lang['ce_inconsistent_version'] = '%s : numéros de version incohérentes'; 24 $lang['ce_no_unlink'] = 'La fonction \'unlink\' n\'est pas disponible'; 25 $lang['ce_unlink_errors'] = 'Des erreurs ont eu lieu lors de la suppression de fichiers'; 23 26 $lang['ce_config_saved'] = 'Configuration sauvée avec succès'; 24 27 $lang['ce_config_saved_with_errors'] = 'Configuration sauvée mais avec des erreurs'; -
extensions/CommentEditor/language/it_IT/index.php
r3471 r3473 5 5 // | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net | 6 6 // +-----------------------------------------------------------------------+ 7 // | file : $Id: index.php,v 1.1 2009/06/ 15 21:42:12 cmarchadExp $8 // | last update : $Date: 2009/06/ 15 21:42:12$9 // | last modifier : $Author: cmarchad$7 // | file : $Id: index.php,v 1.1 2009/06/29 11:51:59 Criss Exp $ 8 // | last update : $Date: 2009/06/29 11:51:59 $ 9 // | last modifier : $Author: Criss $ 10 10 // | revision : $Revision: 1.1 $ 11 11 // +-----------------------------------------------------------------------+ -
extensions/CommentEditor/language/it_IT/plugin.lang.php
r3471 r3473 1 1 <?php 2 /* $Id: plugin.lang.php,v 1. 4 2009/06/22 22:18:12Criss Exp $ */2 /* $Id: plugin.lang.php,v 1.1 2009/06/29 11:51:59 Criss Exp $ */ 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 global $lang; 5 5 6 6 // ================================================================== 7 // Edit block 7 8 $lang['comment_edit'] = 'Edizione dei commenti'; 8 9 $lang['comment_author'] = 'Autore'; 9 10 $lang['comment_author_free'] = 'Scelta libera del\'autore'; 10 11 $lang['comment_content'] = 'Commento'; 12 //$lang['comment_edit_tool'] = ''; // TODO 11 13 14 15 // ================================================================== 16 // Message block 12 17 $lang[CE_TYPE_INFO] = 'Informazione'; 13 18 $lang[CE_TYPE_ERROR] = 'Errore'; 14 19 $lang['comment_edit_forbidden'] = 'Non siete autorizati ad editare questo commento'; 15 20 $lang['comment_access_invalid'] = 'Accesso invalido'; 21 22 // ================================================================== 23 // Config 24 //$lang['ce_inconsistent_version'] = '%s : '; // TODO 25 //$lang['ce_no_unlink'] = ''; // TODO 26 //$lang['ce_unlink_errors'] = ''; // TODO 27 //$lang['ce_config_saved'] = ''; // TODO 28 //$lang['ce_config_saved_with_errors'] = ''; // TODO 29 //$lang['ce_button_submit'] = ''; // TODO 30 31 // ================================================================== 32 // Config tab 33 //$lang['ce_tab_config'] = ''; // TODO 34 //$lang['ce_config_desc'] = ''; // TODO 35 //$lang['ce_label_config'] = ''; // TODO 36 //$lang['ce_label_display_info'] = ''; // TODO 37 //$lang['ce_label_display_error'] = ''; // TODO 16 38 ?> -
extensions/CommentEditor/main.inc.php
r3465 r3473 1 1 <?php 2 /* $Id: main.inc.php,v 1.1 5 2009/06/26 14:42:03Criss Exp $ */2 /* $Id: main.inc.php,v 1.17 2009/06/29 11:51:59 Criss Exp $ */ 3 3 /* 4 4 Plugin Name: Comment Editor 5 Version: 1.0. i5 Version: 1.0.j 6 6 Description: Allow to edit comment 7 7 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=296 … … 11 11 12 12 /** History ** 13 2009-06-29 1.0.j 14 Add obsolete files management 15 Add italian language (thanks to Rio) 13 16 14 17 2009-06-26 1.0.i … … 50 53 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 51 54 52 define('CE_VERSION', '1.0.i');53 55 define('CE_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); 54 56 define('CE_ROOT', dirname(__FILE__).'/'); -
extensions/CommentEditor/maintain.inc.php
r3462 r3473 10 10 } 11 11 12 function plugin_install($plugin_id ) {12 function plugin_install($plugin_id, $version, &$errors) { 13 13 include_once(CE_PATH . 'include/ce_common.inc.php'); 14 // Include language advices 15 load_language('plugin.lang', CE_PATH); 16 if ($version != CE_VERSION) { 17 array_push($errors, sprintf(l10n('ce_inconsistent_version'), $plugin_id)); 18 return; 19 } 20 $clean = ce_clean_obsolete_files(CE_OBSOLETE); 21 $ce_config_default[CE_CFG_VERSION] = $version; 14 22 $install = CE_Config::install($plugin_id, $ce_config_default); 15 23 } 16 24 17 function plugin_activate($plugin_id) { 25 function plugin_activate($plugin_id, $version, &$errors) { 26 // Nothing special 27 } 28 29 function plugin_deactivate($plugin_id) { 18 30 // Nothing special 19 31 } … … 23 35 $uninstall = CE_Config::uninstall($plugin_id); 24 36 } 37 25 38 ?>
Note: See TracChangeset
for help on using the changeset viewer.