添加到 trunk

+YUCHENG HU+

git-svn-id: https://svn.code.sf.net/p/hawebs/svn@331 a2543c7e-f6e9-4f8a-8bff-1ffc34733512
This commit is contained in:
YuCheng Hu
2010-06-13 23:26:01 +00:00
parent a0deeecd0b
commit c11186ebd3
30 changed files with 3518 additions and 0 deletions
@@ -0,0 +1,131 @@
<?php
/**
* @version $Id: editor.php 119 2009-06-23 12:10:07Z happynoodleboy $
* @package JCE Admin Component
* @copyright Copyright (C) 2006 - 2009 Ryan Demmmer. All rights reserved.
* @license GNU/GPL
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
// no direct access
defined('_JEXEC') or die ('Restricted access');
class JContentEditorBridge extends JObject
{
var $plugins;
/**
* Constructor activating the default information of the class
*
* @access protected
*/
function __construct($config = array ())
{
if ($this->plugins) {
return $this->plugins;
}
$db = & JFactory::getDBO();
$query = 'SELECT name'
.' FROM #__jce_plugins'
.' WHERE type = '.$db->Quote('plugin');
$db->setQuery($query);
$this->plugins = $db->loadResultArray();
}
/**
* Returns a reference to a editor object
*
* This method must be invoked as:
* <pre> $bridge = &JContentEditorBridge::getInstance();</pre>
*
* @access public
* @return The bridge object.
* @since 1.5.7
*/
function & getInstance()
{
static $instance;
if (!is_object($instance)) {
$instance = new JContentEditorBridge();
}
return $instance;
}
/**
* Returns $plugins.
* @see JContentEditorBridge::$plugins
*/
function getPlugins()
{
return $this->plugins;
}
/**
* Sets $plugins.
* @param array $plugins
* @see JContentEditorBridge::$plugins
*/
function setPlugins($plugins)
{
$this->plugins = $plugins;
}
/**
* Check a plugin against the static list
* @return boolan
* @param string $plugin
*/
function checkPlugin($plugin)
{
return in_array($plugin, $this->getPlugins());
}
/**
* Load Plugin files
*/
function load()
{
$task = JRequest::getCmd('task');
if ($task) {
switch($task) {
case 'plugin':
$plugin = JRequest::getVar('plugin', 'cmd');
if ($this->checkPlugin($plugin)) {
$file = basename(JRequest::getVar('file', 'cmd'));
$path = JCE_PLUGINS.DS.$plugin;
if (is_dir($path) && file_exists($path.DS.$file.'.php')) {
include_once $path.DS.$file.'.php';
} else {
JError::raiseError(500, JText::_('File '.$file.' not found!'));
}
} else {
JError::raiseError(500, JText::_('Plugin not found!'));
}
exit ();
break;
case 'help':
$plugin = JRequest::getVar('plugin', 'cmd');
if ($this->checkPlugin($plugin)) {
jimport('joomla.application.component.view');
$help = new JView($config = array (
'base_path'=>JCE_LIBRARIES,
'layout'=>'help'
));
$help->display();
} else {
JError::raiseError(500, JText::_('Plugin not found!'));
}
exit ();
break;
}
} else{
JError::raiseError(500, JText::_('No Task'));
}
}
}
$bridge = & JContentEditorBridge::getInstance();
$bridge->load();
?>
@@ -0,0 +1,120 @@
<?php
/**
* @version $Id: helper.php 75 2009-06-04 14:00:32Z happynoodleboy $
* @package JCE Admin Component
* @copyright Copyright (C) 2006 - 2009 Ryan Demmmer. All rights reserved.
* @license GNU/GPL
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
class JCEHelper
{
function getOrderArray($input, $listname, $itemKeyName = 'element', $orderKeyName = 'order')
{
parse_str($input, $inputArray);
$inputArray = $inputArray[$listname];
$orderArray = array();
for ($i=0; $i<count($inputArray); $i++) {
$orderArray[] = array($itemKeyName => $inputArray[$i], $orderKeyName => $i +1);
}
return $orderArray;
}
function getAccessName($id)
{
$db =& JFactory::getDBO();
// get list of Groups for dropdown filter
$query = 'SELECT name'
. ' FROM #__core_acl_aro_groups'
. ' WHERE id = '. $id
. ' AND name != "ROOT"'
. ' AND name != "USERS"'
;
$db->setQuery($query);
return $db->loadResult();
}
function accessList($name, $access = '', $size = 1, $extra)
{
$db =& JFactory::getDBO();
// get list of Groups for dropdown filter
$query = 'SELECT id AS value, name AS text'
. ' FROM #__core_acl_aro_groups'
. ' WHERE id NOT IN (28,29,30)'
;
$db->setQuery($query);
$types[] = JHTML::_('select.option', '0', '- '. JText::_('Select Access') .' -');
$i = '-';
foreach ($db->loadObjectList() as $obj) {
$types[] = JHTML::_('select.option', $obj->value, $i . JText::_($obj->text));
$i .= '-';
}
return JHTML::_('select.genericlist', $types, $name, 'class="inputbox" size="'. $size .'"'. $extra, 'value', 'text', $access);
}
function quickiconButton($link, $image, $text, $disabled = false)
{
global $mainframe;
$lang =& JFactory::getLanguage();
$template = $mainframe->getTemplate();
if ($disabled) {
$link = '#';
}
?>
<div style="float:<?php echo ($lang->isRTL()) ? 'right' : 'left'; ?>;">
<div class="icon">
<a href="<?php echo $link; ?>">
<?php echo JHTML::_('image.site', $image, '/templates/'. $template .'/images/header/', NULL, NULL, $text); ?>
<span><?php echo $text; ?></span>
</a>
</div>
</div>
<?php
}
function getLanguage()
{
$language =& JFactory::getLanguage();
$tag = $language->getTag();
if (file_exists(JPATH_SITE .DS. 'language' .DS. $tag .DS. $tag .'.com_jce.xml')) {
return substr($tag, 0, strpos($tag, '-'));
}
return 'en';
}
}
class jceToolbarHelper extends JToolbarHelper
{
function access($alt = 'Plugin Access')
{
$bar = & JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'lock', $alt, "index.php?option=com_jce&tmpl=component&type=plugin&task=access_popup", 400, 150);
}
function popup($alt, $icon, $type, $task, $width = 750, $height = 400)
{
$bar = & JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', $icon, $alt, "index.php?option=com_jce&tmpl=component&type=".$type."&task=".$task, $width, $height);
}
function config($alt = 'Editor Config')
{
$bar = & JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'config', $alt, "index.php?option=com_jce&tmpl=component&type=config&task=view", 700, 560);
}
function help($type, $alt = 'Help')
{
jimport('joomla.plugin.helper');
$plugin = JPluginHelper::getPlugin('editors', 'jce');
$url = 'http://www.joomlacontenteditor.net/index.php?option=com_content&tmpl=component&view=article&task=findkey';
if (isset($plugin->params)) {
$params = new JParameter($plugin->params);
$url = $params->get('help', $url);
}
if(strpos($type, '.') === false){
$type = $type . '.view';
}
$type = $type[0];
$bar = & JToolBar::getInstance('toolbar');
$bar->appendButton('Popup', 'help', $alt, $url. '&lang=' .JCEHelper::getLanguage(). '&keyref=admin.' .$type, 700, 560);
}
}
?>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,229 @@
<?php
/**
* @version $Id: install.php 115 2009-06-23 11:31:41Z happynoodleboy $
* @package JCE Admin Component
* @copyright Copyright (C) 2006 - 2009 Ryan Demmmer. All rights reserved.
* @license GNU/GPL
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
defined('_JEXEC') or die ('Restricted access');
/**
* Installer function
* @return
*/
function com_install()
{
global $mainframe;
$db = & JFactory::getDBO();
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$path = JPATH_ADMINISTRATOR.DS.'components'.DS.'com_jce';
// Remove legacy file
if (file_exists($path.DS.'admin.jce.php')) {
@JFile::delete($path.DS.'admin.jce.php');
}
// Load updater class
require_once ($path.DS.'updater.php');
$updater = & JCEUpdater::getInstance();
// Install Plugins data
$updater->installPlugins(true);
// Install Groups data
$updater->installGroups(true);
// Install editor plugin
jimport('joomla.installer.installer');
$installer = & JInstaller::getInstance();
$source = $installer->getPath('source');
$packages = $source.DS.'packages';
// Get editor and plugin packages
if(is_dir($packages)) {
$editor = JFolder::files($packages, 'plg_jce_15\d+?\.zip', false, true);
$plugins = JFolder::files($packages, 'jce_\w+_15\d+?\.zip', false, true);
}
$language = & JFactory::getLanguage();
$language->load('com_jce', JPATH_ADMINISTRATOR);
$img_path = JURI::root().'/administrator/components/com_jce/img/';
$out = '<table class="adminlist" style="width:50%;">';
$out .= '<tr><th class="title" style="width:65%">'.JText::_('Extension').'</th><th class="title" style="width:30%">'.JText::_('Version').'</th><th class="title" style="width:5%">&nbsp;</th></tr>';
$editor_img = 'delete.png';
$editor_result = JText::_('Error');
$plugin_out = '';
if (! empty($editor)) {
if (is_file($editor[0])) {
$config = & JFactory::getConfig();
$tmp = $config->getValue('config.tmp_path').DS.uniqid('install_').DS.basename($editor[0], '.zip');
if (!JArchive::extract($editor[0], $tmp)) {
$mainframe->enqueueMessage(JText::_('EDITOR EXTRACT ERROR'), 'error');
} else {
$query = 'SELECT id, params'
.' FROM #__components'
.' WHERE link = '.$db->Quote('option=com_jce')
;
$db->setQuery($query);
$component = $db->loadObject();
$params = explode("\n", $component->params);
$installer = & JInstaller::getInstance();
$c_manifest = & $installer->getManifest();
$c_root = & $c_manifest->document;
$version = & $c_root->getElementByPath('version');
$component_version = $version->data();
// Store Component values
$component_paths = array (
'source'=>$installer->getPath('source'),
'manifest'=>$installer->getPath('manifest'),
'extension_site'=>$installer->getPath('extension_site'),
'extension_administrator'=>$installer->getPath('extension_administrator')
);
$component_vars = array (
'name'=>$installer->get('name'),
'result'=>$installer->get('result'),
'message'=>$installer->message
);
$editor_version = preg_replace('/\D+/', '', basename($editor[0]));
// Add JTable include path
JTable::addIncludePath(JPATH_LIBRARIES.DS.'joomla'.DS.'database'.DS.'table');
// Editor Plugin installed proceed with plugins
if ($installer->install($tmp)) {
$manifest = & $installer->getManifest();
$root = & $manifest->document;
$name = & $root->getElementByPath('name');
$version = & $root->getElementByPath('version');
$editor_version = $version->data();
$language->load('plg_editors_jce', JPATH_ADMINISTRATOR);
$editor_img = 'tick.png';
$editor_result = JText::_('Success');
$query = 'UPDATE #__plugins'
. ' SET name = '.$db->Quote($name->data())
. ' WHERE folder = '.$db->Quote('editors')
. ' AND element = '.$db->Quote('jce')
;
$db->setQuery($query);
$db->query();
$params[] = 'package=1';
// Include installer class
if (! empty($plugins)) {
require_once ($path.DS.'installer'.DS.'installer.php');
$jce_installer = & JCEInstaller::getInstance();
$plugin_out = '<tr><th class="title" style="width:65%">'.JText::_('Plugin').'</th><th class="title" style="width:30%">'.JText::_('Version').'</th><th class="title" style="width:5%">&nbsp;</th></tr>';
foreach ($plugins as $plugin) {
// Create unique tmp dir name
$tmp = $config->getValue('config.tmp_path').DS.uniqid('install_').DS.basename($plugin, '.zip');
// Extract to tmp dir
if (JArchive::extract($plugin, $tmp)) {
// Install plugin
if (!$jce_installer->install($tmp)) {
$plugin_img = 'delete.png';
$plugin_result = JText::_('Error');
$plugin_name = basename($plugin);
} else {
$manifest = & $jce_installer->getManifest();
$root = & $manifest->document;
$name = & $root->getElementByPath('name');
$language->load('com_jce_'.trim($root->attributes('plugin')));
$plugin_img = 'tick.png';
$plugin_result = JText::_('Success');
$plugin_name = $name->data();
}
$plugin_out .= '<tr><td>'.$plugin_name.'</td><td>'.preg_replace('/\D+/', '', basename($plugin)).'</td><td style="text-align:center;">'.JHTML::image($img_path.$plugin_img, $plugin_result).'</td></tr>';
if ($jce_installer->get('extension.message')) {
$plugin_out .= '<tr><td colspan="3">'.JText::_($jce_installer->get('extension.message')).'</td></tr>';
}
// Cleanup
if (is_dir($tmp)) {
@JFolder::delete($tmp);
}
}
}
}
} else {
$editor_img = 'delete.png';
$editor_result = JText::_('Error');
$params[] = 'package=0';
}
$editor_message = JText::_($installer->message);
// Return Component Paths
foreach ($component_paths as $k=>$v) {
$installer->setPath($k, $v);
}
// Return Component Vars
foreach ($component_vars as $k=>$v) {
$installer->set($k, $v);
}
if (is_dir($tmp)) {
@JFolder::delete($tmp);
}
$manifest = & $installer->getManifest();
$root = & $manifest->document;
$version = & $root->getElementByPath('version');
$out .= '<tr><td>'.JText::_('JCE ADMIN TITLE').'</td><td>'.$component_version.'</td><td class="title" style="text-align:center;">'.JHTML::image($img_path.'tick.png', JText::_('Success')).'</td></tr>';
$out .= '<tr><td colspan="3">'.JText::_($installer->message).'</td></tr>';
$out .= '<tr><td>'.JText::_('JCE EDITOR TITLE').'</td><td>'.$editor_version.'</td><td class="title" style="text-align:center;">'.JHTML::image($img_path.$editor_img, $editor_result).'</td></tr>';
$out .= '<tr><td colspan="3">'.$editor_message.'</td></tr>';
$out .= $plugin_out;
$out .= '</table>';
$installer->set('message', JText::_('JCE INSTALL SUMMARY'));
$installer->set('extension.message', $out);
$row = & JTable::getInstance('component');
$row->load($component->id);
$row->params = implode("\n", $params);
$row->store();
}
}
}
if (is_dir($packages)) {
// Delete packages folder
@JFolder::delete($packages);
}
}
/**
* Uninstall function
* @return
*/
function com_uninstall()
{
require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_jce'.DS.'updater.php');
$updater = & JCEUpdater::getInstance();
$updater->cleanupDB();
$params = & JComponentHelper::getParams('com_jce');
if ($params->get('package')) {
$updater->removeEditor();
}
}
?>
@@ -0,0 +1,163 @@
<?php
/**
* @version $Id: jce.php 105 2009-06-21 19:22:32Z happynoodleboy $
* @package JCE Admin Component
* @subpackage Plugins
* @copyright Copyright (C) 2006 - 2009 Ryan Demmer. All rights reserved.
* @license GNU/GPL
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
$task = JRequest::getCmd('task');
define('JCE_PATH', JPATH_PLUGINS .DS. 'editors' .DS. 'jce');
define('JCE_PLUGINS', JCE_PATH .DS. 'tiny_mce' .DS. 'plugins');
define('JCE_LIBRARIES', JCE_PATH .DS. 'libraries');
define('JCE_CLASSES', JCE_LIBRARIES .DS. 'classes');
/*
* Editor or plugin request.
*/
if ($task == 'plugin' || $task == 'help') {
require_once(dirname(__FILE__) .DS. 'editor.php');
exit();
}
// Authorize
$user =& JFactory::getUser();
$acl =& JFactory::getACL();
$tasks = array(
// Admin
'repair', 'purge',
// Installer
'install', 'remove', 'manage',
// Standard
'view', 'edit', 'save', 'apply', 'publish', 'unpublish', 'cancel', 'cancelEdit', 'orderup', 'orderdown', 'saveorder',
// Plugins
'add',
// Groups
'copy', 'legend', 'addusers', 'removeusers',
// Cpanel
''
);
foreach ($tasks as $auth) {
$acl->addACL('com_jce', $auth, 'users', 'super administrator');
$acl->addACL('com_jce', $auth, 'users', 'administrator');
$acl->addACL('com_jce', $auth, 'users', 'manager');
}
if (!$user->authorize('com_jce', $task)) {
$mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
// Variables
$type = JRequest::getCmd('type');
// Load Helper class
require_once(dirname(__FILE__) .DS. 'helper.php');
// Load Updater class
require_once(dirname(__FILE__) .DS. 'updater.php');
// Create updater instance
$updater =& JCEUpdater::getInstance();
// Repair / Purge
switch ($task) {
case 'repair':
switch ($type) {
case 'editor':
$updater->installEditor();
break;
case 'plugins':
$updater->updatePlugins();
break;
case 'groups':
$updater->updateGroups();
break;
case 'update':
$updater->updateDB();
break;
}
break;
case 'purge':
$updater->purgeDB();
break;
}
// Check Updater
$updater->initCheck();
$client = JRequest::getWord('client', 'site');
$cid = JRequest::getVar('cid', array(0), 'post', 'array');
JArrayHelper::toInteger($cid, array(0));
$type = JRequest::getCmd('type');
$task = JRequest::getCmd('task');
switch ($type) {
case 'plugin':
switch ($task) {
case 'install':
case 'remove':
case 'manage':
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'installer.php');
break;
case 'view':
default:
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'plugin.php');
break;
}
break;
case 'group':
switch ($task) {
case 'view':
default:
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'groups.php');
break;
}
break;
case 'language':
switch ($task) {
case 'install':
case 'remove':
case 'manage':
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'installer.php');
break;
default:
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'cpanel.php');
break;
}
break;
case 'extension':
switch ($task) {
case 'install':
case 'remove':
case 'manage':
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'installer.php');
break;
default:
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'plugin.php');
break;
}
break;
case 'config':
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'config.php');
break;
case 'install':
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'installer.php');
break;
default:
switch ($task) {
case 'install':
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'installer.php');
break;
default:
require_once(dirname(__FILE__) .DS. 'controller' .DS. 'cpanel.php');
break;
}
break;
}
?>
@@ -0,0 +1,181 @@
<install type="component" version="1.5.0" method="upgrade">
<name>JCE</name>
<author>Ryan Demmer</author>
<creationDate>14 November 2009</creationDate>
<copyright>(C) 2005 - 2009 Ryan Demmer. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
<authorEmail>[email protected]</authorEmail>
<authorUrl>www.joomlacontenteditor.net</authorUrl>
<version>1.5.7</version>
<description>JCE ADMIN DESC</description>
<installfile>install.php</installfile>
<uninstallfile>install.php</uninstallfile>
<files folder="components/com_jce">
<file>css/index.html</file>
<file>css/popup.css</file>
<file>index.html</file>
<file>jce.php</file>
<file>js/index.html</file>
<file>js/popup.js</file>
<file>popup.php</file>
</files>
<languages folder="language/en-GB">
<language tag="en-GB">en-GB.com_jce.ini</language>
<language tag="en-GB">en-GB.com_jce.xml</language>
<language tag="en-GB">en-GB.com_jce_advlink.ini</language>
<language tag="en-GB">en-GB.com_jce_browser.ini</language>
<language tag="en-GB">en-GB.com_jce_imgmanager.ini</language>
<language tag="en-GB">en-GB.com_jce_media.ini</language>
<language tag="en-GB">en-GB.com_jce_paste.ini</language>
<language tag="en-GB">en-GB.com_jce_spellchecker.ini</language>
</languages>
<languages folder="language/en-GB">
<language tag="en-GB">en-GB.com_jce.ini</language>
<language tag="en-GB">en-GB.com_jce.xml</language>
<language tag="en-GB">en-GB.com_jce_advlink.ini</language>
<language tag="en-GB">en-GB.com_jce_browser.ini</language>
<language tag="en-GB">en-GB.com_jce_imgmanager.ini</language>
<language tag="en-GB">en-GB.com_jce_media.ini</language>
<language tag="en-GB">en-GB.com_jce_paste.ini</language>
<language tag="en-GB">en-GB.com_jce_spellchecker.ini</language>
</languages>
<administration>
<menu img="components/com_jce/img/logo.png" link="option=com_jce">JCE</menu>
<submenu>
<menu img="templates/khepri/images/menu/icon-16-cpanel.png" link="option=com_jce">JCE MENU CPANEL</menu>
<menu img="templates/khepri/images/menu/icon-16-config.png" link="option=com_jce&amp;type=config">JCE MENU CONFIG</menu>
<menu img="templates/khepri/images/menu/icon-16-user.png" link="option=com_jce&amp;type=group">JCE MENU GROUPS</menu>
<menu img="templates/khepri/images/menu/icon-16-plugin.png" link="option=com_jce&amp;type=plugin">JCE MENU PLUGINS</menu>
<menu img="templates/khepri/images/menu/icon-16-install.png" link="option=com_jce&amp;type=install">JCE MENU INSTALL</menu>
</submenu>
<files folder="administrator/components/com_jce">
<file>config/controller.php</file>
<file>config/index.html</file>
<file>config/views/config/index.html</file>
<file>config/views/config/tmpl/default.php</file>
<file>config/views/config/tmpl/index.html</file>
<file>config/views/config/view.html.php</file>
<file>config/views/index.html</file>
<file>controller/config.php</file>
<file>controller/cpanel.php</file>
<file>controller/groups.php</file>
<file>controller/index.html</file>
<file>controller/installer.php</file>
<file>controller/plugin.php</file>
<file>cpanel/controller.php</file>
<file>cpanel/index.html</file>
<file>cpanel/views/cpanel/index.html</file>
<file>cpanel/views/cpanel/tmpl/default.php</file>
<file>cpanel/views/cpanel/tmpl/index.html</file>
<file>cpanel/views/cpanel/view.html.php</file>
<file>cpanel/views/index.html</file>
<file>css/icons.css</file>
<file>css/index.html</file>
<file>css/layout.css</file>
<file>css/styles.css</file>
<file>editor.php</file>
<file>elements/uploadsize.php</file>
<file>groups/controller.php</file>
<file>groups/groups.php</file>
<file>groups/helper.php</file>
<file>groups/index.html</file>
<file>groups/views/group/index.html</file>
<file>groups/views/group/tmpl/form.php</file>
<file>groups/views/group/tmpl/index.html</file>
<file>groups/views/group/view.html.php</file>
<file>groups/views/groups/index.html</file>
<file>groups/views/groups/tmpl/default.php</file>
<file>groups/views/groups/tmpl/index.html</file>
<file>groups/views/groups/view.html.php</file>
<file>groups/views/index.html</file>
<file>groups/views/legend/index.html</file>
<file>groups/views/legend/tmpl/default.php</file>
<file>groups/views/legend/tmpl/index.html</file>
<file>groups/views/legend/view.html.php</file>
<file>groups/views/users/index.html</file>
<file>groups/views/users/tmpl/default.php</file>
<file>groups/views/users/tmpl/index.html</file>
<file>groups/views/users/view.html.php</file>
<file>helper.php</file>
<file>img/add.png</file>
<file>img/delete.png</file>
<file>img/icons.png</file>
<file>img/index.html</file>
<file>img/logo.png</file>
<file>img/tick.png</file>
<file>img/toolbar/icon-32-lock.png</file>
<file>img/toolbar/icon-32-refresh.png</file>
<file>img/toolbar/index.html</file>
<file>index.html</file>
<file>install.php</file>
<file>installer/adapters/extension.php</file>
<file>installer/adapters/index.html</file>
<file>installer/adapters/language.php</file>
<file>installer/adapters/plugin.php</file>
<file>installer/controller.php</file>
<file>installer/index.html</file>
<file>installer/installer.php</file>
<file>installer/models/extension.php</file>
<file>installer/models/extensions.php</file>
<file>installer/models/index.html</file>
<file>installer/models/install.php</file>
<file>installer/models/language.php</file>
<file>installer/models/plugin.php</file>
<file>installer/views/default/index.html</file>
<file>installer/views/default/tmpl/default_ftp.php</file>
<file>installer/views/default/tmpl/default_message.php</file>
<file>installer/views/default/tmpl/index.html</file>
<file>installer/views/default/view.php</file>
<file>installer/views/extension/index.html</file>
<file>installer/views/extension/tmpl/default.php</file>
<file>installer/views/extension/tmpl/default_item.php</file>
<file>installer/views/extension/tmpl/index.html</file>
<file>installer/views/extension/view.php</file>
<file>installer/views/index.html</file>
<file>installer/views/install/index.html</file>
<file>installer/views/install/tmpl/default.php</file>
<file>installer/views/install/tmpl/default_form.php</file>
<file>installer/views/install/tmpl/index.html</file>
<file>installer/views/install/view.php</file>
<file>installer/views/language/index.html</file>
<file>installer/views/language/tmpl/default.php</file>
<file>installer/views/language/tmpl/default_item.php</file>
<file>installer/views/language/tmpl/index.html</file>
<file>installer/views/language/view.php</file>
<file>installer/views/plugin/index.html</file>
<file>installer/views/plugin/tmpl/default.php</file>
<file>installer/views/plugin/tmpl/default_item.php</file>
<file>installer/views/plugin/tmpl/index.html</file>
<file>installer/views/plugin/view.php</file>
<file>jce.php</file>
<file>js/index.html</file>
<file>js/sortables.js</file>
<file>plugins/controller.php</file>
<file>plugins/extension.php</file>
<file>plugins/index.html</file>
<file>plugins/plugin.php</file>
<file>plugins/views/access/index.html</file>
<file>plugins/views/access/tmpl/default.php</file>
<file>plugins/views/access/tmpl/index.html</file>
<file>plugins/views/access/view.html.php</file>
<file>plugins/views/index.html</file>
<file>plugins/views/layout/index.html</file>
<file>plugins/views/layout/tmpl/default.php</file>
<file>plugins/views/layout/tmpl/index.html</file>
<file>plugins/views/layout/view.html.php</file>
<file>plugins/views/plugin/index.html</file>
<file>plugins/views/plugin/tmpl/form.php</file>
<file>plugins/views/plugin/tmpl/index.html</file>
<file>plugins/views/plugin/view.html.php</file>
<file>plugins/views/plugins/index.html</file>
<file>plugins/views/plugins/tmpl/default.php</file>
<file>plugins/views/plugins/tmpl/index.html</file>
<file>plugins/views/plugins/view.html.php</file>
<file>updater.php</file>
</files>
<languages folder="administrator/language/en-GB">
<language tag="en-GB">en-GB.com_jce.ini</language>
<language tag="en-GB">en-GB.com_jce.menu.ini</language>
</languages>
</administration>
</install>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,219 @@
<?php
/**
* @version $Id: controller.php 47 2009-05-26 18:06:30Z happynoodleboy $
* @package Joomla
* @subpackage Config
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses. See COPYRIGHT.php for copyright notices and
* details.
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
jimport( 'joomla.application.component.controller' );
/**
* Plugins Component Controller
*
* @package Joomla
* @subpackage Plugins
* @since 1.5
*/
class PluginsController extends JController
{
/**
* Custom Constructor
*/
function __construct( $default = array())
{
parent::__construct( $default );
$this->registerTask( 'apply', 'save');
$this->registerTask( 'unpublish', 'publish');
$this->registerTask( 'edit' , 'display' );
$this->registerTask( 'add' , 'display' );
$this->registerTask( 'orderup' , 'order' );
$this->registerTask( 'orderdown' , 'order' );
}
function display( )
{
switch($this->getTask())
{
case 'add' :
case 'edit' :
{
JRequest::setVar( 'hidemainmenu', 1 );
JRequest::setVar( 'layout', 'form' );
JRequest::setVar( 'view', 'plugin' );
} break;
}
parent::display();
}
function save()
{
// Check for request forgeries
JRequest::checkToken() or die( 'Invalid Token' );
$db =& JFactory::getDBO();
$row =& JTable::getInstance('plugin', 'JCETable');
$task = $this->getTask();
if (!$row->bind(JRequest::get('post'))) {
JError::raiseError(500, $row->getError() );
}
if (!$row->check()) {
JError::raiseError(500, $row->getError() );
}
if (!$row->store()) {
JError::raiseError(500, $row->getError() );
}
$row->checkin();
$row->reorder( 'type = '.$db->Quote($row->type).' AND ordering > -10000 AND ordering < 10000' );
switch ( $task )
{
case 'apply':
$msg = JText::sprintf( 'Successfully Saved changes to Plugin', $row->title );
$this->setRedirect( 'index.php?option=com_jce&type=plugin&view=plugin&task=edit&cid[]='. $row->id, $msg );
break;
case 'save':
default:
$msg = JText::sprintf( 'Successfully Saved Plugin', $row->title );
$this->setRedirect( 'index.php?option=com_jce&type=plugin', $msg );
break;
}
}
function publish( ){
// Check for request forgeries
JRequest::checkToken() or die( 'Invalid Token' );
$db =& JFactory::getDBO();
$user =& JFactory::getUser();
$cid = JRequest::getVar( 'cid', array(0), 'post', 'array' );
JArrayHelper::toInteger($cid, array(0));
$publish = ( $this->getTask() == 'publish' ? 1 : 0 );
if (count( $cid ) < 1) {
$action = $publish ? JText::_( 'publish' ) : JText::_( 'unpublish' );
JError::raiseError(500, JText::_( 'Select a plugin to '.$action ) );
}
$cids = implode( ',', $cid );
$query = 'UPDATE #__jce_plugins SET published = '.(int) $publish
. ' WHERE id IN ( '.$cids.' )'
. ' AND ( checked_out = 0 OR ( checked_out = '.(int) $user->get('id').' ))'
;
$db->setQuery( $query );
if (!$db->query()) {
JError::raiseError(500, $db->getErrorMsg() );
}
if (count( $cid ) == 1) {
$row =& JTable::getInstance('plugin', 'JCETable');
$row->checkin( $cid[0] );
}
$this->setRedirect( 'index.php?option=com_jce&type=plugin' );
}
function cancel( ){
$this->setRedirect( JRoute::_( 'index.php?option=com_jce', false ) );
}
function cancelEdit( )
{
// Check for request forgeries
JRequest::checkToken() or die( 'Invalid Token' );
$db =& JFactory::getDBO();
$row =& JTable::getInstance('plugin', 'JCETable');
$row->bind(JRequest::get('post'));
$row->checkin();
$this->setRedirect( JRoute::_( 'index.php?option=com_jce&type=plugin', false ) );
}
function order( )
{
// Check for request forgeries
JRequest::checkToken() or die( 'Invalid Token' );
$db =& JFactory::getDBO();
$cid = JRequest::getVar( 'cid', array(0), 'post', 'array' );
JArrayHelper::toInteger($cid, array(0));
$uid = $cid[0];
$inc = ( $this->getTask() == 'orderup' ? -1 : 1 );
$row =& JTable::getInstance('plugin', 'JCETable');
$row->load( $uid );
$row->move( $inc, 'name='.$db->Quote($row->name).' AND ordering > -10000 AND ordering < 10000' );
$this->setRedirect( 'index.php?option=com_jce&type=plugin' );
}
function saveorder( )
{
// Check for request forgeries
JRequest::checkToken() or die( 'Invalid Token' );
$cid = JRequest::getVar( 'cid', array(0), 'post', 'array' );
JArrayHelper::toInteger($cid, array(0));
$db =& JFactory::getDBO();
$total = count( $cid );
$order = JRequest::getVar( 'order', array(0), 'post', 'array' );
JArrayHelper::toInteger($order, array(0));
$cid = JRequest::getVar( 'cid', array(0), 'post', 'array' );
JArrayHelper::toInteger($cid, array(0));
$row =& JTable::getInstance('plugin', 'JCETable');
$conditions = array();
// update ordering values
for ( $i=0; $i < $total; $i++ )
{
$row->load( (int) $cid[$i] );
if ($row->ordering != $order[$i])
{
$row->ordering = $order[$i];
if (!$row->store()) {
JError::raiseError(500, $db->getErrorMsg() );
}
// remember to updateOrder this group
$condition = 'type = '.$db->Quote($row->type).' AND ordering > -10000 AND ordering < 10000';
$found = false;
foreach ( $conditions as $cond )
{
if ($cond[1]==$condition) {
$found = true;
break;
}
}
if (!$found) $conditions[] = array($row->id, $condition);
}
}
// execute updateOrder for each group
foreach ( $conditions as $cond ) {
$row->load( $cond[0] );
$row->reorder( $cond[1] );
}
$msg = JText::_( 'New ordering saved' );
$this->setRedirect( 'index.php?option=com_jce&type=plugin', $msg );
}
}
@@ -0,0 +1,70 @@
<?php
/**
* @version $Id: extension.php 47 2009-05-26 18:06:30Z happynoodleboy $
* @package Joomla.Framework
* @subpackage Table
* @copyright Copyright (C) 2005 - 2007 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();
/**
* Plugin table
*
* @package Joomla.Framework
* @subpackage Table
* @since 1.0
*/
class JCETableExtension extends JTable
{
/**
* Primary Key
*
* @var int
*/
var $id = null;
/**
* @var int
*/
var $pid = null;
/**
*
*
* @var varchar
*/
var $name = null;
/**
*
*
* @var varchar
*/
var $extension = null;
/**
*
*
* @var varchar
*/
var $folder = null;
/**
*
*
* @var tinyint
*/
var $published = 1;
function __construct(& $db) {
parent::__construct('#__jce_extensions', 'id', $db);
}
}
?>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,145 @@
<?php
/**
* @version plugin.php 08/03/2009
* @package JCE.Administration
* @copyright Copyright (C) 2006 - 2009 Ryan Demmer. All rights reserved.
* @license GNU/GPL
* JCE is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
*/
// Check to ensure this file is within the rest of the framework
defined('JPATH_BASE') or die();
/**
* Plugin table
*
* @package Joomla.Framework
* @subpackage Table
* @since 1.0
*/
class JCETablePlugin extends JTable
{
/**
* Primary Key
*
* @var int
*/
var $id = null;
/**
*
*
* @var varchar
*/
var $title = null;
/**
*
*
* @var varchar
*/
var $name = null;
/**
*
*
* @var varchar
*/
var $type = 'plugin';
/**
*
*
* @var varchar
*/
var $icon = null;
/**
*
*
* @var varchar
*/
var $layout = null;
/**
*
*
* @var int
*/
var $row = 0;
/**
*
*
* @var int
*/
var $ordering = 0;
/**
*
*
* @var tinyint
*/
var $published = 1;
/**
*
*
* @var tinyint
*/
var $editable = 1;
/**
*
*
* @var tinyint
*/
var $iscore = 0;
// Legacy
var $elements = null;
/**
*
*
* @var int unsigned
*/
var $checked_out = 0;
/**
*
*
* @var datetime
*/
var $checked_out_time = 0;
function __construct(& $db) {
parent::__construct('#__jce_plugins', 'id', $db);
}
/**
* Overloaded bind function
*
* @access public
* @param array $hash named array
* @return null|string null is operation was satisfactory, otherwise returns an error
* @see JTable:bind
* @since 1.5
*/
function bind($array, $ignore = '')
{
if (isset( $array['params'] ) && is_array($array['params']))
{
$registry = new JRegistry();
$registry->loadArray($array['params']);
$array['params'] = $registry->toString();
}
return parent::bind($array, $ignore);
}
}
?>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,32 @@
<?php defined('_JEXEC') or die('Restricted access'); ?>
<script language="javascript" type="text/javascript">
var form = parent.document.adminForm;
function submitbutton() {
if(form.boxchecked.value === ''){
alert('Please select items to alter!');
return false;
}else{
form.task.value = 'access_save';
form.submit();
}
}
</script>
<fieldset>
<div style="float: right">
<button type="button" onclick="submitbutton();">
<?php echo JText::_( 'Apply' );?></button>
<button type="button" onclick="window.parent.document.getElementById('sbox-window').close();">
<?php echo JText::_( 'Cancel' );?></button>
</div>
<div class="configuration" >
<?php echo JText::_( 'JCE Access Level' );?>
</div>
</fieldset>
<fieldset>
<legend><?php echo JText::_( 'Select Access Level' );?></legend>
<table>
<tr>
<td style="text-align:center;"><?php echo $this->lists;?></td>
</tr>
</table>
</fieldset>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,43 @@
<?php
/**
* @version $Id: view.html.php 47 2009-05-26 18:06:30Z happynoodleboy $
* @package Joomla
* @subpackage Config
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
/**
* HTML View class for the Plugins component
*
* @static
* @package Joomla
* @subpackage Plugins
* @since 1.0
*/
class PluginsViewAccess extends JView
{
function display( $tpl = null )
{
global $mainframe, $option;
$db =& JFactory::getDBO();
$db =& JFactory::getDBO();
$lists = JCEHelper::accessList( 'access', '', 1, 'parent.document.adminForm.accessall.value=this.value;' );
$this->assignRef('lists', $lists);
parent::display($tpl);
}
}
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,70 @@
<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php JHTML::script( 'sortables.js', 'administrator/components/com_jce/js/' );?>
<?php JHTML::stylesheet( 'layout.css', 'administrator/components/com_jce/css/' );?>
<?php
?>
<style type="text/css">
.editor { width: <?php echo $this->dimensions['width'];?>px; }
</style>
<form action="index.php" method="post" name="adminForm">
<fieldset>
<div style="float: right">
<button type="button" onclick="submitbutton();"><?php echo JText::_( 'Save' );?></button>
<button type="button" onclick="window.parent.document.getElementById('sbox-window').close();"><?php echo JText::_( 'Cancel' );?></button>
</div>
<div class="configuration" >
<?php echo JText::_( 'JCE LAYOUT EDITOR' );?>
</div>
</fieldset>
<fieldset>
<div><?php echo JText::_('JCE LAYOUT NOTE');?>
</div>
</fieldset>
<fieldset>
<table class="admintable">
<tr>
<td><?php echo JText::_('JCE LAYOUT DESC');?></td>
</tr>
<tr>
<td><div class="sortableList" style="cursor:auto;">
<?php
$width = $this->dimensions['width'] + 100;
$sortid = array();
for( $i=0; $i<count( $this->items ); $i++ ){
$r = $i + 1;
$sortid[] = "'row". $r ."'";
?>
<ul class="sortableRow" id="row<?php echo $r;?>" style="width:<?php echo $width;?>px">
<?php
foreach( $this->items[$i] as $item ){
$n = "row_li_". $item->id;
$path = $item->type == 'command' ? '../plugins/editors/jce/tiny_mce/themes/advanced/img/'. $item->layout .'.gif' : '../plugins/editors/jce/tiny_mce/plugins/'. $item->name .'/img/'. $item->layout .'.gif';
?>
<li class="sortableItem" id="<?php echo $n;?>"><img src="<?php echo $path;?>" alt="<?php echo $item->title;?>" title="<?php echo $item->title;?>" /></li>
<?php }?>
</ul>
<?php }?>
<input type="hidden" id="row<?php echo $r;?>_out" name="row<?php echo $r;?>_out" />
</div></td>
</tr>
</table>
</fieldset>
<script type="text/javascript">
var form = document.adminForm;
function submitbutton(){
form.layout.value = $$('.sortableItem').map(function(el, i){
return el.getParent().getProperty('id') + '[]=' + el.getProperty('id').replace(/[^0-9]/gi, '');
}).join('&').replace(',', '&', 'gi');
submitform('layoutsave');
}
new Sortables('.sortableRow', {revert: true});
</script>
<span id="debug"></span>
<input type="hidden" name="layout" value="" />
<input type="hidden" name="option" value="com_jce" />
<input type="hidden" name="type" value="plugin" />
<input type="hidden" name="task" value="" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,71 @@
<?php
/**
* @version $Id: view.html.php 47 2009-05-26 18:06:30Z happynoodleboy $
* @package Joomla
* @subpackage Config
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
/**
* HTML View class for the Plugins component
*
* @static
* @package Joomla
* @subpackage Plugins
* @since 1.0
*/
class PluginsViewLayout extends JView
{
function display( $tpl = null )
{
global $mainframe;
$db =& JFactory::getDBO();
$client = JRequest::getWord( 'client', 'site' );
$plugin =& JPluginHelper::getPlugin('editors', 'jce');
$params = new JParameter( $plugin->params );
$num = intval( $params->get( 'layout_rows', 5 ) );
$rows = array();
for($i=1; $i<=$num; $i++){
$query = "SELECT id, title, name, type, layout, icon"
. "\n FROM #__jce_plugins"
. "\n WHERE row = ". $i .""
. "\n AND published = 1"
. "\n AND icon != ''"
. "\n ORDER BY ordering ASC"
;
$db->setQuery( $query );
$rows[] = $db->loadObjectList();
}
$dimensions['width'] = $params->get( 'width', '600' );
$dimensions['height'] = $params->get( 'height', '600' );
if ($client == 'admin') {
$client_id = 1;
} else {
$client_id = 0;
}
$this->assignRef('dimensions', $dimensions);
$this->assignRef('client', $client_id);
$this->assignRef('items', $rows);
parent::display($tpl);
}
}
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,149 @@
<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php JHTML::_('behavior.tooltip'); ?>
<?php
JToolBarHelper::title( JText::_( 'JCE Plugin' ) .': <small><small>[' .JText::_('Edit'). ']</small></small>', 'plugin.png' );
JToolBarHelper::save();
JToolBarHelper::apply();
JToolBarHelper::cancel( 'cancelEdit', 'Close' );
jceToolbarHelper::help( 'plugins.edit' );
?>
<?php
// clean item data
JFilterOutput::objectHTMLSafe( $this->plugin, ENT_QUOTES, '' );
?>
<?php
$this->plugin->nameA = '';
if ( $this->plugin->id ) {
$row->nameA = '<small><small>[ '. $this->plugin->name .' ]</small></small>';
}
$icon_disabled = $this->plugin->row == '0' ? ' disabled="disabled"' : '';
$layout_disabled = $this->plugin->row == '0' ? ' disabled="disabled"' : '';
?>
<script language="javascript" type="text/javascript">
function submitbutton(pressbutton) {
if (pressbutton == "cancelEdit") {
submitform(pressbutton);
return;
}
// validation
var form = document.adminForm;
if (form.title.value == "") {
alert( "<?php echo JText::_( 'Plugin must have a title', true ); ?>" );
} else if (form.name.value == "") {
alert( "<?php echo JText::_( 'Plugin must have a name', true ); ?>" );
} else {
submitform(pressbutton);
}
}
</script>
<form action="index.php" method="post" name="adminForm">
<div class="col width-50">
<fieldset class="adminform">
<legend><?php echo JText::_( 'Details' ); ?></legend>
<table class="admintable">
<tr>
<td width="100" class="key">
<label for="name">
<?php echo JText::_( 'Description' ); ?>:
</label>
</td>
<td>
<input class="text_area" type="text" name="title" id="title" size="35" value="<?php echo $this->plugin->title; ?>" />
</td>
</tr>
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Published' ); ?>:
</td>
<td>
<?php echo $this->lists['published']; ?>
</td>
</tr>
<tr>
<td valign="top" class="key">
<label for="folder">
<?php echo JText::_( 'Type' ); ?>:
</label>
</td>
<td>
<?php echo $this->plugin->type; ?>
</td>
</tr>
<tr>
<td valign="top" class="key">
<label for="file">
<?php echo JText::_( 'Plugin name' ); ?>:
</label>
</td>
<td>
<input class="text_area" type="text" name="name" id="name" size="35" value="<?php echo $this->plugin->name; ?>" />
</td>
</tr>
<tr>
<td valign="top" class="key">
<label for="icon">
<?php echo JText::_( 'Plugin Icon' ); ?>:
</label>
</td>
<td>
<input class="text_area" type="text" name="icon" id="icon" size="35" value="<?php echo $this->plugin->icon; ?>"<?php echo $icon_disabled;?> />.gif
</td>
</tr>
<tr>
<td valign="top" class="key">
<label for="layout">
<?php echo JText::_( 'Layout Icon' ); ?>:
</label>
</td>
<td>
<input class="text_area" type="text" name="layout" id="layout" size="35" value="<?php echo $this->plugin->layout; ?>"<?php echo $layout_disabled;?> />.gif
</td>
</tr>
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Row' ); ?>:
</td>
<td>
<?php echo $this->lists['row']; ?>
</td>
</tr>
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Order' ); ?>:
</td>
<td>
<?php echo $this->lists['ordering']; ?>
</td>
</tr>
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Description' ); ?>:
</td>
<td>
<?php echo JText::_( html_entity_decode( $this->plugin->description ) ); ?>
</td>
</tr>
<tr>
<td valign="top" class="key">
<?php echo JText::_( 'Preview' ); ?>:
</td>
<td>
<?php echo html_entity_decode( $this->plugin->preview );?>
</td>
</tr>
</table>
</fieldset>
</div>
<div class="clr"></div>
<input type="hidden" name="option" value="com_jce" />
<input type="hidden" name="id" value="<?php echo $this->plugin->id; ?>" />
<input type="hidden" name="cid[]" value="<?php echo $this->plugin->id; ?>" />
<input type="hidden" name="type" value="plugin" />
<input type="hidden" name="task" value="" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,126 @@
<?php
/**
* @version $Id: view.html.php 47 2009-05-26 18:06:30Z happynoodleboy $
* @package Joomla
* @subpackage Config
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
/**
* HTML View class for the Plugins component
*
* @static
* @package Joomla
* @subpackage Plugins
* @since 1.0
*/
class PluginsViewPlugin extends JView
{
function display( $tpl = null )
{
global $option, $mainframe;
$db =& JFactory::getDBO();
$user =& JFactory::getUser();
$cid = JRequest::getVar( 'cid', array(0), '', 'array' );
JArrayHelper::toInteger($cid, array(0));
$lists = array();
$row =& JTable::getInstance('plugin', 'JCETable');
// load the row from the db table
$row->load( $cid[0] );
// fail if checked out not by 'me'
if ($row->isCheckedOut( $user->get('id') ))
{
$msg = JText::sprintf( 'DESCBEINGEDITTED', JText::_( 'The plugin' ), $row->title );
$this->setRedirect( 'index.php?option='. $option .'&type=plugin', $msg, 'error' );
return false;
}
$path = JPATH_PLUGINS .DS. 'editors' .DS. 'jce' .DS. 'tiny_mce' .DS. 'plugins' .DS. $row->name;
$url = $mainframe->getSiteURL(). 'plugins/editors/jce/tiny_mce/plugins/' .$row->name;
$xmlPath = $path .DS. $row->name .'.xml';
if ($cid[0])
{
$row->checkout( $user->get('id') );
if ( $row->ordering > 0 && $row->ordering < 100 )
{
// build the html select list for ordering
$query = 'SELECT ordering AS value, title AS text'
. ' FROM #__jce_plugins'
. ' WHERE name = "'. $row->name. '"'
. ' AND published > 0'
. ' AND ordering > 0'
. ' AND ordering < 100'
. ' ORDER BY ordering'
;
$order = JHTML::_('list.genericordering', $query );
$lists['ordering'] = JHTML::_('select.genericlist', $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ) );
} else {
$lists['ordering'] = '<input type="hidden" name="ordering" value="'. $row->ordering .'" />'. JText::_( 'This plugin cannot be reordered' );
}
$lang =& JFactory::getLanguage();
$lang->load( 'com_jce_' . trim( $row->name ), JPATH_SITE );
$data = JApplicationHelper::parseXMLInstallFile( $xmlPath );
$row->description = $data['description'];
} else {
$row->type = 'plugin';
$row->row = 4;
$row->ordering = 1;
$row->published = 1;
$row->details = 'From XML file';
$row->icon = '';
$row->layout = '';
$row->params = '';
$row->description = '';
$ordering = array();
for($i=1; $i<31; $i++){
$ordering[] = JHTML::_( 'select.option', $i, $i );
}
$lists['ordering'] = JHTML::_('select.genericlist', $ordering, 'ordering', 'class="inputbox" size="1"', 'value', 'text', '' );
}
$row_list = array(
JHTML::_( 'select.option', '1','1' ),
JHTML::_( 'select.option', '2','2' ),
JHTML::_( 'select.option', '3','3' ),
JHTML::_( 'select.option', '4','4' )
);
if ( $row->row > 0 ){
$lists['row'] = JHTML::_('select.genericlist', $row_list, 'row', 'class="inputbox" size="1"', 'value', 'text', intval( $row->row ) );
}else{
$lists['row'] = '<input type="hidden" name="row" value="'. $row->row .'" />'. JText::_( 'This plugin\'s row cannot be altered' );
}
$lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published );
$row->preview = file_exists( $path .DS. 'img' .DS. 'preview.jpg' ) ? '<img src="' .$url. '/img/preview.jpg" alt="Preview" width="400" />' : JText::_( 'No Preview Available' );
// get params definitions
$params = new JParameter( $row->params, $xmlPath );
$this->assignRef('lists', $lists);
$this->assignRef('plugin', $row);
$this->assignRef('params', $params);
parent::display($tpl);
}
}
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,153 @@
<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php JHTML::_('behavior.tooltip'); ?>
<?php JHTML::stylesheet('icons.css', 'administrator/components/com_jce/css/'); ?>
<?php
JToolBarHelper::title( JText::_( 'Plugin Manager' ), 'plugin.png' );
JToolBarHelper::publishList();
JToolBarHelper::unpublishList();
JToolBarHelper::addNew( 'add', JText::_( 'New Plugin' ) );
JToolBarHelper::custom( 'manage', 'upload.png', 'upload_f2.png', JText::_( 'Install' ), false );
//jceToolbarHelper::popup( JText::_( 'Editor Layout' ), 'move', 'plugin', 'layout' );
//JToolBarHelper::custom( '', 'refresh.png', 'refresh_f2.png', JText::_( 'Refresh List' ), false );
JToolBarHelper::cancel( 'cancel', JText::_( 'Close' ) );
jceToolbarHelper::help( 'plugins' );
$rows =& $this->items;
?>
<form action="index.php" method="post" name="adminForm">
<table>
<tr>
<td align="left" width="100%">
<?php echo JText::_( 'Filter' ); ?>:
<input type="text" name="search" id="search" value="<?php echo $this->lists['search'];?>" class="text_area" onchange="document.adminForm.submit();" />
<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
<button onclick="document.getElementById('search').value='';this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
</td>
<td nowrap="nowrap">
<?php
echo $this->lists['type'];
echo $this->lists['state'];
?>
</td>
</tr>
</table>
<table class="adminlist">
<thead>
<tr>
<th width="20">
<?php echo JText::_( 'Num' ); ?>
</th>
<th width="20">
<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $rows );?>);" />
</th>
<th class="title">
<?php echo JHTML::_('grid.sort', 'Title', 'p.title', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="5%">
<?php echo JHTML::_('grid.sort', 'Published', 'p.published', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="5%">
<?php echo JHTML::_('grid.sort', 'Row', 'p.row', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th width="8%" nowrap="nowrap">
<?php echo JHTML::_('grid.sort', 'Order', 'p.ordering', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="10%" class="title">
<?php echo JHTML::_('grid.sort', 'Type', 'p.type', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="10%" class="title">
<?php echo JHTML::_('grid.sort', 'Name', 'p.name', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="10%" class="title">
<?php echo JHTML::_('grid.sort', 'Icon', 'p.layout', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
<th nowrap="nowrap" width="1%" class="title">
<?php echo JHTML::_('grid.sort', 'ID', 'p.id', @$this->lists['order_Dir'], @$this->lists['order'] ); ?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<td colspan="12">
<?php echo $this->pagination->getListFooter(); ?>
</td>
</tr>
</tfoot>
<tbody>
<?php
$k = 0;
for ($i=0, $n=count( $rows ); $i < $n; $i++) {
$row = $rows[$i];
$link = JRoute::_( 'index.php?option=com_jce&type=plugin&view=plugin&task=edit&cid[]='. $row->id );
$checked = JHTML::_('grid.checkedout', $row, $i );
$published = JHTML::_('grid.published', $row, $i );
$ordering = ($this->lists['order'] == 'p.type');
?>
<tr class="<?php echo "row$k"; ?>">
<td align="right">
<?php echo $this->pagination->getRowOffset( $i ); ?>
</td>
<td>
<?php echo $checked; ?>
</td>
<td>
<?php
if ( JTable::isCheckedOut($this->user->get ('id'), $row->checked_out ) || !$row->editable ) {
echo $row->title;
} else {
?>
<span class="editlinktip hasTip" title="<?php echo JText::_( 'Edit Plugin' );?>::<?php echo $row->title; ?>">
<a href="<?php echo $link; ?>">
<?php echo $row->title; ?></a></span>
<?php } ?>
</td>
<td align="center">
<?php echo $published;?>
</td>
<td align="center">
<?php echo $row->row;?>
</td>
<td class="order">
<?php echo $row->ordering;?>
</td>
<td nowrap="nowrap">
<?php echo $row->type;?>
</td>
<td nowrap="nowrap">
<?php echo $row->name;?>
</td>
<td nowrap="nowrap">
<?php if( $row->type == 'plugin' && $row->layout ){
echo '<img height="20" src="../plugins/editors/jce/tiny_mce/plugins/'. $row->name .'/img/'. $row->layout .'.gif" alt="'. $row->name .'" />';
}
if( $row->type == 'command' ){
echo '<img height="20" src="../plugins/editors/jce/tiny_mce/themes/advanced/img/'. $row->layout .'.gif" alt="'. $row->name .'" />';
}?>
</td>
<td align="center">
<?php echo $row->id;?>
</td>
</tr>
<?php
$k = 1 - $k;
}
?>
</tbody>
</table>
<input type="hidden" name="option" value="com_jce" />
<input type="hidden" name="task" value="view" />
<input type="hidden" name="type" value="plugin" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -0,0 +1,124 @@
<?php
/**
* @version $Id: view.html.php 47 2009-05-26 18:06:30Z happynoodleboy $
* @package Joomla
* @subpackage Config
* @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
* @license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view');
/**
* HTML View class for the Plugins component
*
* @static
* @package Joomla
* @subpackage Plugins
* @since 1.0
*/
class PluginsViewPlugins extends JView
{
function display( $tpl = null )
{
global $mainframe, $option;
$db =& JFactory::getDBO();
$client = 'admin';
$type = JRequest::getWord( 'type' );
$task = JRequest::getWord( 'task' );
$filter_order = $mainframe->getUserStateFromRequest( "$option.$type.$task.$client.filter_order", 'filter_order', 'p.type', 'cmd' );
$filter_order_Dir = $mainframe->getUserStateFromRequest( "$option.$type.$task.$client.filter_order_Dir", 'filter_order_Dir', '', 'word' );
$filter_state = $mainframe->getUserStateFromRequest( "$option.$type.$task.$client.filter_state", 'filter_state', '', 'word' );
$filter_type = $mainframe->getUserStateFromRequest( "$option.$type.$task.$client.filter_type", 'filter_type', 1, 'cmd' );
$search = $mainframe->getUserStateFromRequest( "$option.$type.$task.$client.search", 'search', '', 'string' );
$search = JString::strtolower( $search );
$limit = $mainframe->getUserStateFromRequest( 'global.list.limit', 'limit', $mainframe->getCfg('list_limit'), 'int' );
$limitstart = $mainframe->getUserStateFromRequest( '$option.$type.$task.$client.limitstart', 'limitstart', 0, 'int' );
$limitstart = isset( $limitstart->plugin ) ? $limitstart->plugin : $limitstart;
$where = array();
// used by filter
if ( $filter_type != 1 ) {
$where[] = 'p.type = "'.$filter_type.'"';
}
if ( $search ) {
$where[] = 'LOWER( p.name ) LIKE '.$db->Quote( '%'.$db->getEscaped( $search, true ).'%', false );
}
if ( $filter_state ) {
if ( $filter_state == 'P' ) {
$where[] = 'p.published = 1';
} else if ($filter_state == 'U' ) {
$where[] = 'p.published = 0';
}
}
$where = ( count( $where ) ? ' WHERE ' . implode( ' AND ', $where ) : '' );
$orderby = ' ORDER BY '.$filter_order .' '. $filter_order_Dir .', p.row ASC';
// get the total number of records
$query = 'SELECT COUNT(*)'
. ' FROM #__jce_plugins AS p'
. $where
;
$db->setQuery( $query );
$total = $db->loadResult();
jimport('joomla.html.pagination');
$pagination = new JPagination( $total, $limitstart, $limit );
$query = 'SELECT p.*, u.name AS editor'
. ' FROM #__jce_plugins AS p'
. ' LEFT JOIN #__users AS u ON u.id = p.checked_out'
. $where
. ' GROUP BY p.id'
. $orderby
;
$db->setQuery( $query, $pagination->limitstart, $pagination->limit );
$rows = $db->loadObjectList();
if ($db->getErrorNum()) {
echo $db->stderr();
return false;
}
// get list of Positions for dropdown filter
$query = 'SELECT type AS value, type AS text'
. ' FROM #__jce_plugins'
. ' GROUP BY type'
. ' ORDER BY type'
;
$types[] = JHTML::_('select.option', 1, '- '. JText::_( 'Select Type' ) .' -' );
$db->setQuery( $query );
$types = array_merge( $types, $db->loadObjectList() );
$lists['type'] = JHTML::_('select.genericlist', $types, 'filter_type', 'class="inputbox" size="1" onchange="document.adminForm.submit();"', 'value', 'text', $filter_type );
// state filter
$lists['state'] = JHTML::_('grid.state', $filter_state );
// table ordering
$lists['order_Dir'] = $filter_order_Dir;
$lists['order'] = $filter_order;
// search filter
$lists['search'] = $search;
$this->assignRef('user', JFactory::getUser());
$this->assignRef('lists', $lists);
$this->assignRef('items', $rows);
$this->assignRef('pagination', $pagination);
parent::display($tpl);
}
}
File diff suppressed because it is too large Load Diff