From 719a7cf5415cfe2563a5c2b0ee561e21b901f2a2 Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Sun, 13 Jun 2010 23:27:13 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=B0=20trunk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +YUCHENG HU+ git-svn-id: https://svn.code.sf.net/p/hawebs/svn@333 a2543c7e-f6e9-4f8a-8bff-1ffc34733512 --- .../components/com_jce/config/controller.php | 100 ++++++++++++++++ .../components/com_jce/config/index.html | 1 + .../com_jce/config/views/config/index.html | 1 + .../config/views/config/tmpl/default.php | 93 +++++++++++++++ .../config/views/config/tmpl/index.html | 1 + .../com_jce/config/views/config/view.html.php | 62 ++++++++++ .../com_jce/config/views/index.html | 1 + .../components/com_jce/controller/config.php | 26 +++++ .../components/com_jce/controller/cpanel.php | 27 +++++ .../components/com_jce/controller/groups.php | 28 +++++ .../components/com_jce/controller/index.html | 1 + .../com_jce/controller/installer.php | 44 +++++++ .../components/com_jce/controller/plugin.php | 28 +++++ .../components/com_jce/cpanel/controller.php | 41 +++++++ .../components/com_jce/cpanel/index.html | 1 + .../com_jce/cpanel/views/cpanel/index.html | 1 + .../cpanel/views/cpanel/tmpl/default.php | 109 ++++++++++++++++++ .../cpanel/views/cpanel/tmpl/index.html | 1 + .../com_jce/cpanel/views/cpanel/view.html.php | 57 +++++++++ .../com_jce/cpanel/views/index.html | 1 + .../components/com_jce/css/icons.css | 44 +++++++ .../components/com_jce/css/index.html | 1 + .../components/com_jce/css/layout.css | 56 +++++++++ .../components/com_jce/css/styles.css | 13 +++ 24 files changed, 738 insertions(+) create mode 100644 oss/joomla/trunk/administrator/components/com_jce/config/controller.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/config/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/config/views/config/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/config/views/config/tmpl/default.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/config/views/config/tmpl/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/config/views/config/view.html.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/config/views/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/controller/config.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/controller/cpanel.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/controller/groups.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/controller/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/controller/installer.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/controller/plugin.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/cpanel/controller.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/cpanel/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/tmpl/default.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/tmpl/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/view.html.php create mode 100644 oss/joomla/trunk/administrator/components/com_jce/cpanel/views/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/css/icons.css create mode 100644 oss/joomla/trunk/administrator/components/com_jce/css/index.html create mode 100644 oss/joomla/trunk/administrator/components/com_jce/css/layout.css create mode 100644 oss/joomla/trunk/administrator/components/com_jce/css/styles.css 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 @@ + +
+
+ + + + + + + + + + + + + + + + +
+
+ + params->render('params', 'setup')) : + echo $output; + else : + echo "
".JText::_('No Parameters')."
"; + endif;?> +
+
+
+ + params->render('params', 'cleanup')) : + echo $output; + else : + echo "
".JText::_('No Parameters')."
"; + endif;?> +
+
+
+ + params->render('params', 'format')) : + echo $output; + else : + echo "
".JText::_('No Parameters ')."
"; + endif;?> +
+
+
+ + params->render('params', 'advanced')) : + echo $output; + else : + echo "
".JText::_('No Parameters ')."
"; + endif;?> +
+
+
+ + params->render('params', 'other')) : + echo $output; + else : + echo "
".JText::_('No Parameters ')."
"; + endif;?> +
+
+
+ + + + + +
\ 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 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/index.html b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/tmpl/default.php b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/tmpl/default.php new file mode 100644 index 00000000..f32f84ba --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/tmpl/default.php @@ -0,0 +1,109 @@ + + + + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + www.joomlacontenteditor.com/forum +
+ + + www.joomlacontenteditor.com/tutorials +
+ + + www.joomlacontenteditor.com/documentation +
+ + + www.joomlacontenteditor.com/faq +
+ + GNU/GPL
+ + + com_info['version'];?> +
+ + + plg_info['version'];?> +
+ + +
    + purgeCheck() ){?> +
  • - + []
  • + checkTable( 'plugins' ) ){?> +
  • + checkTable( 'groups' ) ){?> +
  • + +
+
+
\ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/tmpl/index.html b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/tmpl/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/view.html.php b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/view.html.php new file mode 100644 index 00000000..29f6f024 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/cpanel/view.html.php @@ -0,0 +1,57 @@ +assignRef('icons', $icons); + $this->assignRef('pane', $pane); + //$this->assignRef('modules', $modules); + $this->assignRef('com_info', $com_xml); + $this->assignRef('plg_info', $plg_xml); + + parent::display($tpl); + } +} +?> \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/index.html b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/cpanel/views/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/css/icons.css b/oss/joomla/trunk/administrator/components/com_jce/css/icons.css new file mode 100644 index 00000000..be031c9c --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/css/icons.css @@ -0,0 +1,44 @@ +/* CSS Document */ +.icon-32-lock { + background-image: url(../img/toolbar/icon-32-lock.png); +} +.icon-32-refresh { + background-image: url(../img/toolbar/icon-32-refresh.png); +} +span.icon-remove, span.icon-add { + cursor: pointer; +} +.icon-remove { + height: 20px; + background: url(../img/delete.png) no-repeat; + padding: 2px; +} +.icon-add { + background: url(../img/add.png) no-repeat; + padding: 2px; +} +.icon-text { + margin-left: 20px; +} +.icon-legend { + height: 20px; + background: url(../img/icons.png) no-repeat; + padding: 2px; +} +ul#table_status { + list-style: none; + margin:0; + padding:0; +} +ul#table_status li { + list-style: none; + margin:0; + padding: 5px 0 0 20px; + height: 20px; +} +ul#table_status li.error { + background: url(../img/delete.png) no-repeat left; +} +ul#table_status li.ok { + background: url(../img/tick.png) no-repeat left; +} \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/css/index.html b/oss/joomla/trunk/administrator/components/com_jce/css/index.html new file mode 100644 index 00000000..fa6d84e8 --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/css/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/css/layout.css b/oss/joomla/trunk/administrator/components/com_jce/css/layout.css new file mode 100644 index 00000000..6cad79bb --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/css/layout.css @@ -0,0 +1,56 @@ +/* CSS Document */ +div.sortableList { + cursor: n-resize; +} +div.widthMarker { + height: 20px; + border-top: 1px dashed #CCC; + margin: 10px 0px 0px 1px; + padding-left: 1px; + text-align: center; +} +div.sortableList.group { + margin: 20px 0px 0px 0px; +} +div.sortableList div.sortableListDiv { + height: 30px; + margin-bottom: 3px; + width: 600px; +} +div.sortableList div.sortableListDiv span.sortableListSpan { + background-color: #F0F0EE; + height: 30px; + border-right: 1px dashed #CCC; + display: block; +} +div.sortableList div.sortableListDiv span.sortableListSpan ul { + width: 600px; + white-space: nowrap; + border: 1px solid #CCC; + list-style: none; + margin:0px; + padding: 0px 0px 0px 1px; + height: 30px; +} +div.sortableList div.sortableListDiv span.sortableListSpan ul li { + list-style: none; + cursor: move; + height: 22px; + min-width: 20px; +} +div.sortableList div.sortableListDiv span.sortableListSpan ul li.spacer { + min-width: 5px; + padding-left: 2px; +} +div.sortableList div.sortableListDiv span.sortableListSpan ul li img { + border: 0; + padding: 0; + margin: 0 +} +li.sortableItem { + position: relative; + float: left; + margin: 3px 1px 1px 0px; + border: 1px solid #CCC; + background-color: #F0F0EE; +} \ No newline at end of file diff --git a/oss/joomla/trunk/administrator/components/com_jce/css/styles.css b/oss/joomla/trunk/administrator/components/com_jce/css/styles.css new file mode 100644 index 00000000..1f5511af --- /dev/null +++ b/oss/joomla/trunk/administrator/components/com_jce/css/styles.css @@ -0,0 +1,13 @@ +/* CSS Document */ +select.inputbox.levels, select.inputbox.users { + width: 200px; +} +.adminform td.note { + background-color: #FFFFDD; + border-bottom:1px solid #E9E9E9; + border-right:1px solid #E9E9E9; + color:#666666; + width:50%; + vertical-align: top; + padding: 10px; +} \ No newline at end of file