Changeset 3475


Ignore:
Timestamp:
Jun 30, 2009, 9:05:35 PM (12 years ago)
Author:
Criss
Message:

Add toolbar trigger for edit template

Location:
extensions/CommentEditor
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/CommentEditor/classes/ce_config.class.php

    r3473 r3475  
    99  var $config_values;
    1010  var $default_config;
     11  var $db_key;
     12  var $db_comment;
    1113
    1214  /* ************************ */
     
    1618  function CE_Config($default_config = array()) {
    1719    $this->default_config = $default_config;
     20    $this->db_key = CE_CFG_DB_KEY;
     21    $this->db_comment = CE_CFG_DB_COMMENT;
    1822  }
    1923
     
    2731      }
    2832      return null;
     33  }
     34
     35  function setDBKey($key) {
     36    $this->db_key = $key;
     37  }
     38
     39  function setDBComment($comment) {
     40    $this->db_comment = $comment;
    2941  }
    3042
     
    6981        REPLACE INTO '.CONFIG_TABLE.'
    7082        VALUES(
    71           \''.CE_CFG_DB_KEY.'\',
     83          \''. $this->db_key .'\',
    7284          \''.serialize($this->config_values).'\',
    73           \''. CE_CFG_DB_COMMENT . '\')
     85          \''. $this->db_comment . '\')
    7486        ;';
    7587    $result = pwg_query($query);
     
    8698
    8799  static function install($plugin_id, $default_config = array()) {
    88     $query = '
    89         REPLACE INTO '.CONFIG_TABLE.'
    90         VALUES(
    91           \'' . $plugin_id . '\',
    92           \'' . serialize($default_config) . '\',
    93           \'Factory settings for '. $plugin_id . '\')
    94         ;';
    95     $result = pwg_query($query);
    96     if($result) {
    97       return true;
    98     } else {
    99       return false;
    100     }
     100    $config = new CE_Config($default_config);
     101    $config->setDBComment('Factory settings for '. $plugin_id);
     102    $config->setDBKey($plugin_id);
     103    $config->loadConfig();
     104    $result = $config->saveConfig();
     105    return $result;
    101106  }
    102107
  • extensions/CommentEditor/classes/ce_plugin.class.php

    r3473 r3475  
    11<?php
    2 /* $Id: ce_plugin.class.php,v 1.12 2009/06/29 11:43:18 Criss Exp $ */
     2/* $Id: ce_plugin.class.php,v 1.13 2009/06/30 19:01:50 Criss Exp $ */
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44
     
    6565    }
    6666    global $template, $conf, $user;
    67     if ((!is_a_guest() and ($user[$conf['user_fields']['username']] == $author))
     67    if ((!is_a_guest()
     68          and ($user[$conf['user_fields']['username']] == $author))
    6869        or is_admin()) {
    6970      $key = count($template->get_template_vars('comments'));
     
    9495        $comments[$key]['DATE'] .= $this->getEditUrl($current_id);
    9596        $comments[$key]['DATE'] .= '">';
    96         $comments[$key]['DATE'] .= l10n('comment_edit_tool');
     97        $comments[$key]['DATE'] .= l10n('ce_edit_tool');
    9798        $comments[$key]['DATE'] .= '</a>';
    9899      }
     
    129130  function doAction() {
    130131    $comment_id = "";
    131     $action = $this->isCommentEdit($_SERVER['QUERY_STRING'], $comment_id);
     132    $action = $this->isCommentEdit($comment_id);
    132133    switch ($action) {
    133134      case CE_ACTION_EDIT:
     
    139140        break;
    140141      case CE_ACTION_ERROR:
    141         $infos = array('comment_edit_forbidden');
     142        $infos = array('ce_edit_forbidden');
    142143        $this->displayError($infos);
    143144        break;
     
    152153  }
    153154
    154   function isCommentEdit($p_query_string, &$p_comment_id) {
    155     $params = split('\&', $p_query_string);
     155  function isCommentEdit(&$p_comment_id) {
    156156    $action = CE_ACTION_NONE;
    157157    $comment_id = "";
    158     foreach ($params as $current_param) {
    159       $key_value = split('=', $current_param);
    160       if (isset($key_value[1])) {
    161         if (CE_ACTION == $key_value[0] && CE_ACTION_NONE == $action) {
    162           switch ($key_value[1]) {
    163             case CE_ACTION_EDIT:
    164             case CE_ACTION_UPDATE:
    165               $action = $key_value[1];
    166               break;
    167             default:
    168           }
    169         }
    170         if (CE_ID == $key_value[0]) {
    171           $comment_id = $key_value[1];
    172         }
     158    if (isset($_GET[CE_ACTION])) {
     159      switch ($_GET[CE_ACTION]) {
     160        case CE_ACTION_EDIT:
     161        case CE_ACTION_UPDATE:
     162          $action = $_GET[CE_ACTION];
     163          break;
     164        default:
    173165      }
     166    }
     167    if (isset($_GET[CE_ID])) {
     168        $comment_id = $_GET[CE_ID];
    174169    }
    175170    if (CE_ACTION_EDIT == $action) {
     
    200195    if (!$this->isEditAllowed($comment)) {
    201196      // Not allowed
    202       array_push($infos, 'comment_edit_forbidden');
     197      array_push($infos, 'ce_edit_forbidden');
    203198      $this->displayError($infos);
    204199      return;
     
    211206    if ((!isset($_POST['ce_commentid'])) or
    212207        (!isset($_POST['ce_imageid']))) {
    213       array_push($infos, 'comment_access_invalid');
     208      array_push($infos, 'ce_access_invalid');
    214209      $this->displayError($infos);
    215210      return;
    216211    }
    217212    if (!is_numeric($_POST['ce_imageid'])) {
    218       array_push($infos, 'comment_access_invalid');
     213      array_push($infos, 'ce_access_invalid');
    219214      $this->displayError($infos);
    220215      return;
     
    223218
    224219    if (!$this->isEditAllowed($comment)) {
    225       array_push($infos, 'comment_edit_forbidden');
     220      array_push($infos, 'ce_edit_forbidden');
    226221      $this->displayError($infos);
    227222      return;
     
    229224    $image_id = $comment->getInfo('image_id');
    230225    if (intval($_POST['ce_imageid']) != intval($image_id)) {
    231       array_push($infos, 'comment_access_invalid');
     226      array_push($infos, 'ce_access_invalid');
    232227      $this->displayError($infos);
    233228      return;
     
    255250    $conf['anti-flood_time'] = 0;
    256251
    257     $comment_action = update_user_comment($comment_array, @$_POST['key'], $infos );
     252    $comment_action = update_user_comment($comment_array,
     253                                          @$_POST['key'],
     254                                          $infos );
    258255
    259256    // Reactivate anti-flood system
     
    271268        break;
    272269      default:
    273         trigger_error('Invalid comment action '.$comment_action, E_USER_WARNING);
     270        trigger_error('Invalid comment action '.$comment_action,
     271                      E_USER_WARNING);
    274272    }
    275273
    276274    // allow plugins to notify what's going on
    277275    trigger_action( 'user_comment_insertion',
    278                     array_merge($comment_array, array('action'=>$comment_action)));
     276                    array_merge($comment_array, array('action'=>
     277                                                      $comment_action)));
    279278    if ($comment_action=='reject') {
    280279      $this->displayError($infos);
     
    329328      'TYPE'  => $p_type,
    330329      'IMG'   => $p_image,
    331       'TITLE' => l10n($p_type),
     330      'TITLE' => l10n('ce_'.$p_type),
    332331      'MSG'   => $messages
    333332    );
    334333
    335334    global $template;
    336     if ("" == $template->get_template_vars('U_HOME')) {
    337       $template->assign('U_HOME', make_index_url());
    338     }
    339     $template->set_filenames(array('ce_message'=>$this->getTemplate('message.tpl')));
     335
     336    $ce_exit = array(
     337      'URL'   => $this->getBaseUrl(),
     338      'TITLE' => 'ce_close_message_title',
     339      'ALT'   => 'ce_close_message_alt',
     340      'IMG'   => CE_CLOSE_IMG
     341    );
     342    $template->assign('ce_exit', $ce_exit);
     343    $template->set_filenames( array('ce_message'=>
     344                                    $this->getTemplate('message.tpl')));
    340345    $template->block_html_head( '',
    341346                  '<link rel="stylesheet" type="text/css" href="'
     
    347352    }
    348353
    349     $template->assign('message', $message_array);
     354    $template->assign('ce_message', $message_array);
    350355    $old_begin = $template->get_template_vars($begin);
    351356    $template->assign($begin, $template->parse('ce_message', true));
     
    374379      'AUTHOR'    => $p_comment->getInfo('author'),
    375380      'IMAGE'     => $p_comment->getInfo('image_id'),
    376       'DISABLED'  => !is_admin(),
    377       'USERS'     => CE_Comment::getUsers(),
    378       'F_ACTION'  => $this->getUpdateUrl(),
    379       'FREEAUTHOR'=> ($p_comment->isKnownAuthor())?'':'checked="checked"'
     381      'F_ACTION'  => $this->getUpdateUrl()
    380382      );
    381       if ("" == $template->get_template_vars('U_HOME')) {
    382         $template->assign('U_HOME', make_index_url());
    383       }
    384       $template->assign('comment', $tpl_comment);
    385       $old_begin = $template->get_template_vars($begin);
    386       $template->assign($begin, $template->parse('ce_edit', true));
    387       $template->concat($begin, $old_begin);
     383
     384    if (is_admin()) {
     385      $tpl_comment['USERS'] = CE_Comment::getUsers();
     386      $tpl_comment['FREEAUTHOR'] = ($p_comment->isKnownAuthor())?
     387                                        '':CE_CHECKED;
     388    }
     389
     390    $additional_toolbar = "";
     391    $additional_toolbar = trigger_event('comment_editor_toolbar',
     392                                        $additional_toolbar);
     393    if ("" != $additional_toolbar) {
     394        $tpl_comment['TOOLBAR'] = $additional_toolbar;
     395    }
     396
     397    $ce_exit = array(
     398      'URL'   => $this->getBaseUrl(),
     399      'TITLE' => 'ce_close_editor_title',
     400      'ALT'   => 'ce_close_editor_alt',
     401      'IMG'   => CE_CLOSE_IMG
     402    );
     403    $template->assign('ce_exit', $ce_exit);
     404
     405    $template->assign('comment_editor', $tpl_comment);
     406    $old_begin = $template->get_template_vars($begin);
     407    $template->assign($begin, $template->parse('ce_edit', true));
     408    $template->concat($begin, $old_begin);
    388409  }
    389410
     
    414435  }
    415436
    416   function getEditUrl($comment_id) {
     437  function getBaseUrl() {
    417438    $url  = get_root_url() . $this->getScriptName() . '.php';
    418439    $url .= get_query_string_diff(array(CE_ACTION, CE_ID));
     440    return $url;
     441  }
     442
     443  function getEditUrl($comment_id) {
     444    $url = $this->getBaseUrl();
    419445    $url = add_url_params($url,
    420446                          array(
     
    427453
    428454  function getUpdateUrl() {
    429     $url  = get_root_url() . $this->getScriptName() .'.php';
    430     $url .= get_query_string_diff(array(CE_ACTION, CE_ID));
     455    $url = $this->getBaseUrl();
    431456    $url = add_url_params($url,
    432457                          array(
  • extensions/CommentEditor/include/ce_common.inc.php

    r3473 r3475  
    11<?php
    2 /* $Id: ce_common.inc.php,v 1.12 2009/06/29 11:43:18 Criss Exp $ */
     2/* $Id: ce_common.inc.php,v 1.13 2009/06/30 19:01:51 Criss Exp $ */
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44
     
    77/* ************************** */
    88
    9 // Version update
    10 define('CE_VERSION',  '1.0.j');
     9// Version
     10define('CE_VERSION',            '1.0.k');
    1111
    12 // Define constants
    13 define('CE_INCLUDE_DIR',   'include/');
    14 define('CE_CLASSES_DIR',   'classes/');
    15 define('CE_IMAGES_DIR',    'images/');
    16 define('CE_TEMPLATE_DIR',  'template/');
    17 define('CE_ADMIN_DIR',     'admin/');
    18 
    19 define('CE_CLASSES',       CE_PATH.CE_CLASSES_DIR);
    20 define('CE_INCLUDE',       CE_PATH.CE_INCLUDE_DIR);
    21 define('CE_TEMPLATE',      CE_PATH.CE_TEMPLATE_DIR);
    22 define('CE_ADMIN',         CE_PATH.CE_ADMIN_DIR);
    23 define('CE_AMDIN_TPL',     CE_ROOT.CE_ADMIN_DIR.CE_TEMPLATE_DIR);
    24 
    25 define('CE_OBSOLETE',      'obsolete.list');
    26 define('CE_ERRORS',        CE_INCLUDE.'errors.png');
    27 define('CE_INFOS',         CE_INCLUDE.'infos.png');
    28 define('CE_TYPE_INFO',     'info');
    29 define('CE_TYPE_ERROR',    'error');
    30 define('CE_PAGE',          'page');
    31 define('CE_PARAMS',        'params');
    32 define('CE_ID',            'comment_id');
    33 define('CE_ACTION',        'comment_action');
    34 define('CE_ACTION_NONE',   'none');
    35 define('CE_ACTION_EDIT',   'edit_comment');
    36 define('CE_ACTION_UPDATE', 'update_comment');
    37 define('CE_ACTION_ERROR',  'error_comment');
    38 
     12// Directories
     13define('CE_INCLUDE_DIR',        'include/');
     14define('CE_CLASSES_DIR',        'classes/');
     15define('CE_IMAGES_DIR',         'images/');
     16define('CE_TEMPLATE_DIR',       'template/');
     17define('CE_ADMIN_DIR',          'admin/');
     18// Path
     19define('CE_CLASSES',            CE_PATH.CE_CLASSES_DIR);
     20define('CE_INCLUDE',            CE_PATH.CE_INCLUDE_DIR);
     21define('CE_TEMPLATE',           CE_PATH.CE_TEMPLATE_DIR);
     22define('CE_ADMIN',              CE_PATH.CE_ADMIN_DIR);
     23define('CE_AMDIN_TPL',          CE_ROOT.CE_ADMIN_DIR.CE_TEMPLATE_DIR);
     24// Files
     25define('CE_OBSOLETE',           'obsolete.list');
     26define('CE_ERRORS',             CE_INCLUDE.'errors.png');
     27define('CE_INFOS',              CE_INCLUDE.'infos.png');
     28define('CE_CLOSE_IMG',          'exit.png');
     29// Constants
     30define('CE_TYPE_INFO',          'info');
     31define('CE_TYPE_ERROR',         'error');
     32define('CE_PAGE',               'page');
     33define('CE_PARAMS',             'params');
     34define('CE_ID',                 'comment_id');
     35define('CE_ACTION',             'comment_action');
     36define('CE_ACTION_NONE',        'none');
     37define('CE_ACTION_EDIT',        'edit_comment');
     38define('CE_ACTION_UPDATE',      'update_comment');
     39define('CE_ACTION_ERROR',       'error_comment');
     40define('CE_CHECKED',            'checked="checked"');
    3941// Config keys
    4042if (isset($plugin)) {
    41   define('CE_CFG_DB_KEY',     $plugin['id']);
    42   define('CE_CFG_DB_COMMENT', 'Configuration of plugin ' . $plugin['id']);
     43  define('CE_CFG_DB_KEY',       $plugin['id']);
     44  define('CE_CFG_DB_COMMENT',   'Configuration of plugin ' . $plugin['id']);
    4345}
    4446define('CE_CFG_DISPLAY_ERROR',  'display_error');
    4547define('CE_CFG_DISPLAY_INFO',   'display_info');
    4648define('CE_CFG_VERSION',        'version');
    47 
    48 // Templates usage
    49 define('CE_CHECKED',  'checked="checked"');
    5049
    5150/* ************************** */
  • extensions/CommentEditor/language/en_UK/plugin.lang.php

    r3473 r3475  
    11<?php
    2 /* $Id: plugin.lang.php,v 1.6 2009/06/29 11:43:18 Criss Exp $ */
     2/* $Id: plugin.lang.php,v 1.7 2009/06/30 19:01:51 Criss Exp $ */
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44global $lang;
     
    66// ==================================================================
    77// Edit block
    8 $lang['comment_edit'] = 'Comment edition';
    9 $lang['comment_author'] = 'Author';
    10 $lang['comment_author_free'] = 'Free choice of the author';
    11 $lang['comment_content'] = 'Comment';
    12 $lang['comment_edit_tool'] = 'Edit';
    13 
     8$lang['ce_edit'] = 'Comment edition';
     9$lang['ce_author'] = 'Author';
     10$lang['ce_author_free'] = 'Free choice of the author';
     11$lang['ce_content'] = 'Comment';
     12$lang['ce_edit_tool'] = 'Edit';
     13$lang['ce_close_editor_title'] = 'Close edition block';
     14$lang['ce_close_editor_alt'] = 'Close';
    1415
    1516// ==================================================================
    1617// Message block
    17 $lang[CE_TYPE_INFO] = 'Information';
    18 $lang[CE_TYPE_ERROR] = 'Error';
    19 $lang['comment_edit_forbidden'] = 'You are not allowed to edit this comment';
    20 $lang['comment_access_invalid'] = 'Invalid access';
     18$lang['ce_'.CE_TYPE_INFO] = 'Information';
     19$lang['ce_'.CE_TYPE_ERROR] = 'Error';
     20$lang['ce_edit_forbidden'] = 'You are not allowed to edit this comment';
     21$lang['ce_access_invalid'] = 'Invalid access';
     22$lang['ce_close_message_title'] = 'Close message block';
     23$lang['ce_close_message_alt'] = 'Close';
    2124
    2225// ==================================================================
  • extensions/CommentEditor/language/fr_FR/plugin.lang.php

    r3473 r3475  
    11<?php
    2 /* $Id: plugin.lang.php,v 1.7 2009/06/29 11:43:18 Criss Exp $ */
     2/* $Id: plugin.lang.php,v 1.8 2009/06/30 19:01:50 Criss Exp $ */
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44global $lang;
     
    66// ==================================================================
    77// Edit block
    8 $lang['comment_edit'] = 'Edition de commentaire';
    9 $lang['comment_author'] = 'Auteur';
    10 $lang['comment_author_free'] = 'Choix libre de l\'auteur';
    11 $lang['comment_content'] = 'Commentaire';
    12 $lang['comment_edit_tool'] = 'Editer';
     8$lang['ce_edit'] = 'Edition de commentaire';
     9$lang['ce_author'] = 'Auteur';
     10$lang['ce_author_free'] = 'Choix libre de l\'auteur';
     11$lang['ce_content'] = 'Commentaire';
     12$lang['ce_edit_tool'] = 'Editer';
     13$lang['ce_close_editor_title'] = 'Fermer le bloc d\'édition';
     14$lang['ce_close_editor_alt'] = 'Fermer';
    1315
    1416// ==================================================================
    1517// Message block
    16 $lang[CE_TYPE_INFO] = 'Information';
    17 $lang[CE_TYPE_ERROR] = 'Erreur';
    18 $lang['comment_edit_forbidden'] = 'Vous n\'êtes pas autorisé à  éditer ce commentaire';
    19 $lang['comment_access_invalid'] = 'Accès invalide';
     18$lang['ce_'.CE_TYPE_INFO] = 'Information';
     19$lang['ce_'.CE_TYPE_ERROR] = 'Erreur';
     20$lang['ce_edit_forbidden'] = 'Vous n\'êtes pas autorisé à  éditer ce commentaire';
     21$lang['ce_access_invalid'] = 'Accès invalide';
     22$lang['ce_close_message_title'] = 'Fermer le bloc de message';
     23$lang['ce_close_message_alt'] = 'Fermer';
    2024
    2125// ==================================================================
  • extensions/CommentEditor/language/it_IT/plugin.lang.php

    r3473 r3475  
    11<?php
    2 /* $Id: plugin.lang.php,v 1.1 2009/06/29 11:51:59 Criss Exp $ */
     2/* $Id: plugin.lang.php,v 1.2 2009/06/30 19:01:51 Criss Exp $ */
    33if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    44global $lang;
     
    66// ==================================================================
    77// Edit block
    8 $lang['comment_edit'] = 'Edizione dei commenti';
    9 $lang['comment_author'] = 'Autore';
    10 $lang['comment_author_free'] = 'Scelta libera del\'autore';
    11 $lang['comment_content'] = 'Commento';
    12 //$lang['comment_edit_tool'] = ''; // TODO
     8$lang['ce_edit'] = 'Edizione dei commenti';
     9$lang['ce_author'] = 'Autore';
     10$lang['ce_author_free'] = 'Scelta libera del\'autore';
     11$lang['ce_content'] = 'Commento';
     12//$lang['ce_edit_tool'] = ''; // TODO
     13//$lang['ce_close_editor_title'] = ''; // TODO
     14//$lang['ce_close_editor_alt'] = ''; // TODO
    1315
    1416
    1517// ==================================================================
    1618// Message block
    17 $lang[CE_TYPE_INFO] = 'Informazione';
    18 $lang[CE_TYPE_ERROR] = 'Errore';
    19 $lang['comment_edit_forbidden'] = 'Non siete autorizati ad editare questo commento';
    20 $lang['comment_access_invalid'] = 'Accesso invalido';
     19$lang['ce_'.CE_TYPE_INFO] = 'Informazione';
     20$lang['ce_'.CE_TYPE_ERROR] = 'Errore';
     21$lang['ce_edit_forbidden'] = 'Non siete autorizati ad editare questo commento';
     22$lang['ce_access_invalid'] = 'Accesso invalido';
     23//$lang['ce_close_message_title'] = ''; // TODO
     24//$lang['ce_close_message_alt'] = ''; // TODO
    2125
    2226// ==================================================================
  • extensions/CommentEditor/main.inc.php

    r3473 r3475  
    11<?php
    2 /* $Id: main.inc.php,v 1.17 2009/06/29 11:51:59 Criss Exp $ */
     2/* $Id: main.inc.php,v 1.18 2009/06/30 19:01:50 Criss Exp $ */
    33/*
    44 Plugin Name: Comment Editor
    5  Version: 1.0.j
     5 Version: 1.0.k
    66 Description: Allow to edit comment
    77 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=296
     
    1111
    1212/** History **
     13  2009-06-30 1.0.k
     14                    Add toolbar trigger for edit template
     15
    1316  2009-06-29 1.0.j
    1417                    Add obsolete files management
     
    1821                    Fix bug on administration page (text)
    1922
    20   2009-06-26 1.0.i
    21                     Display edit block on picture page if request comes
    22                     from this page
     23  2009-06-26 1.0.h
     24                    Display edit block on picture page if request comes from
     25                    this page
    2326                    Add simple administration configuration management
    24                     Add and remove default configuration from database
    25                     on plugin install / uninstall
     27                    Add and remove default configuration from database on
     28                    plugin install / uninstall
    2629
    2730  2009-06-22 1.0.g
     
    4649
    4750  2009-06-18 1.0.b
    48                     Fix plugin URI to be available in plugin update
    49                     check page.
     51                    Fix plugin URI to be available in plugin update check page.
    5052                    Reduce code line size.
    5153
  • extensions/CommentEditor/maintain.inc.php

    r3473 r3475  
    1515  load_language('plugin.lang', CE_PATH);
    1616  if ($version != CE_VERSION) {
    17       array_push($errors, sprintf(l10n('ce_inconsistent_version'), $plugin_id));
    18       return;
     17    array_push($errors, sprintf(l10n('ce_inconsistent_version'), $plugin_id));
     18    return;
    1919  }
    2020  $clean = ce_clean_obsolete_files(CE_OBSOLETE);
  • extensions/CommentEditor/template/edit.tpl

    r3462 r3475  
    1 {* $Id: edit.tpl,v 1.7 2009/06/26 09:17:01 Criss Exp $ *}
    2 {if !$comment.DISABLED}
     1{* $Id: edit.tpl,v 1.8 2009/06/30 19:01:51 Criss Exp $ *}
     2{if isset($comment_editor.USERS)}
    33<script type="text/javascript">
    44function toggleDisabled(aToggle, aList1, aList2) {ldelim}
     
    1414  <div class="titrePage">
    1515    <ul class="categoryActions">
    16       <li><a href="{$U_HOME}" title="{'return to homepage'|@translate}"><img src="{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/></a></li>
     16      <li><a href="{$ce_exit.URL}" title="{$ce_exit.TITLE|@translate}"><img src="{$themeconf.icon_dir}/{$ce_exit.IMG}" class="button" alt="{$ce_exit.ALT|@translate}"/></a></li>
    1717    </ul>
    18   <h2>{'comment_edit'|@translate}</h2>
     18  <h2>{'ce_edit'|@translate}</h2>
    1919  </div>
    2020  <div id="ce-comments">
    21     <form  method="post" action="{$comment.F_ACTION}" class="filter" id="editComment">
     21    <form  method="post" action="{$comment_editor.F_ACTION}" class="filter" id="editComment">
    2222    <table>
    2323    <tr>
    24       <td>{'comment_author'|@translate}</td>
    25       {if $comment.DISABLED}
    26       <td colspan="3">
    27         <input type="text" name="ce_author" disabled="disabled" value="{$comment.AUTHOR}">
    28       {else}
     24      <td>{'ce_author'|@translate}</td>
     25      {if isset($comment_editor.USERS)}
    2926      <td>
    30         {html_options name=ce_author id=ce_authorlist options=$comment.USERS selected=$comment.AUTHOR}
     27        {html_options name=ce_author id=ce_authorlist options=$comment_editor.USERS selected=$comment_editor.AUTHOR}
    3128      </td>
    3229      <td align="right">
    33         <input type="checkbox" name="ce_freeauthorck" id="ce_freeauthorck" value="1" onchange="toggleDisabled('ce_freeauthorck', 'ce_authorlist', 'ce_freeauthorfield');" {$comment.FREEAUTHOR}> {'comment_author_free'|@translate}
     30        <input type="checkbox" name="ce_freeauthorck" id="ce_freeauthorck" value="1" onchange="toggleDisabled('ce_freeauthorck', 'ce_authorlist', 'ce_freeauthorfield');" {$comment_editor.FREEAUTHOR}> {'ce_author_free'|@translate}
    3431      </td>
    3532      <td align="right">
    36         <input type="text" name="ce_freeauthor" id="ce_freeauthorfield" value="{$comment.AUTHOR}" >
     33        <input type="text" name="ce_freeauthor" id="ce_freeauthorfield" value="{$comment_editor.AUTHOR}" >
    3734        <script type="text/javascript">toggleDisabled('ce_freeauthorck', 'ce_authorlist', 'ce_freeauthorfield');</script>
     35      {else}
     36      <td colspan="3">
     37        <input type="text" name="ce_author" disabled="disabled" value="{$comment_editor.AUTHOR}">
    3838      {/if}
    3939      </td>
    4040    </tr>
     41    {if isset($comment_editor.TOOLBAR)}
    4142    <tr>
    42       <td>{'comment_content'|@translate}</td>
     43      <td>&nbsp;</td>
     44      <td colspan="4">{$comment_editor.TOOLBAR}</td>
     45    </tr>
     46    {/if}
     47    <tr>
     48      <td>{'ce_content'|@translate}</td>
    4349      <td colspan="3">
    44         <textarea name="ce_content" id="ce_contentid" rows="5" cols="80">{$comment.CONTENT}</textarea>
     50        <textarea name="ce_content" id="ce_contentid" rows="5" cols="80">{$comment_editor.CONTENT}</textarea>
    4551      </td>
    4652    </tr>
    4753    <tr>
    4854      <td colspan="4" align="center">
    49         <input type="hidden" name="ce_imageid" value="{$comment.IMAGE}" />
    50         <input type="hidden" name="ce_commentid" value="{$comment.KEY}" />
     55        <input type="hidden" name="ce_imageid" value="{$comment_editor.IMAGE}" />
     56        <input type="hidden" name="ce_commentid" value="{$comment_editor.KEY}" />
    5157        <input class="submit" type="submit" value="{'Submit'|@translate}">
    5258      </td>
  • extensions/CommentEditor/template/message.tpl

    r3462 r3475  
    1 {* $Id: message.tpl,v 1.6 2009/06/26 09:17:01 Criss Exp $ *}
     1{* $Id: message.tpl,v 1.7 2009/06/30 19:01:51 Criss Exp $ *}
    22<div class="content" id="ce-message-block">
    33  <div class="titrePage">
    44    <ul class="categoryActions">
    5       <li><a href="{$U_HOME}" title="{'return to homepage'|@translate}"><img src="{$themeconf.icon_dir}/home.png" class="button" alt="{'home'|@translate}"/></a></li>
     5      <li><a href="{$ce_exit.URL}" title="{$ce_exit.TITLE|@translate}"><img src="{$themeconf.icon_dir}/{$ce_exit.IMG}" class="button" alt="{$ce_exit.ALT|@translate}"/></a></li>
    66    </ul>
    7     <h2 id="ce-message-header">{'CommentEditor'|@translate} - {$message.TITLE}</h2>
     7    <h2 id="ce-message-header">{'CommentEditor'|@translate} - {$ce_message.TITLE}</h2>
    88  </div>
    9   <div class="ce-message-{$message.TYPE}">
     9  <div class="ce-message-{$ce_message.TYPE}">
    1010    <div class="ce-message-img">
    11       <img src="{$message.IMG}" alt="{$message.TITLE}" title="{$message.TITLE}" class="button">
     11      <img src="{$ce_message.IMG}" alt="{$ce_message.TITLE}" title="{$ce_message.TITLE}" class="button">
    1212    </div>
    1313    <div class="ce-message-list">
    1414      <ul class="ce-message-list">
    15         {foreach from=$message.MSG item=msg}
     15        {foreach from=$ce_message.MSG item=msg}
    1616        <li>{$msg}</li>
    1717        {/foreach}
Note: See TracChangeset for help on using the changeset viewer.