diff --git a/oss/joomla/trunk/administrator/components/com_jce/config/controller.php b/oss/joomla/trunk/administrator/components/com_jce/config/controller.php new file mode 100644 index 00000000..a79688e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/config/controller.php @@ -0,0 +1,100 @@ +registerTask( 'apply', 'save'); + } + + function display( ) + { + parent::display(); + } + + function cancel( ) + { + $this->setRedirect( JRoute::_( 'index.php?option=com_jce&client='. $client, false ) ); + } + + function save() + { + // Check for request forgeries + JRequest::checkToken() or die( 'Invalid Token' ); + + $db =& JFactory::getDBO(); + $row =& JTable::getInstance('plugin'); + + $task = $this->getTask(); + + $client = JRequest::getWord( 'client', 'site' ); + + $query = 'SELECT id' + . ' FROM #__plugins' + . ' WHERE element = "jce"' + ; + $db->setQuery( $query ); + $id = $db->loadResult(); + + $row->load( intval( $id ) ); + + 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(); + + if ($client == 'admin') { + $where = "client_id=1"; + } else { + $where = "client_id=0"; + } + + $row->reorder( 'folder = '.$db->Quote( $row->folder ).' AND ordering > -10000 AND ordering < 10000 AND ( '.$where.' )' ); + + $msg = JText::sprintf( 'Successfully Saved changes to JCE configuration' ); + + switch ( $task ) + { + case 'apply': + $this->setRedirect( 'index.php?option=com_jce&type=config&client='. $client, $msg ); + break; + + case 'save': + default: + $this->setRedirect( 'index.php?option=com_jce&client='. $client, $msg ); + break; + } + } +} \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/config/index.html b/oss/joomla/trunk/administrator/components/com_jce/config/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/config/index.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/config/views/config/index.html b/oss/joomla/trunk/administrator/components/com_jce/config/views/config/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/config/views/config/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/config/views/config/tmpl/default.php b/oss/joomla/trunk/administrator/components/com_jce/config/views/config/tmpl/default.php new file mode 100644 index 00000000..17675176 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/config/views/config/tmpl/default.php @@ -0,0 +1,93 @@ + + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/config/views/config/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_jce/config/views/config/tmpl/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/config/views/config/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/config/views/config/view.html.php b/oss/joomla/trunk/administrator/components/com_jce/config/views/config/view.html.php new file mode 100644 index 00000000..ca84b899 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/config/views/config/view.html.php @@ -0,0 +1,62 @@ +load('plg_editors_jce', JPATH_SITE); + + $client = JRequest::getWord('client', 'site'); + + $lists = array (); + $row = & JTable::getInstance('plugin'); + + $query = 'SELECT id' + .' FROM #__plugins' + .' WHERE element = "jce"' + ; + $db->setQuery($query); + $id = $db->loadResult(); + + // load the row from the db table + $row->load(intval($id)); + + $xml = JCE_LIBRARIES.DS.'xml'.DS.'config'.DS.'config.xml'; + if (!file_exists($xml)) { + $xml = JPATH_PLUGINS.DS.'editors'.DS.'jce.xml'; + } + + // get params definitions + $params = new JParameter($row->params, $xml); + $params->addElementPath(JPATH_COMPONENT.DS.'elements'); + $this->assignRef('params', $params); + $this->assignRef('client', $client); + + parent::display($tpl); + } +} diff --git a/oss/joomla/trunk/administrator/components/com_jce/config/views/index.html b/oss/joomla/trunk/administrator/components/com_jce/config/views/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/config/views/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/controller/config.php b/oss/joomla/trunk/administrator/components/com_jce/controller/config.php new file mode 100644 index 00000000..941ffa98 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/controller/config.php @@ -0,0 +1,26 @@ + JPATH_COMPONENT .DS. 'config' +) ); + +$controller->execute( JRequest::getCmd( 'task' ) ); +$controller->redirect(); +?> \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/controller/cpanel.php b/oss/joomla/trunk/administrator/components/com_jce/controller/cpanel.php new file mode 100644 index 00000000..8c0e88ba --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/controller/cpanel.php @@ -0,0 +1,27 @@ + JPATH_COMPONENT .DS. 'cpanel' , + 'template_path' => JPATH_COMPONENT .DS. 'cpanel' .DS. 'views' .DS. 'tmpl' +) ); + +$controller->execute( JRequest::getCmd( 'task' ) ); +$controller->redirect(); +?> diff --git a/oss/joomla/trunk/administrator/components/com_jce/controller/groups.php b/oss/joomla/trunk/administrator/components/com_jce/controller/groups.php new file mode 100644 index 00000000..f4a4b75b --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/controller/groups.php @@ -0,0 +1,28 @@ + JPATH_COMPONENT .DS. 'groups' +) ); + +$controller->execute( JRequest::getCmd( 'task' ) ); +$controller->redirect(); +?> diff --git a/oss/joomla/trunk/administrator/components/com_jce/controller/index.html b/oss/joomla/trunk/administrator/components/com_jce/controller/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/controller/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/controller/installer.php b/oss/joomla/trunk/administrator/components/com_jce/controller/installer.php new file mode 100644 index 00000000..45c185cd --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/controller/installer.php @@ -0,0 +1,44 @@ + 'plugin', + 'Languages' => 'language', + 'Plugin Extensions' => 'extension' +); +JSubMenuHelper::addEntry(JText::_( 'Control Panel' ), '#" onclick="javascript:document.adminForm.type.value=\'\';document.adminForm.task.value=\'\';submitbutton(\'\');'); +JSubMenuHelper::addEntry(JText::_( 'Install' ), '#" onclick="javascript:document.adminForm.type.value=\'install\';document.adminForm.task.value=\'\';submitbutton(\'\');', !in_array( $ext, $subMenus)); + + +foreach ($subMenus as $name => $extension) { + JSubMenuHelper::addEntry(JText::_( $name ), '#" onclick="javascript:document.adminForm.type.value=\''.$extension.'\';submitbutton(\'manage\');', ($extension == $ext)); +} +require_once( JPATH_COMPONENT .DS. 'installer' .DS. 'controller.php' ); +$controller = new InstallerController( array( + 'default_task' => 'installform', + 'base_path' => JPATH_COMPONENT .DS. 'installer' +) ); +$task = JRequest::getWord('task'); +if( $task == 'install' ){ + $task = 'doInstall'; +} +$controller->execute( $task ); +$controller->redirect(); \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/controller/plugin.php b/oss/joomla/trunk/administrator/components/com_jce/controller/plugin.php new file mode 100644 index 00000000..ad149f79 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/controller/plugin.php @@ -0,0 +1,28 @@ + JPATH_COMPONENT .DS. 'plugins' +) ); + +$controller->execute( JRequest::getCmd( 'task' ) ); +$controller->redirect(); +?> diff --git a/oss/joomla/trunk/administrator/components/com_jce/cpanel/controller.php b/oss/joomla/trunk/administrator/components/com_jce/cpanel/controller.php new file mode 100644 index 00000000..96bc6e85 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/cpanel/controller.php @@ -0,0 +1,41 @@ +