- md5
- b7d0d18bc9d63d78c1edb8676a166826
- sha1
- 6bd45a792dea466b7c59d843659e2f44035455d0
- sha256
- ccd9c57079d8f3843b8b60153a055e590f9793678796e12abc6556d87b0b68e2
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
<?php
/**
* @version $Id: image.php 20240 2011-01-10 05:46:24Z dextercowley $
* @package Joomla
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// no direct access
defined('_JEXEC') or die;
jimport('joomla.plugin.plugin');
/**
* Editor Image buton
*
* @package Editors-xtd
* @since 1.5
*/
class plgButtonImage extends JPlugin
{
/**
* Constructor
*
* @access protected
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
* @since 1.5
*/
public function __construct(& $subject, $config)
{
parent::__construct($subject, $config);
$this->loadLanguage();
}
/**
* Display the button
*
* @return array A two element array of (imageName, textToInsert)
*/
function onDisplay($name, $asset, $author)
{
$app = JFactory::getApplication();
$params = JComponentHelper::getParams('com_media');
$user = JFactory::getUser();
if ( $user->authorise('core.edit', $asset)
|| $user->authorise('core.create', $asset)
|| ($user->authorise('core.edit.own', $asset) && $author==$user->id))
{
$link = 'index.php?option=com_media&view=images&tmpl=component&e_name=' . $name . '&asset=' . $asset . '&author=' . $author;
JHtml::_('behavior.modal');
$button = new JObject;
$button->set('modal', true);
$button->set('link', $link);
$button->set('text', JText::_('PLG_IMAGE_BUTTON_IMAGE'));
$button->set('name', 'image');
$button->set('options', "{handler: 'iframe', size: {x: 800, y: 500}}");
return $button;
}
else
{
return false;
}
}
}
No other release has this exact content. See every version of this file.