From 0aa7f262498ac62db81319f653bf0f8133714b7f Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 30 Sep 2005 02:48:33 +0000 Subject: [PATCH] Switch from using htmlarea to using xinha. Clean up the use of the editor plugin --- admin/addAppNote.php | 7 +- admin/adminAppQueue.php | 16 +-- admin/editAppFamily.php | 7 +- admin/editAppNote.php | 8 +- admin/editAppVersion.php | 8 +- admin/resubmitRejectedApps.php | 14 +-- appsubmit.php | 69 +++--------- include/util.php | 199 +++++++++++++++++++++++++++++++++ 8 files changed, 239 insertions(+), 89 deletions(-) diff --git a/admin/addAppNote.php b/admin/addAppNote.php index 7169aab..61e2378 100644 --- a/admin/addAppNote.php +++ b/admin/addAppNote.php @@ -39,11 +39,8 @@ if($_REQUEST['sub'] == "Submit") } else if($_REQUEST['sub'] == 'Preview' OR empty($_REQUEST['submit'])) { -?> - - - -\n"; diff --git a/admin/adminAppQueue.php b/admin/adminAppQueue.php index 9da6018..541afcd 100644 --- a/admin/adminAppQueue.php +++ b/admin/adminAppQueue.php @@ -128,11 +128,7 @@ if ($_REQUEST['sub']) { $x = new TableVE("view"); apidb_header("Admin App Queue"); -?> - - - -',"\n"; echo '',"\n"; @@ -140,6 +136,8 @@ if ($_REQUEST['sub']) if (!$oApp) //app version { + HtmlAreaLoaderScript(array("editor")); + echo html_frame_start("Potential duplicate versions in the database","90%","",0); $oApp = new Application($oVersion->iAppId); display_versions($oApp->iAppId, $oApp->aVersionsIds); @@ -181,7 +179,9 @@ if ($_REQUEST['sub']) echo '',"\n"; echo '',"\n"; } else // application - { + { + HtmlAreaLoaderScript(array("editor", "editor2")); + echo html_frame_start("Potential duplicate applications in the database","90%","",0); perform_search_and_output_results($oApp->sName); echo html_frame_end(" "); @@ -274,7 +274,7 @@ if ($_REQUEST['sub']) // application desc echo 'Application Description',"\n"; - echo '

',"\n"; + echo '

',"\n"; // version name echo 'Version name',"\n"; @@ -282,7 +282,7 @@ if ($_REQUEST['sub']) // version description echo 'Version Description',"\n"; - echo '

',"\n"; + echo '

',"\n"; echo 'email Text',"\n"; diff --git a/admin/editAppFamily.php b/admin/editAppFamily.php index 8b4bb8b..342dbed 100644 --- a/admin/editAppFamily.php +++ b/admin/editAppFamily.php @@ -30,11 +30,8 @@ if(isset($_REQUEST['submit'])) else // Show the form for editing the Application Family { -?> - - - -iAppId; $_REQUEST['versionId'] = $oNote->iVersionId; } -?> - - - - - - - - - - - -',"\n"; echo '',"\n"; @@ -80,6 +74,8 @@ if ($_REQUEST['sub']) if (!$oApp) //app version { + HtmlAreaLoaderScript(array("editor")); + echo html_frame_start("Potential duplicate versions in the database","90%","",0); $oApp = new Application($oVersion->iAppId); display_versions($oApp->iAppId, $oApp->aVersionsIds); @@ -120,6 +116,8 @@ if ($_REQUEST['sub']) echo '',"\n"; } else // application { + HtmlAreaLoaderScript(array("editor")); + echo html_frame_start("Potential duplicate applications in the database","90%","",0); perform_search_and_output_results($oApp->sName); echo html_frame_end(" "); @@ -198,7 +196,7 @@ if ($_REQUEST['sub']) // application desc echo 'Application Description',"\n"; - echo '

',"\n"; + echo '

',"\n"; // version name echo 'Version name',"\n"; @@ -206,7 +204,7 @@ if ($_REQUEST['sub']) // version description echo 'Version Description',"\n"; - echo '

',"\n"; + echo '

',"\n"; echo 'email Text',"\n"; diff --git a/appsubmit.php b/appsubmit.php index d1f1c23..304f573 100644 --- a/appsubmit.php +++ b/appsubmit.php @@ -12,7 +12,7 @@ require(BASE."include/application.php"); * Templates * FIXME: put templates in config file or somewhere else. */ - //$sAppDescription = "

Enter description here

"; + $sAppDescription = "

Enter a description of the application here

"; $sVersionDescription = "

This is a template; enter version-specific description here

Wine compatibility
@@ -85,9 +85,7 @@ if (isset($_REQUEST['appName'])) if($vendorName) $_REQUEST['vendorId']=""; $oApplication = new Application(); - // FIXME When two htmlarea will be able to live on the same page - // without problems under gecko, remove the

around appDescrion - $oApplication->create($_REQUEST['appName'], "

".$_REQUEST['appDescription']."

", $_REQUEST['keywords']." *** ".$_REQUEST['vendorName'], $_REQUEST['webpage'], $_REQUEST['vendorId'], $_REQUEST['catId']); + $oApplication->create($_REQUEST['appName'], $_REQUEST['appDescription'], $_REQUEST['keywords']." *** ".$_REQUEST['vendorName'], $_REQUEST['webpage'], $_REQUEST['vendorId'], $_REQUEST['catId']); $oVersion = new Version(); $oVersion->create($_REQUEST['versionName'], $_REQUEST['versionDescription'], null, null, $oApplication->iAppId); redirect(apidb_fullurl("index.php")); @@ -116,52 +114,10 @@ elseif (isset($_REQUEST['versionName']) && is_numeric($_REQUEST['appId'])) */ if (isset($_REQUEST['apptype'])) { -// header -apidb_header("Submit Application"); + // header + apidb_header("Submit Application"); -//FIXME: use absolute path in htmlarea_loader.js to avoid code duplication here -?> - - - -'."\n"; @@ -169,7 +125,7 @@ onload = function() { echo "database. The application will be reviewed by the AppDB Administrator\n"; echo "and you will be notified via email if this application will be added to\n"; echo "the database.

\n"; - echo "

Before continuing please check that you have:\n"; + echo "

Before continuing please check that you have:

\n"; echo "

"; echo "

Please don't forget to mention which Wine version you used, how well it worked\n"; echo "and if any workaround were needed. Having app descriptions just sponsoring the app\n"; - echo "(Yes, some vendor want to use the appdb for this) or saying \"I haven't tried this app with Wine\" "; + echo "(Yes, some vendors want to use the appdb for this) or saying \"I haven't tried this app with Wine\" "; echo "won't help Wine development or Wine users.

\n"; + echo "Please only submit applications/versions that you have tested.\n"; + echo "Submissions without testing information or not using the provided template will be rejected.\n"; + echo "If you can't see the in-browser editors below please try Firefox, Mozilla or Opera browsers.\n"; echo "

After your application has been added you'll be able to submit screenshots for it, post"; echo " messages in its forums or become a maintainer to help others trying to run the application.

"; if(!empty($errors)) @@ -228,7 +187,11 @@ onload = function() { echo '',"\n"; echo 'Application Description',"\n"; - echo '

',"\n"; } diff --git a/include/util.php b/include/util.php index 1734f82..27ab715 100644 --- a/include/util.php +++ b/include/util.php @@ -769,4 +769,203 @@ function display_page_range($currentPage=1, $pageRange=1, $totalPages=1, $linkur } +// Expand a path like /something/somedirectory/../ to /something +// from http://us2.php.net/realpath +function SimplifyPath($path) { + $dirs = explode('/',$path); + + for($i=0; $i'; + // You must set _editor_url to the URL (including trailing slash) where + // where xinha is installed, it's highly recommended to use an absolute URL + // eg: _editor_url = "/path/to/xinha/"; + // You may try a relative URL if you wish] + // eg: _editor_url = "../"; + // in this example we do a little regular expression to find the absolute path. + // NOTE: we use GetSimplifiedPath() because we cannot use a relative path and have + // all of the plugins work correctly. Specifically the SpellChecker plugin + // requires a absolute url path to the xinha directory + echo ' + _editor_url = "'.GetSimplifiedPath("xinha/").'", \'\'; + _editor_lang = "en"; // And the language we need to use in the editor. + '; + + echo ' + + + + + '; +} + ?>