Changeset 3431 for extensions/CommentEditor
- Timestamp:
- Jun 18, 2009, 9:29:00 AM (15 years ago)
- Location:
- extensions/CommentEditor
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/CommentEditor/classes/ce_comment.class.php
r3426 r3431 50 50 function validateAuthor($author) { 51 51 $user_list = self::getUsers(); 52 if (array_key_exists(strtolower($author), array_change_key_case($userList, CASE_LOWER))) { 52 if (array_key_exists( strtolower($author), 53 array_change_key_case($userList, CASE_LOWER))) { 53 54 // Look in user list to have right case ! 54 55 foreach ($user_list as $user) { -
extensions/CommentEditor/classes/ce_plugin.class.php
r3426 r3431 9 9 */ 10 10 class CE_Plugin { 11 12 private static $url_prefix = null; 13 14 15 function CE_Plugin() { 16 if (null == self::$url_prefix) { 17 self::$url_prefix = get_root_url() . 'index.php?' . CE_ACTION . '='; 18 } 19 } 11 20 12 21 /* ************************ */ … … 26 35 $comment['U_ID'] = $this->getCommentId($comment['U_DELETE']); 27 36 28 $comment['DATE'] .= ' - <a href="' . $this->getEditUrlPrefix() . $comment['U_ID'] . '">'; 37 $comment['DATE'] .= ' - <a href="' . $this->getEditUrlPrefix(); 38 $comment['DATE'] .= $comment['U_ID'] . '">'; 29 39 $comment['DATE'] .= 'Edit'; 30 40 $comment['DATE'] .= '</a>'; … … 132 142 } else if (isset($_POST['freeauthorck'])) { 133 143 // Free author 134 $new_author = $comment->validateAuthor(trim(stripslashes($_POST['freeauthor']))); 144 $new_author = trim(stripslashes($_POST['freeauthor'])); 145 $new_author = $comment->validateAuthor($new_author); 135 146 $comment->setInfo('author', $new_author); 136 147 } … … 158 169 } 159 170 // allow plugins to notify what's going on 160 trigger_action( 'user_comment_insertion', array_merge($comment_array, array('action'=>$comment_action))); 171 trigger_action( 'user_comment_insertion', 172 array_merge($comment_array, array('action'=>$comment_action))); 161 173 if ($comment_action=='reject') { 162 174 $this->displayError($infos); … … 213 225 global $template; 214 226 $template->set_filenames(array('ce_message'=>$this->getTemplate('message.tpl'))); 215 $template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.CE_STYLE.'">', $smarty, $repeat); 227 $template->block_html_head( '', 228 '<link rel="stylesheet" type="text/css" href="'.CE_STYLE.'">', 229 $smarty, $repeat); 216 230 $begin = 'PLUGIN_INDEX_CONTENT_BEFORE'; 217 231 $template->assign('message', $message_array); … … 225 239 226 240 $template->set_filenames(array('ce_edit'=>$this->getTemplate())); 227 $template->block_html_head('', '<link rel="stylesheet" type="text/css" href="'.CE_STYLE.'">', $smarty, $repeat); 241 $template->block_html_head( '', 242 '<link rel="stylesheet" type="text/css" href="'.CE_STYLE.'">', 243 $smarty, $repeat); 228 244 $begin = 'PLUGIN_INDEX_CONTENT_BEFORE'; 229 245 $end = 'PLUGIN_INDEX_CONTENT_AFTER'; … … 245 261 246 262 function getEditUrlPrefix() { 247 return get_root_url() . 'index.php?' . CE_ACTION . '='. CE_ACTION_EDIT . '&' . CE_ID . '=';263 return self::$url_prefix . CE_ACTION_EDIT . '&' . CE_ID . '='; 248 264 } 249 265 250 266 function getUpdateUrlPrefix() { 251 return get_root_url() . 'index.php?' . CE_ACTION . '='. CE_ACTION_UPDATE;267 return self::$url_prefix . CE_ACTION_UPDATE; 252 268 } 253 269 -
extensions/CommentEditor/include/ce_common.inc.php
r3426 r3431 3 3 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 4 4 5 define('CE_VERSION', '1.0. a');5 define('CE_VERSION', '1.0.b'); 6 6 define('CE_INCLUDE_DIR', 'include/'); 7 7 define('CE_CLASSES_DIR', 'classes/'); -
extensions/CommentEditor/main.inc.php
r3426 r3431 3 3 /* 4 4 Plugin Name: Comment Editor 5 Version: 1.0. a5 Version: 1.0.b 6 6 Description: Allow to edit comment 7 Plugin URI: http://piwigo.org/ 7 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=296 8 8 Author: Criss 9 9 Author URI: http://piwigo.org/ 10 10 */ 11 11 12 /** History ** 13 14 2009-06-18 1.0.b 15 Fix plugin URI to be available in plugin update 16 check page. 17 Reduce code line size. 18 19 */ 12 20 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); 13 21 … … 18 26 19 27 $ce_plugin = new CE_Plugin(); 20 add_event_handler('loc_begin_page_header', array(&$ce_plugin, 'loc_begin_page_header')); 21 add_event_handler('loc_begin_index', array(&$ce_plugin, 'loc_end_index'), 1); 28 add_event_handler( 'loc_begin_page_header', 29 array(&$ce_plugin, 'loc_begin_page_header')); 30 add_event_handler( 'loc_begin_index', 31 array(&$ce_plugin, 'loc_end_index'), 1); 22 32 23 33 set_plugin_data($plugin['id'], $ce_plugin);
Note: See TracChangeset
for help on using the changeset viewer.