Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Commit

Permalink
Remove use of deprecated API.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnsl committed Nov 4, 2012
1 parent cf6c6a0 commit 121ec0b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Expand Up @@ -9,6 +9,7 @@
defined('_JEXEC') or die;

jimport('joomla.form.formfield');
jimport('joomla.filesystem.folder');

class JFormFieldEmoticons extends JFormField
{
Expand Down Expand Up @@ -87,7 +88,7 @@ protected function getOptions()
$name = pathinfo($file);
$name = preg_replace('/'.preg_quote('.'.$name['extension']).'$/', '', $name['filename']);
$file = preg_replace('/^'.preg_quote(JPATH_ROOT.'/', '/').'/i', '', $file);
$file = str_replace(DS, '/', $file);
$file = str_replace(DIRECTORY_SEPARATOR, '/', $file);
$options[] = JHtml::_('select.option', $file, $name);
}
}
Expand Down
Expand Up @@ -10,14 +10,14 @@

require_once JPATH_SITE.'/components/com_content/helpers/route.php';
require_once JPATH_COMPONENT.'/helpers/comments.php';
JHtml::_('core');

JHtml::_('behavior.framework', true);
JHtml::_('behavior.tooltip');
JHtml::_('script', 'slicomments/comments_admin.js', true, true);
JHtml::_('script', 'slicomments/DynamicTextarea.js', true, true);
JHtml::_('stylesheet', 'slicomments/admin.css', array(), true);
$user = JFactory::getUser();
$token = '&'.JUtility::getToken().'=1';
$token = '&'.JSession::getFormToken().'=1';
$listOrder = $this->state->get('list.ordering');
$listDirn = $this->state->get('list.direction');
?>
Expand Down
2 changes: 1 addition & 1 deletion components/com_slicomments/controllers/comments.php
Expand Up @@ -86,7 +86,7 @@ public function getModel($name = '', $prefix = '', $config = array())
static $model;
if ($model == null)
{
$model = JModel::getInstance('Comments', 'sliCommentsModel');
$model = $this->createModel('Comments', 'sliCommentsModel');
// Task is a reserved state
$model->setState('task', $this->task);

Expand Down
2 changes: 1 addition & 1 deletion components/com_slicomments/models/comments.php
Expand Up @@ -33,7 +33,7 @@ public function filter($data)
$filter['raw'] = $data['text'];
$filter['text'] = $this->_parse($this->censureWords($data['text']));
$filter['article_id'] = (int)$data['article_id'];
$filter['created'] = JFactory::getDate()->toMysql();
$filter['created'] = JFactory::getDate()->toSql();
$filter['status'] = (int) $data['status'];

return $filter;
Expand Down
Expand Up @@ -10,6 +10,7 @@

$user = JFactory::getUser();
$rating = $likes - $dislikes;
$token = '&'.JSession::getFormToken().'=1';
?>
<li id="comment-<?php echo $id;?>" class="comment">
<div class="comment-body">
Expand All @@ -21,19 +22,19 @@
<div class="content-container">
<ul class="comments-actions">
<?php if ($this->params->get('ratings', true) && $user->authorise('vote', 'com_slicomments')) : ?>
<li><a class="comment-like" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.vote&v=1&id='.$id.'&'.JUtility::getToken().'=1'); ?>"><?php echo JText::_('COM_COMMENTS_ACTION_LIKE'); ?></a></li>
<li><a class="comment-dislike" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.vote&v=0&id='.$id.'&'.JUtility::getToken().'=1'); ?>"><?php echo JText::_('COM_COMMENTS_ACTION_DISLIKE'); ?></a></li>
<li><a class="comment-like" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.vote&v=1&id='.$id.$token); ?>"><?php echo JText::_('COM_COMMENTS_ACTION_LIKE'); ?></a></li>
<li><a class="comment-dislike" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.vote&v=0&id='.$id.$token); ?>"><?php echo JText::_('COM_COMMENTS_ACTION_DISLIKE'); ?></a></li>
<?php endif; ?>
<?php if ($user->authorise('delete', 'com_slicomments') || ($user->authorise('delete.own', 'com_slicomments') && $user_id == $user->id)): ?>
<li><a class="comment-delete" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.delete&id='.$id.'&'.JUtility::getToken().'=1'); ?>" data-id="<?php echo $id; ?>">
<li><a class="comment-delete" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.delete&id='.$id.$token); ?>" data-id="<?php echo $id; ?>">
<?php echo JText::_('COM_COMMENTS_ACTION_DELETE'); ?></a></li>
<?php endif; ?>
<?php if ($user->authorise('flag', 'com_slicomments')): ?>
<li><a class="comment-flag" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.flag&id='.$id.'&'.JUtility::getToken().'=1'); ?>" data-id="<?php echo $id; ?>" title="<?php echo JText::_('COM_COMMENTS_ACTION_FLAG_TITLE'); ?>">
<li><a class="comment-flag" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.flag&id='.$id.$token); ?>" data-id="<?php echo $id; ?>" title="<?php echo JText::_('COM_COMMENTS_ACTION_FLAG_TITLE'); ?>">
<?php echo JText::_('COM_COMMENTS_ACTION_FLAG'); ?></a></li>
<?php endif; ?>
<?php if ($user->authorise('post', 'com_slicomments') && ($user_id == 0 || $user_id != $user->id) && $this->params->get('enabled', true)): ?>
<li><a class="comment-reply" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.reply&name='.$this->escape($name).'&'.JUtility::getToken().'=1'); ?>">
<li><a class="comment-reply" href="<?php echo JRoute::_('index.php?option=com_slicomments&task=comments.reply&name='.$this->escape($name).$token); ?>">
<?php echo JText::_('COM_COMMENTS_ACTION_REPLY'); ?></a></li>
<?php endif; ?>
</ul>
Expand Down

0 comments on commit 121ec0b

Please sign in to comment.