diff -urN joomla-1.0.7/CHANGELOG.php joomla-1.0.10/CHANGELOG.php --- joomla-1.0.7/CHANGELOG.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/CHANGELOG.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,938 +1,1792 @@ - - -1. Changelog ------------- -This is a non-exhaustive (but still near complete) changelog for -Joomla! 1.0, including beta and release candidate versions. -Our thanks to all those people who've contributed bug reports and -code fixes. - -Legend: - -* -> Security Fix -# -> Bug Fix -+ -> Addition -^ -> Change -- -> Removed -! -> Note - - ----------------- 1.0.7 Released -- [15-Jan-2006 20:00 UTC] ------------------ - -15-Jan-2006 Rey Gigataras - # Fixed : database password being incorrectly overwritten with a blank - ----------------- 1.0.6 Released -- [15-Jan-2006 15:00 UTC] ------------------ - -This Release Contains following Security Fixes - -Low Level Threat -* Disallow Author from publishing items or changing publish state -* Hardened Contact Component against misuse -* Added simple filtering control ability to Contact Component -* Hardened misuse of Contact Component `email copy` ability when not activated -* Hardened misuse of Contact Component `VCard` ability when not activated -* `VCard` & `Email Copy` options set to hide by default -* Multiple Vulnerabilities in TinyMCE Compressor -* Hardened Itemid against misuse -* Hide database password in Global Configuration - ---- - -15-Jan-2006 Rey Gigataras - * SECURITY [ Low Level ]: Hide database password in Global Configuration - # Fixed artf3064 : Warning: Invalid argument supplied mod_fullmenu Line 57 - # Fixed artf3063 : Poll Component Output Display Error - -14-Jan-2006 Louis Landry - # Fixed Caching `Blog` pagination problem - -14-Jan-2006 Rey Gigataras - * SECURITY [ Low Level ]: disallow Author from publishing items or changing publish state [identified Max Dymond] - # Fixed artf3055 : Weblink submit, no email to admin - # Fixed artf3045 : Unhandled fragment identifier with core SEF enabled - # Fixed artf3032 : 1783: Can't get custom CSS in Tiny MCE - # Fixed artf3052 : Contact Component Re-Direct Issue - # Fixed artf3043 : Login & Logout redirecting to $mosConfig_live_site - # Fixed artf3040 : Site Modules | Display can be duplicated on Pages - # Fixed problem with display mod_rssfeed twice on a page - ^ Contact Component confirmation now uses mosredireect msg, rather than JS - -13-Jan-2005 Andrew Eddie - # Fixed bug in database::loadRowList that reutrn assoc and not numerical array - # Fixed bug in index2.php where joomlajavascript.js is not included - -13-Jan-2006 Rey Gigataras - * SECURITY [ Low Level ]: + simple filter check to Contact Component - # Fixed artf3038 : Warning: array_search(): Wrong datatype for second argument in - # Fixed artf3037 : New 404 tags aren't translated - # Fixed artf3035 : Bug with mod_newsflash - -12-Jan-2006 Alex Kempkens - # Fixed mosFormateDate, handling offset's with value 0 - -12-Jan-2006 Rey Gigataras - * SECURITY [ Low Level ]: changed `Email Copy` param option for new Contacts now set to `hide` - # Fixed artf2070 : mosHTML:encoding_converter() breaks with ö - # Fixed missing
  • tag in newsfeed component - # Fixed artf1487 : Media Manager breaks when illegal characters in uploaded file name - # Fixed artf2108 : Saving a parent inside of a child - + caching support to `Frontpage` component - + missing param for `Table - Weblink Category` - - sef handling in mod_search.php as SEF - - unnecessary `checked out` check in mod_latestnews.php and mod_mostread.php - - unnecessary param variable in mod_latestnews.php - -10-Jan-2006 Rey Gigataras - * SECURITY [ Low Level ]: Fixed artf2386 : Preventing Spambots through com_contact - # Fixed artf2622 : admin.users.php session_start called when a session is already open - # Fixed artf2789 : invalid xhtml - # Fixed artf2989 : User WYSIWYG editor setting resets after adding new user from backend - # Fixed artf2986 : Wrong link to image-icon in weblinks - -08-Jan-2006 Johan Janssens - * SECURITY [ Low Level ]: Fixed Security Vulnerability in TinyMCE Compressor - -08-Jan-2006 Rey Gigataras - * SECURITY [ Low Level ]: Fixed artf2950 : Information leak with Vcard hide function - * SECURITY [ Low Level ]: changed `VCard` param option for new Contacts now set to `hide` - # Fixed DOMIT bugs [identified by sarahk] http://sarahk.pcpropertymanager.com/blog/using-domit-rss/225/ - # Fixed artf2793 : New user confirmation link warning on login - # Fixed artf2732 : Pagination in the Blog section/category doesnt work - # Fixed artf2943 : Incorrect Redirect for Weblinks - # Fixed artf2945 : Undefined constant in php_http_exceptions.php - -07-Jan-2006 Rey Gigataras - # Fixed artf2933 : Pathway problem on Windows - -06-Jan-2006 Rey Gigataras - ^ changed mod_archive so that no Itemid is assigned, meaning it uses the default Itemid=99999999 - # Fixed artf2738 : Incorrect SEF links for archive com_content links - # Fixed artf1809 : mospagebreak problem with "Special Characters" - # Fixed artf2861 : article_seperator glitch - -05-Jan-2006 Rey Gigataras - # Fixed artf2825 : RSS module SEF urls - -04-Jan-2006 Rey Gigataras - * SECURITY [ Low Level ]: Fixed artf2050 : Itemid in index2.php - # Fixed Related items Module shows Expired items - Mambo Tracker [#7590] - # Fixed artf2185 : Changing weblinks possible for everyone - -03-Jan-2006 Andy Miller - ^ Updated copyright information for iCandy Junior icons - -03-Jan-2005 Rey Gigataras - # Fixed XHTML validation error in `Blog` view with decmimal value widths - # Fixed XHTML validation error in `Table - Content Category` - # Fixed artf2791 : RSS item links not SEF'd - # Fixed artf2791 : RSS items have no category - # Fixed artf2813 : Media Manager doesn't support ICO files - -02-Jan-2006 Rey Gigataras - # Fixed artf2802 : All content made bold for Rss module published on the frontpage - # Fixed artf2780 : Newsflash Read More bad link - # Fixed artf2786 : Newsflash module not picking up "linked title" global setting - # Fixed artf2810 : 1.0.x changelog incorrectly states release date of 1.0.5 - -30-Dec-2005 Rey Gigataras - # Fixed `Unlimited` banner impressions option - # Fixed artf2776 : Multiple banners not possible - # Fixed artf2788 : admin template css errors - -29-Dec-2005 Rey Gigataras - # Fixed artf2646 : name="" not valid XHTML - # Fixed artf2747 : title_alias is missing in mambots - # Fixed `Reset Clicks` button not working in admin component `Banner Manager` - # Fixed artf2712 : Clicks reset on save - -29-Dec-2005 Andrew Eddie - ^ SEF error handling throws to new /templates/404.php file - # Rolled back changes to database::insertObject - + New prototype MySQL 5 driver - -24-Dec-2005 Emir Sakic - # Fixed a bug with 404 header being returned for homepage when SEF activated - # Fixed a bug with all items on frontpage returning Itemid=1 (duplicate content) - ----------------- 1.0.5 Released -- [24-Dec-2005 10:00 UTC] ------------------ - -This Release Contains following Security Fixes - -Medium Level Threats -* Hardened ability to use the contact component to proliferate spam - ---- - -21-Dec-2005 Andrew Eddie - # Fixed slow query in com_content (Author text in a content item is now set to Written By) - # Fixed bug in backend poll entry with ' is in option name - # Fixed bug where content modified date is not updated on a bluck publish/archive operation - + Added TEMPLATEURL to patTemplate preloaded variables - ^ patTemplate Translate now recognises 1.0 version language constants - -20-Dec-2005 Emir Sakic - # Fixed artf2432 : Apostrophe in paths isn't escaped properly - -20-Dec-2005 Johan Janssens - # Fixed artf2389 : gzip compression not operational - # Fixed artf2599 : loosing Itemid afet submitting "ask for new password" - # Fixed artf1712 : Search Mambots return duplicate results - # Fixed artf2534 : Template chooser no longer able to manage SEF urls / XHTML validation - # Fixed artf1410 : 'Special' access menu locks out 'public' menu's articles "read more" content - # Fixed artf2595 : Deleted "mass mail" item menu in component menu - # Fixed artf2518 : mod_latestnews problem - # Fixed artf2591 : mosMakePath problem with mkdir on strato - # Fixed artf2665 : Most Read module generates incorrect class for
  • statement - # Fixed artf2666 : Pagination Error in Category Manager - # Fixed artf2407 : parameter type=mos_category show only "- Select Content Category -" - -16-Dec-2005 Andy Miller - # Fixed mod_whosonline not rendering list properly - -07-Dec-2005 Andrew Eddie - + Added database::getAffectedRows to db connectors - -10-Dec-2005 Emir Sakic - # Fixed artf2517 : "Cancel" the editing of content after "apply" not possible - -09-Dec-2005 Emir Sakic - # Fixed artf2324 : SEF for components assumes option is always first part of query - # Fixed artf1955 : Search results bug - -07-Dec-2005 Andrew Eddie - # Fixed unitialised array in mosHTML::MenuSelect method - + Added mosBackTrace debugging function - # Fixed bug in mosDBTable::load where null table values don't overwrite properly - -07-Dec-2005 Johan Janssens - # Fixed artf2430 : invalid values in tabpane.css - # Fixed artf2457 : VCard bug IS a bug - # Fixed artf2218 : RSS Newsfeed module generates wrong rendering output - # Fixed artf2453 : Random Image Module - # Fixed artf2251 : Poll title error - # Fixed artf2393 : Original editor cannot open content item if checked out - # Fixed artf2323 : overlib_hideform_mini.js parse error - # Fixed artf2248 : Incorrect hits count on multipage articles - # Fixed artf2342 : getBlogCategoryCount - # Fixed artf2464 : Contacts Component image path error - # Fixed artf2404 : Contact detail html bug - ^ Replaced install.png with transparent image - contributed by joomlashack - # Fixed artf2245 : RSS not showing enclosure tags - # Fixed artf2247 : RSS newsfeed on Frontend missing link - # Fixed bug in Domit lite parser - # Fixed mosMail() is missing "ReplyTo:" field to avoid anti-spam rules (SPF) - # Fixed Small typo in mosBindArrayToObject - -06-Dec-2005 Alex Kempkens - # Fixed artf2434: Typo in database.php checkout function line 1050 - # Fixed artf2398 : Parameter Text Area field name - -06-Dec-2005 Johan Janssens - # Fixed artf2418 : Banners Client Manager Next Page Issue: Joomla 1.04 - # Fixed artf2156 : memory exhastion error in joomla.xml.php - # Fixed artf2378 : mosCommonHTML::CheckedOutProcessing not checking if the current user - has checked out the document - # Fixed artf1948 : Pagination problem still exists - ^ Upgraded TinyMCE Compressor [1.0.4] - ^ Upgraded TinyMCE [2.0.1] - -01-Dec-2005 Andrew Eddie - # Fixed nullDate error in mosDBTable::checkin method - # Removed $migrate global in mosDBTable::store method - # Fixed some MySQL 5 issues (still very unreliable) - + Component may force frontend application to include joomla.javascript.js by: - $mainframe->set( 'joomlaJavascript', 1 ); - -01-Dec-2005 Andrew Eddie - # Fixed limit error in sections search bot - # Bug in gacl_api::add_group query [c/o Mambo bug #8199] - # Search highlighting fails when a "?" is entered [c/o Mambo bug #8260] - -30-Nov-2005 Emir Sakic - + Added 404 handling for missing content and components - + Added 404 handling to SEF for unknown files - -30-Nov-2005 Andrew Eddie - # Site templates allowed to have custom index2.php (fixes problems where custom code is required in index2) - -29-Nov-2005 Andrew Eddie - # Fixed artf2258 : Parameter tooltips missing in 1.0.4 - -28-Nov-2005 Andrew Eddie - # Fixed artf2329 : mosMainFrame::getBasePath refers to non-existant JFile class. - # Fixed artf2246 : Error in frontend.html.php - # Fixed artf2190 : mod_poll.php modification - # Fixed artf2292 : [WITH FIX] Sql query missing hits - -24-Nov-2005 Emir Sakic - # Fixed artf2225 : Email / Print redirects to homepage - # Fixed artf1705 : Not same URL for same item : duplicate content - -23-Nov-2005 Johan Janssens - # Fixed : Content Finish Publishing & not authorized - -22-Nov-2005 Marko Schmuck - # Fixed artf2240 : 1.0.4 URL encoding entire frontend? - # Fixed artf2222 : ampReplace in content.html.php - + Versioncheck for new_link parameter for mysql_connect. - -22-Nov-2005 Levis Bisson - # Fixed artf2221 : 1.0.4: includes/database.php faulty on PHP < 4.2.0 - # Fixed artf2219 : Bug in pageNavigation.php - added "if not define _PN_LT or _PN_RT" - -22-Nov-2005 Johan Janssens - # Fixed artf2224 : Problem with Media Manager - # Fixed : Can't create new folders in media manager - ----------------- 1.0.4 Released -- [21-Nov-2005 10:00 UTC] ------------------ - -This Release Contains following Security Fixes - -Critical Level Threat - * Potentional XSS injection through GET and other variables - * Hardened SEF against XSS injection - -Low Level Threat - * Potential SQL injection in Polls modules through the Itemid variable - * Potential SQL injection in several methods in mosDBTable class - * Potential misuse of Media component file management functions - * Add search limit param (default of 50) to `Search` Mambots to prevent search flooding - ---- - -20-Nov-2005 Levis Bisson - # Fixed Artifact artf1967 displays with an escaped apostrophe in both title and TOC. - -20-Nov-2005 Emir Sakic - * SECURITY [ Critical Level ]: Hardened SEF against XSS injection - -19-Nov-2005 Levis Bisson - # replaced charset=utf-8 to charset=iso-8859-1 in language file - -19-Nov-2005 Andrew Eddie - * SECURITY [ Critical Level ]: Fixed XSS injection of global variable through the _GET array - -17-Nov-2005 Johan Janssens - ^ Replaced install.png with new image - - Reverted artf2139 : admin menu xhtml - + Added clone function for PHP5 backwards compatibility - -16-Nov-2005 Rey Gigataras - # Fixed artf2137 : editorArea xhtml - # Fixed artf2139 : admin menu xhtml - # Fixed artf2136 : Admin menubar valid xhtml - # Fixed artf2135 : Admin invalid xhtml - # Fixed artf2140 : mosMenuBar::publishList - # Fixed artf2027 : uploading images from custom component - -13-Nov-2005 Rey Gigataras - # PERFORMANCE: Fixed artf1993 : Inefficient queries in com_content - # Fixed artf2021 : artf1791 : Failed Login results in redirect to referring page - # Fixed artf2021 : appendMetaTag() prepends instead of appends - # Fixed artf1981 : incorrect url's at next/previous links at content items - # Fixed artf2079 : SQL error in category manager thru contact manager - # Fixed artf1586 : .htaccess - RewriteEngine problem - # Fixed artf1976 : Check for custom icon in mod_quickicon.php - -11-Nov-2005 Andy Miller - # Fixed issue with RSS module not displaying inside module rendering wrapper - -10-Nov-2005 Rey Gigataras - # Fixed contact component dropdown select category bug - -07-Nov-2005 Rey Gigataras - # Fixed mod_quickicon `redeclaration of function` error possibilities - -07-Nov-2005 Johan Janssens - # Fixed artf1648 : tinyMCE BR and P elements - # Fixed artf1700 : TinyMCE doesn't support relative URL's for images - -07-Nov-2005 Andrew Eddie - * SECURITY [ Low Level ]: Fixed artf1978 : mod_poll SQL Injection Vulnerability - * SECURITY [ Low Level ]: Fixed SQL injection possibility in several mosDBTable methods - * SECURITY [ Low Level ]: Fixed malicious injection into filename variables in com_media - ^ mosDBTable::publish_array renamed to publish - ^ mosDBTable::save no longer updates the ordering (must now be done separately) - -06-Nov-2005 Rey Gigataras - * SECURITY [ Low Level ]: Add search limit param (default of 50) to `Search` Mambots to prevent search flooding - # Fixed custom() & customX() functions in menu.html.php no checking for image in /administrator/images/ - -04-Nov-2005 Rey Gigataras - # Fixed artf1953 : Page Class Suffix in Contacts component - # Fixed artf1945 : mosToolTip not generating valid xhtml - -03-Nov-2005 Rey Gigataras - + modduleclass_sfx support to mod_poll - # Fixed artf1902 : Incorrect number of table cells in mod_poll - -03-Nov-2005 Samuel Moffatt - # Fixed bug which prevented component uninstall if another XML file was in the directory - -01-Nov-2005 Rey Gigataras - # Fixed artf1888 : linkable [category|section] URL incorrect - # Fixed artf1620 : Hardcoded words in pdf.php - # Fixed artf1887 : Content: Bug in creation date generation - -31-Oct-2005 Johan Janssens - # Fixed artf1277 : News Feed Display Bad Accent character - -31-Oct-2005 Rey Gigataras - # Fixed artf1739 : Problem with the menuitem type url and assigned templates and modules - # Fixed artf1574 : Who is online after update to Joomla 1.0.3 no more work correctly - # Fixed artf1666 : Notice: on component installation - # Fixed artf1573 : Manage Banners | Error in Field Name - # Fixed artf1597 : Small bug in loadAssocList function in database.php - # Fixed artf1832 : Logout problem - # Fixed artf1769 : Undefined index: 2 in includes/joomla.php on line 2721 - # Fixed artf1749 : Email-to-friend is NOT actually from friend - # Fixed artf1591 : page is expired at installation - # Fixed artf1851 : 1.0.2 copy content has error - # Fixed artf1569 : Display of mouseover in IE gives a problem with a dropdown-box - # Fixed artf1869 : Poll produces MySQL-Error when accessed via Component Link - # Fixed artf1694 : 1.0.3 undefined indexes filter_sectionid and catid on "Add New Content" - # Fixed artf1834 : English Localisation - # Fixed artf1771 : Wrong mosmsg - # Fixed artf1792 : "Receive Submission Emails" label is misleading - # Fixed artf1770 : Undefined index: HTTP_USER_AGENT - -30-Oct-2005 Rey Gigataras - ^ Upgraded TinyMCE Compressor [1.02] - ^ Upgraded TinyMCE [2.0 RC4] - -27-Oct-2005 Johan Janssens - # Fixed artf1671 : Media Manager - # Fixed artf1814 : Tab Class wrong - # Fixed artf1086 : Icons at the control panel fall apart - -26-Oct-2005 Samuel Moffatt - # Fixed bug where a new database object with the same username, password and host but different database name would kill Joomla! - -25-Oct-2005 Johan Janssens - # Fixed artf1733 : $contact->id used instead of $Itemid - # Fixed artf1654 : base url above title tag - # Fixed artf1738 : Registration - javascript alert - -23-Oct-2005 Rey Gigataras - # Fixed artf1695 : Show Empty Categories in Section does not work - # Fixed artf1710 : Unnecessary queries (optimization) - # Fixed artf1711 : Missing whitespace in search results - # Fixed artf1706 : Mambo logo not removed from admin images - # Fixed artf1708 : Search CMT: Hardcoded date format - # Fixed artf1689 : Joomla! Installer - Wording still not correct - # Fixed artf1692 : email and print buttons (maybe also the PDF) does not validate - -19-Oct-2005 Andrew Eddie - # Fixed missing autoclear in "list-item" stock template - -19-Oct-2005 Rey Gigataras - # Fixed artf1577 : MenuLink Blog section error - -19-Oct-2005 Levis Bisson - Applyed Feature Requests: -^ Artifact artf1282 : Easier sorting of static content in creating menu links -^ Artifact artf1162 : Remove hardcoding of <<, <, > and >> in pageNavigation.php - ----------------- 1.0.3 Released -- [14-Oct-2005 10:00 UTC] ------------------ - -Contains following Security Fixes -Medium Level Threat - * Fixed SQL injection bug in content submission (thanks Dead Krolik) - -Low Level Threat - * Fixed securitybug in admin.content.html.php when 2 logged in and try to edit the same content - * Fixed Search Component flooding, by limiting searching to between 3 and 20 characters - * Fixed artf1405 : Joomla shows Items to unauthorized users - -------- - -14-Oct-2005 Rey Gigataras - # Fixed edit icon not showing on frontpage - # Fixed artf1553 : database.php fails to pass resource id into mysql_get_server_info() call - # Fixed artf1560 : Install1.php doesn't enforce rule against old_ table prefix - -13-Oct-2005 Andy Miller - # Fixed artf1504 : rhuk_solarflare_ii Template | Menus with " not displaying correctly - -13-Oct-2005 Rey Gigataras - # Fixed duplicated module creation in install - # Fixed XHTML issue in rss feed module - # Fixed XHTML issue in com_search - # Fixed artf1550 : Properly SEFify com_registration links - # Fixed artf1533 : rhuk_solarflare_ii 2.2 active_menu - # Fixed artf1354 : Can't create new user - # Fixed artf1433 : Images in Templates - # Fixed artf1531 : RSS Feed showing wrong livesite URL - -12-Oct-2005 Marko Schmuck - * SECURITY [ Low Level ]: Fixed security bug in admin.content.html.php when 2 logged in and try to edit the same content - -12-Oct-2005 Johan Janssens - # Fixed artf1266 : gzip compression conflict - # Fixed artf1453 : Weblink item missing approved parameter - # Fixed artf1452 : Error deleting Language file - # Fixed artf1373 : Pagination error - -12-Oct-2005 Rey Gigataras - ^ Core now automatically calculates the offset between yourself and the server - # Fixed bug in Global Config param `Time Offset` - # Fixed artf1414 : Missing images in HTML_toolbar - # Fixed artf1513 : PDF format does not work at version 1.0.2 - -11-Oct-2005 Rey Gigataras - * SECURITY [ Low Level ]: Fixed Search Component flooding, by limiting searching to between 3 and 20 characters - ^ Blog - Content Category Archive will no longer show dropdown selector when coming from Archive Module - # Fixed artf1470 : Archives not working in the front end - # Fixed artf1495 : Frontend Archive blog display - # Fixed artf1364 : TinyMCE loads wrong template styles - # Fixed artf1494 : Template fault in offline preview - # Fixed artf1497 : mosemailcloak adds trailing space - # Fixed artf1493 : mod_whosonline.php - -09-Oct-2005 Rey Gigataras - * SECURITY [ Medium Level ]: Fixed SQL injection bug in content submission - * SECURITY [ Low Level ]: Fixed artf1405 : Joomla shows Items to unauthorized users - # Fixed artf1454 : After update email_cloacking bot is always on - # Fixed artf1447 : Bug in mosloadposition mambot - # Fixed artf1483 : SEF default .htaccess file settings are too lax - # Fixed artf1480 : Administrator type user can loggof Super Adminstrator - # Fixed artf1422 : PDF Icon is set to on when it should be off - # Fixed artf1476 : Error at "number of Trashed Items" in sections - # Fixed artf1415 : Wrong image in editList() function of mosToolBar class - -08-Oct-2005 Johan Janssens - # Fixed artf1384 : tinyMCE doesnt save converted entities - -07-Oct-2005 Andy Miller - # Fixed tabpane css font issue - -07-Oct-2005 Johan Janssens - # Fixed artf1421 : unneeded file includes\domit\testing_domit.php - -07-Oct-2005 Andy Stewart - # Fixed artf1382 : Added installation check to ensure "//" is not generated via PHP_SELF - # Fixed artf1439 : Used correct ErrorMsg function and updated javascript redirect to remove POSTDATA message - # Fixed artf1400 : Added a check of $other within com_categories to skip section exists check if set to "other" - -05-Oct-2005 Robin Muilwijk - # Fixed artf1366 : Typo in admin, Adding a new menu item - Blog Content Category - ----------------- 1.0.2 Released -- [02-Oct-2005 16:00 UTC] ------------------ - -02-Oct-2005 Rey Gigataras - ^ Added check to mosCommonHTML::loadOverlib(); function that will stop it from being loaded twice on a page - # Fixed Content display not honouring Section or Category publish state - # Fixed artf1344 : Link to menu shows wrong menu type - # Fixed artf1189 : Long menu names get truncated, duplicate menus made - # Fixed artf1192 : Unpublished Bots - # Fixed artf1223 : Error with Edit items in categories and sections - # Fixed artf1219 : Joomla Component Module displays Error! - # Fixed artf1183 : Section module: Still "no items to display" - # Fixed artf1241 : Editing content fails with MySQL 5.0.12b - # Fixed artf1306 : modules - parameters of type text not stored correctly - -01-Oct-2005 Andy Miller - # Fixed base href in Content Preview for broken images - -01-Oct-2005 Johan Janssens - ^ Updated TinyMCE editor to version RC 3 - # Fixed artf1221 : Unable to Submit Content (still not working post-patch) - # Fixed artf1108 : Tooltips on mouseover causes parameter panel to widen - # Fixed artf1217 : WYSIWYG-Editor and mospagebreak with 2 parameters - -01-Oct-2005 Andy Stewart - # Fixed artf1305 - Added a check within mosimage mambot for introtext being hidden - # Fixes artf1343 - Removed xml declaration at top of gpl.html - -01-Oct-2005 Arno Zijlstra - ^ Changed OSM banner 2 a little to show banner changing - -01-Oct-2005 Levis Bisson - # Fixed artf1311 : Banners not showing / returning PHP error - # Fixed artf1319 : Banners not showing in frontend / admin - -30-Sep-2005 Andy Miller - # Fixed poor rendering of fieldset with solarflare2 - ^ Updated solarflare2 template with new colors and logos - ^ Moved modules to divs, and shuffled pathway to give more button room - ^ Updated favicon and other Joomla! logos for admin - # Fixed alignment of footer in admin for safari/opera - -30-Sep-2005 Andy Stewart - + Updated installation routine to recognise port numbers other than 80 - # Fixed artf1293 : added $op=mosGetParam so sendmail is called when running globals.php-off - -30-Sep-2005 Rey Gigataras - ^ Module Manager `position` dropdown ordering alphabetically - ^ Ability to Hide feed title for `New` modules used to display feeds - ^ Content Items `New` button sensitive to dropdown filters - # Fixed Seach Module not using Itemid of existng `Seach` component menu item - # Fixed `Link to Menu` problem with Sections menu ordering - # Fixed `Link to Menu` problem with Category = `Content Category` - # Fixed artf1300 : PDF shows Author name despite setting content item - -30-Sep-2005 Levis Bisson - + Added UTF-8 support - # Fixed tooltips empty links - # Fixed artf1265 : url in 'edit-menue-item' of submenues is wrong - # Fixed artf1277 : News Feed Display Bad Accent character - -29-Sep-2005 Arno Zijlstra - # Fixed publish/unpublish select check in contacts - -29-Sep-2005 Rey Gigataras - # Fixed artf1276 : tiny mce background - # Fixed artf1281 : Bad name of XML file - # Fixed artf1180 : Call-by-reference warning when editing menu - # Fixed artf1188 : includes/vcard.class.php uses short open tags - -29-Sep-2005 Levis Bisson - # Fixed artf1274 : Module display bug when using register/forgot password links - # Fixed artf1238 : header("Location: $url")- some servers require an absolute URI - -28-Sep-2005 Levis Bisson - # Fixed artf1250 : Order is no use when many pages - # Fixed artf1254 : Unable to delete when count > 1 - # Fixed artf1248 : Invalid argument supplied for 3P modules - -27-Sep-2005 Arno Zijlstra - # Fixed artf1253 : Apply button image path - # Fixed artf1240 : WITH FIX: banners component - undefined var task - # Fixed artf1242 : Problem with "Who's online" - # Fixed artf1218 : 'Search' does not include weblinks? - -25-Sep-2005 Emir Sakic - # Fixed artf1185 : globals.php-off breaks pathway - # Fixed artf1196 : undefined constant categoryid - # Fixed artf1216 : madeyourweb no TAG - -24-Sep-2005 Rey Gigataras - ^ artf1214 : pastarchives.jpg seems unintuitive. - -22-Sep-2005 Rey Gigataras - + Added Version Information to bottom of joomla_admin template, with link to 'Joomla! 1.0.x Series Information' - # Fixed artf1175 : Create catagory with selection of Section - # Fixed artf1179 : Custom RSS Newsfeed Module has nested - ----------------- 1.0.1 Released -- [21-Sep-2005 16:30 UTC] ------------------ - -21-Sep-2005 Rey Gigataras - # Fixed artf1157 : Section module: Content not displayed, wrong header - # Fixed artf1159 : Can't cancel "Submit - Content" menu item type form - # Fixed artf1172 : "Help" link in Administration links to Mamboserver.com - # Fixed artf1171 : mod_related_items shows all items twice - # Fixed artf1167 : Component - Search - # Fixed [RC] incorrect redirect when cancelling from Frontend 'Submit - Content' - # Fixed undefined variable in Trash Manager - # Fixed [RC] `Trash` button when no item selected - # Fixed [RC] `New` Menu Item Type `Next` button bug - -20-Sep-2005 Levis Bisson - ^ added a chmod to the install unlink function - # Fixed artf1150 : the created_by on initial creation of Static Content Item - -20-Sep-2005 Marko Schmuck - ^ Changed Time Offsets to hardcoded list with country/city names - -20-Sep-2005 Rey Gigataras - # Fixed /installation/ folder check - # Fixed artf1153 : Quote appears in com_poll error - # Fixed artf1151 : empty span - # Fixed artf1089 : multile select image insert reverses list order - # Fixed artf1138 : Joomla allows creation of double used username - # Fixed artf1133 : There is no install request to make /mambot/editor writeable - -19-Sep-2005 Andrew Eddie - # Fixed incorrect js function in patTemplate sticky and ordering templates/links - -19-Sep-2005 Rey Gigataras - ^ Changed Overlib styling when creating new menu items - ^ Additional Overlib info for non-image files and directories - ^ 'Cancel' button for Media Manager - ^ Option to run TinyMCE in compressed mode - off by default - # Fixed artf1111 : mosShowHead and the order of headers - # Fixed artf1117 : database.php - bcc - # Fixed artf1114 : database.php _nullDate - # Fixed TinyMCE errors caused by use of compressed tinymce_gzip.php [artf1088||artf1034||artf1090||artf1044] - # Installed Editor Mambots are now published by default - # Fixed error in RSS module - # Fixed artf1106 : Default Editor Will Not Take Codes Like Java Script - # Fixed delete file in Media Manager - -18-Sep-2005 Arno Zijlstra - # Fixed artf1084 :
    stays in empty content - # Fixed artf1101: Typo in Global Config - -18-Sep-2005 Andrew Eddie - # Fixed issues in patTemplate Translate Function and Modifier - # Fixed issue with patTemplate variable for Tabs graphics - -18-Sep-2005 Rey Gigataras - # Fixed artf1046 : Menu Manager Item Publishing - # Fixed artf1036 : newsflash error when logged in in frontend - # Fixed artf1033 : madeyourweb template logo path - # Fixed artf1039 : & to & translation in menu and contenttitle - # Fixed PHP5 passed by reference error in admin.content.php - # Fixed artf1068 : live bookmark link is wrong - # Fixed artf1030 : Bug Joomla 1.0.0 Stable (un)publishing News Feeds - # Fixed artf1048 : Custom Module Bug - # Fixed artf1080 : Joomla! Installer - # Fixed artf1050 : error in sql - database update - # Fixed artf1081 : com_categories can't edit category when clicking hyperlink - # Fixed artf1053 : Can not unassign template - # Fixed artf1079 : com_weblinks can't edit links - # Fixed artf1029 : Site -> Global Configuration = greyed out top menu - # Fixed artf1064 : Deletion of Modules and Fix - # Fixed artf1052 : Double Installer Locations - # Fixed artf1051 : Copyright bumped to the right of the site - # Fixed artf1059 : component editor bug - # Fixed artf1041 : mod_mainmenu.xml: escape character for apostrophe missing - # Fixed artf1040 : category manager not in content-menu - -17-Sep-2005 Levis Bisson - # Fixed artf1037: Media Manager not uploading - # Fixed artf1025: Registration admin notification - # Fixed artf1043: Template Chooser doesn't work - # Fixed artf1042: Template Chooser shows rogue entry - ----------------- 1.0.0 Released -- [17-Sep-2005 00:30 UTC] ------------------ - -Contains following Security Fixes -Medium Level Threat - * Fixed SQL injection bugs in user activation (thanks Enno Klasing) - -Low Level Threat - * Fixed [#6775] Display of static content without Itemid - -------- - -16-Sep-2005 Andrew Eddie - # Fixed: 1014 : & amp ; in pathway - # Fixed: Missing space in mosimage IMG tags - # Fixed: Incomplete function call - mysql_insert_id() - + Added nullDate handling to database class - + Added database::NameQuote function for quoting field names - # Fixed: com_checkin to properly use database class - # Fixed: Missed stripslashes in`global configuration - site` - + Added admin menu item to clear all caches (for 3rd party addons) - -16-Sep-2005 Emir Sakic - # Fixed sorting by author on frontend category listing - + Added time offset to copyright year in footer - # Fixed spelling in sam - # Reflected some file name changes in installer CHMOD - # Fixed bugs in paged search component - -16-Sep-2005 Alex Kempkens - + template contest winner 'MadeYourWeb' added - -16-Sep-2005 Rey Gigataras - + Pagination Support for Search Component - ^ Ordering of Toolbar Icons/buttons now more consistent - ^ Frontend Edit, status info moved to an overlib - ^ Search Component converted to GET method - # Fixed artf1018 : Warning Backend Statistic - # Fixed artf1016 : Notice: RSS undefined constant - # Fixed artf1020 : Hide mosimages in blogview doesn't work - # Various Search Component Fixes - # Fixed Search Component not honouring Show/Hide Date Global Config setting - # Fixed [#6668] No static content edit icon for frontend logged in author - # Fixed [#6710] `Link to menu` function from components Category not working - # Fixed [#7011] Subtle bug in saveUser() - admin.users.php - # Fixed [#7120] Articles with `publish_up` today after noon are shown with status `pending` - # Fixed [#6669] mosmail BCC not working, send as CC - # Fixed [#7422] Weblink submission emails - # Fixed [#7196] mosRedirect and Input Filter CGI Error - # Fixed [#6814] com_wrapper Iframe Name tag / relative url modifications - # Fixed [#6844] rss version is wrong in the Live Bookmark feeds - # Fixed [#7120] Articles with `publish_up` today after noon are shown with status `pending` - # Fixed [#7161] Apparently unncessary code in sendNewPass - registration.php - -15-Sep-2005 Andy Miller - ^ Fixed some width issues with Admin template in IE - ^ Fixed some UI issues with Banners Component - ^ Added a default header image for components that don't specify one - -15-Sep-2005 Andrew Eddie - - Removed unused globals from joomla.php - + Added mosAbstractLog class - -15-Sep-2005 Rey Gigataras - + added `Apply` button to frontend Content editing - ^ Added publish date to syndicated feeds output [credit: gharding] - ^ Added RSS Enclosure support to feedcreator [credit: Joseph L. LeBlanc] - ^ Added Google Sitemap support to feedcreator - ^ Modified layout of Media Manager - ^ Added Media Manager support for XCF, ODG, ODT, ODS, ODP file formats - # Fixed use of 302 redirect instead of 301 - # Content frontend `Save` Content redirects to full content view - # Fixed Wrapper auto-height problem - # Queries cleaned of incorrect encapsulation of integer values - # Fixed Login Component redirection [credit: David Gal] - -15-Sep-2005 Arno Zijlstra - ^ changed tab images to fit new color - ^ changed overlib colors - -14-Sep-2005 Rey Gigataras - ^ Ugraded TinyMCE [2.0 RC2] - ^ Param tip style change to dashed underline - # Queries cleaned of incorrect encapsulation of integer values - -14-Sep-2005 Andrew Eddie - # Added PHP 5 compatibility functions file_put_contents and file_get_contents - + Added new version of js calendar - + mosAbstractTasker::setAccessControl method - + mosUser::getUserListFromGroup - + mosParameters::toObject and mosParameters::toArray - -13-Sep-2005 Andrew Eddie - ^ Rationalised global configuration handling - # Fixed polls access bug - # Fixed module positions preview to show positions regardless of module count - ^ Modified database:setQuery method to take offset and record limit - + Added alternative version of globals.php that emulates register_globals=off - # Added missing parent_id field from mosCategory class - -12-Sep-2005 Rey Gigataras - + Per User Editor selection - # Module styling applied to custom/new modules - # Fixed Agent Browser bug - -12-Sep-2005 Andrew Eddie - + New onAfterMainframe event added to site index.php - + Added dtree javascript library - + Added some extra useful toolbar icons - + Added css for fieldsets and legends and some 1.1 admin style formating - + Added mosDBTable::isCheckedOut() method, applied to components - # fixed bug in typedcontent edit - checked out is done before object load and always passes - ^ Updated Help toolbar button to accept component based help files - ^ Updated version class with new methods - + Added support for params file to have root tag - -12-Sep-2005 Andy Stewart - # Fixed issue with new content where Categories weren't displayed for sections - -12-Sep-2005 Andrew Eddie - ^ Upgrade DOMIT! and DOMIT!RSS (fixes issues in PHP 4.4.x) - + Added database.mysqli.php, a MySQL 4.1.x compatible version - + Added [Check Again] button to installation check screen - ^ Changed web installer to always use the database connector - # Fixed PHP 4.4 issues with new objects returning by reference - -11-Sep-2005 Rey Gigataras - + Output Buffering for Admin [pulled from Johan's work in 1.1] - + Loading of WYSIWYG Editor only when `editorArea` is present [pulled from Johan's work in 1.1] - ^ Upgraded JSCookMenu [1.4.3] - ^ Upgraded wz_tooltip [3.34] - ^ Upgraded Overlib [4.21] - ^ editor-xtd mosimage & mospagebreak button hidden on category, section & module pages - # Poll class $this-> bug - # Fixed change creator dropdown to exclude registered users (who do not have author rights) - -11-sep-2005 Arno Zijlstra - + Added offlinebar.php - ^ Changed site offline check - ^ Cosmetic change to offline.php - -11-Sep-2005 Andrew Eddie - + Added sort up and down icons - + Added mosPageNav::setTemplateVars method - -10-Sep-2005 Rey Gigataras - + `Submit - Content` menu type [credit: Jason Murpy] - -09-Sep-2005 Andy Miller - ^ made changes to new joomla admin template - ^ changed login lnf to match new admin template - ^ removed border and width, set padding on div.main in admin - ^ changed Force Logout text - -09-Sep-2005 Alex Kempkens - ^ changed mosHTML::makeOption to handle different coulmn names - ^ corrected several calls from makeOption in order to become multi lingual compatible - ^ corrected little fixes in query handling in order to get multi lingual compatible - + Added system bot's for better integration of ml support, ssl & multi sites - -08-Sep-2005 Rey Gigataras - + Added back Sys Info link in menubar - + Added Changelog link to Help area - ^ Cosmetic change to Toolbar Icon appearance - ^ Cosmetic change to QuickIcon appearance - ^ Toolbar icons now 'coloured' no longer 'greyed out' - ^ Dropdown menu now shows on edit pages but is inactive - # Fixed Newsfeed component generates image tag instead of img tag - # Fixed Joomlaxml: tooltips need to use label instead of name - # Fixed One parameter too many in orderModule call in admin.modules.php - # Fixed inabiility to show/hide VCard - # Fixed Mambot Manager filtering - -08-Sep-2005 Alex Kempkens - + mosParameter::_mos_filelist for xml parameters - ^ mos_ table prefix to jos_ in installation and in some other files. - + added category handling for contact component - + added color adapted joomla_admin template - -07-Sep-2005 Andrew Eddie - # Added label tags to mod_login (WCAG compliance) - # Added label tags to com_contact (WCAG compliance) - # Added label tags to com_search (WCAG compliance) - # Added label tag support to mosHTML::selectList (WCAG compliance) - # Added label tag support to mosHTML::radioList (WCAG compliance) - -01-Sep-2005 Andrew Eddie - + Added article_separator span after a content item - * SECURITY [ Critical Level ]: Hardened mosGetParam by using phpInputFilter for NO_HTML mode - + Added new mosHash function to produce secure keys - * SECURITY [ Low Level ]: Hardened Email to Friend form - -31-Aug-2005 Andrew Eddie - + Added setTemplateVars method to admin pageNavigation class - ^ Added auto mapping function to mosAbstractTasker constructor - + Added patHTML class for patTemplate utility methods - ^ Upgraded patTemplate library - ! patTemplate::createTemplate has changed parameters - - Removed requirement to accept GPL on installation - # Fixed bug in Send New Password function - mail from not defined - # Fixed undefined $row variable in wrapper component - # Fixed undefined $params in contacts component - - Removed unused getids.php - - Removed redundant whitespace - ^ Convert 4xSpace to tab - -08-Aug-2005 Andrew Eddie - * SECURITY [ Medium Level ]: Fixed SQL injection bugs in user activation (thanks Enno Klasing) - ^ Encased text files in PHP wrapper to help obsfucate version info - # Changed admin session name to hash of live_site to allow you to log into more than one Joomla! on the same host - # Fixed hardcoded (c) character in web installer files - # Fixed slow query in admin User Manager list screen - # Fixed bug in poll stats calculation - # Updated bug fixes in phpMailer class - # Fixed login bug for nested Joomla! sites on the same domain - -02-Aug-2005 Alex Kempkens - * SECURITY [ Low Level ]: Fixed [#6775] Display of static content without Itemid - # Fixed [#6330] Corrected default value of field - ------ Derived from Mambo 4.5.2.3 circa. 17 Aug 12005 ----- - -2. Copyright and disclaimer ---------------------------- -This application is opensource software released under the GPL. Please -see source code and the LICENSE file + +1. Copyright and disclaimer +--------------------------- +This application is opensource software released under the GPL. Please +see source code and the LICENSE file + + +2. Changelog +------------ +This is a non-exhaustive (but still near complete) changelog for +Joomla! 1.0, including beta and release candidate versions. +Our thanks to all those people who've contributed bug reports and +code fixes. + +Legend: + +* -> Security Fix +# -> Bug Fix ++ -> Addition +^ -> Change +- -> Removed +! -> Note + + +---------------- 1.0.10 Stable Released -- [26-June-2006 00:00 UTC] ------------------ + + +This Release Contains following Security Fixes + +Joomla! utilizes the Open Web Application Security Project (OWASP) web application security system to categorize security vunerabilities found within Joomla! +http://www.owasp.org/index.php/OWASP_Top_Ten_Project + + +03 HIGH Level Threats fixed in 1.0.10 + +A1 Unvalidated Input + * A1 - Secured `Remember Me` functionality against SQL injection attacks + * A1 - Secured `Related Items` module against SQL injection attacks + * A1 - Secured `Weblinks` submission against SQL injection attacks + + +01 MEDIUM Level Threats fixed in 1.0.10 + +A4 Cross Site Scripting + * A4 - Secured SEF from XSS vulnerability + + +05 LOW Level Threats fixed in 1.0.10 + +A1 Unvalidated Input + * A1 - Hardened frontend submission forms against spoofing + * A1 - Secured mosmsg from misuse + * A1 - Hardened mosgetparam by setting variable type to integer if default value is detected as numeric + +A4 Cross Site Scripting + * A4 - Secured com_messages from XSS vulnerability + * A4 - Secured getUserStateFromRequest() from XSS vulnerability + +-- -- -- + + +25-June-2006 Rey Gigataras + # SECURITY A1 [ Low Level ]: mosgetparam sets variable type to integer if default value is detected as numeric + + # Fixed [artf5091] : Missing closing "}" in one of PatFactory templates + # Fixed [topic,71858] : Content Archive issue when caching on + # Fixed [topic,71859] : Unable to login frontend + # Fixed [topic,67902] : SEF.php breaking community builder homepages + + +23-June-2006 Rey Gigataras + # SECURITY A1 [ Low Level ]: mosmsg hardened + + # Fixed [artf5059] : Blog ordering, items by - most hits + # Fixed [artf4969] : Missing Itemid in readmore with multi category blog + # Fixed [artf5083] : Problem with Description/Description Image parameters of "List - Content Section" + # Fixed [topic,67719] : Email Cloaking Ads extra space after cloaked address + # Fixed [topic,66966] : E-mailing Cloaking Issue + # Fixed [topic,67141] : pathway empty when showing poll results + # Fixed [topic,67068] : Caching of Custom Heads still not working (not a full fix) + + +21-June-2006 Alex Kempkens + # Fixed [artf5051] : Making cache aware of different languages + ! Be aware that it is now important to include all parameters, even optional once, in the cached calls. + + +21-June-2006 David Gal + # Fixed [topic,66858] : Can't set language + + +21-June-2006 Rey Gigataras + # SECURITY A4 [ Medium Level ]: XSS vulerability when using SEF + # SECURITY A4 [ Low Level ]: XSS vulerability in com_messages + # SECURITY A4 [ Low Level ]: XSS vulerability in getUserStateFromRequest() + + # Fixed [artf4976] : htaccess file instructions confusing users + # Fixed [artf4917] : PHP getenv function fails in ISAPI mode + # Fixed [topic,69083] : mambots not being applied to `User` Module content + # Fixed [topic,69894] : Filter doesn't work when cache on + + +20-June-2006 Rey Gigataras + # Fixed [artf5025] : Category Titles with an Apostraphe leave a leading slash + # Fixed [artf4927] : blocked user receives wrong error message + # Fixed [topic,70612] : Very small text error in file sample_data.sql + # Fixed [topic,69871] : mossef notice + # Fixed [topic,68031] : Problems with banner.php + # Fixed [topic,67826] : content.html weblinks.html display issues in Opera + # Fixed [topic,67594] : Extra space in content.html.php + # Fixed [topic,67016] : ATOM 0.3 Always enable even I disable ATOM 0.3 in Administrator Panel + + +19-June-2006 Rey Gigataras + # SECURITY A1 [ High Level ]: `Remember Me` functionality SQL injection vulnerability + # SECURITY A1 [ High Level ]: `Related Items` module SQL injection vulnerability + # SECURITY A1 [ High Level ]: `weblinks` submission SQL injection vulnerability + # SECURITY A1 [ Low Level ]: frontend submission forms hardened against spoofing + + # Fixed [artf5031] : Frontend Editing of Content Changes Start Publishing Time + # Fixed [artf4951] : author submitting content gets error message + # Fixed [artf5028] : Page navigation incorrect on pages viewed through archive module + + +16-June-2006 Rey Gigataras + # Fixed [artf5006] : Contact-item print button + # Fixed [artf4925] : alt="" not always output 1.0.9 + # Fixed [artf4921] : anchor links break + # Fixed [artf4888] : too many columns in table layout of params + # Fixed [topic,66859] : Table views of content category in backend + # Fixed [topic,68201] : Permissions check page missing /mambots/system/ + # Fixed [topic,67115] : Error warning frontend.php + # Fixed [topic,67144] : Check for status of SEF in mossef incorrectly commented out + # Fixed [topic,67279] : Voting/Rating not working when disabled globally, but enabled locally for selected items + + # PERFORMANCE [topic,63468] : mod_fullmenu unnecessary count of archived items in section query + + +12-June-2006 Rey Gigataras + # Fixed [artf4913] : Poll Module breaks "Add Article" + # Fixed [artf4929] : Finish date not shown + # Fixed [artf4881] : Extra space in English email text string + # Fixed [topic,68467] : If 2 polls published - voiting on second poll not work + + +10-June-2006 Robin Muilwijk + # Fixed [topic,68168] : Typo /administrator/components/com_content/admin.content.html.php - line 478 + # Fixed [topic,68168] : Typo /administrator/components/com_typedcontent/admin.typedcontent.html.php - line 266 + + +---------------- 1.0.9 Stable Released -- [05-June-2006 16:00 UTC] ------------------ + + +This Release Contains following Security Fixes + +Joomla! utilizes the Open Web Application Security Project (OWASP) web application security system to categorize security vunerabilities found within Joomla! +http://www.owasp.org/index.php/OWASP_Top_Ten_Project + + +12 Low Level Threats fixed in 1.0.9 + +A1 Unvalidated Input + * A1 - Harden mosmsg + * A1 - Hardening of backend `User Manager` to stop 'Adminstrators' from being able to create 'Super Administrator' users + +A2 Broken Access Control + * A2 - Breadcrumbs title visibility even when access restricted + * A2 - 'Edit Your Details' page now needs a published menu item to be accessible + * A2 - 'Check-In My Items' page now needs a published menu item to be accessible + * A2 - 'Submit News' page now needs a published menu item to be accessible + * A2 - 'Submit Weblink' page now needs a published menu item to be accessible + * A2 - Add ability to selectively disable certain types of syndicated feeds + * A2 - Ensure module caching does not inadvertently make special level modules visible to registered users + * A2 - Add ability to totally disable access to frontend login page + * A2 - Add ability to disable frontend user params + +A3 - Broken Authentication and Session Management + * A3 - Changes to access level of user account will kill any active session for that user + +-- + + +04-June-2006 Rey Gigataras + # Fixed [artf4878] : inlegal dates in mysqll tables + # Fixed : missing content cache clearing calls + + +03-June-2006 Rey Gigataras + # Fixed [artf4864] : /includes/frontend.php + # Fixed [topic,66138] : Invailid Session at Admin login + # Fixed [topic,66044] : Installation checks + # Fixed [topic,66276] : admin password ="0" + # Fixed : No ability to set Cache time for Syndication modules + # Fixed : `Remember Expired Admin page` functionality changed from 600 seconds to half the `Admin Session Lifetime` value + # Fixed : Admin session purge (to limit only one active session per account) deleting frontend logged in session + + +03-June-2006 Robin Muilwijk + # Fixed [topic,66360] : Fatal error com_contact/contact.php + + +01-June-2006 Rey Gigataras + # Fixed : New Global Config params (added in 1.0.9) not created on clean install + + +31-May-2006 Rey Gigataras + # SECURITY A2 [ Low Level ]: New `Global Config` param to allow disabling of Frontend Login + # SECURITY A2 [ Low Level ]: New `Global Config` param to allow disabling of Frontend User params + + # Fixed [artf4844] : initial setup failure on IIS when installed in subdirectory + # Fixed [topic,65009] : "Email to Friend" Can Send Unusable URLs + # Fixed [topic,65604] : Notices when adding static content + # Fixed [topic,65485] : Bug with menu item selector + # Fixed : DB error when attempting a checkin action after cancelling from creating a New item + + +30-May-2006 Rey Gigataras + # Fixed [topic,65381] : Override Created Date + # Fixed [artf4830] : top menu items reversed in madeyourweb template + + +29-May-2006 Rey Gigataras + # SECURITY A2 [ Low Level ]: [artf4752] : caching makes modules assigned to special user visible to registered users + + # Fixed [artf4812] : In footer.php (C) should be © + # Fixed [artf4806] : typo in mambots/search/contacts.searchbot.php causes sef errors + # Fixed [artf4752] : patTemplate strip comments problems + # Fixed [artf4752] : rss.php unnecessary logic code check + # Fixed [topic,64994] : problem with related items + # Fixed [topic,64046] : adding new content Frontend fails with Authorization Error + + +27-May-2006 Rey Gigataras + # Fixed [topic,64308] : cache and content items on frontpage + # Fixed [topic,63824] : Notice on com_contact + # Fixed [artf4801] : inputFilter::filterTags prints unexpected text + + +23-May-2006 Rey Gigataras + # Fixed [topic,63674] : MySQL 5 strict mode in Admin Backend + + +22-May-2006 Rey Gigataras + # PERFORMANCE [topic,63468] : slow auto-login because of new MD5 calculations on whole users DB + + # Fixed [topic,63446] : Category and Section + + +21-May-2006 Rey Gigataras + # Fixed [artf4714] : Can't add Menu Item :: Link - Static Content + # Fixed : "Unique Itemid" handling for `Link - Content Item` + # Fixed : Add "Unique Itemid" handling for `Link - Static Content` + # Fixed [artf4714] : Can't add Menu Item :: Link - Static Content + # Fixed [topic,62056] : Copyright date + + +20-May-2006 Rey Gigataras + # Fixed [artf4733] : Module Manager reorder via save button broken + # Fixed [artf4736] : Quotation marks in Site Name + # Fixed [topic,63257] : Notice when creating new category + + +18-May-2006 Rey Gigataras + # Fixed [artf4700] : pathway ampReplaces item name twice + # Fixed [artf4712] : 'type' of $mosConfig_error_reporting does not match code + + + Remember Expired Admin page functionality + + +17-May-2006 Rey Gigataras + # Fixed [artf4673] : setlocale + # Fixed [artf4685] : unhandled fragment identifier with core SEF enabled + # Fixed [artf4678] : Print, PDF and email buttons aren't accessible + # Fixed [topic,62124] : Hover for icons when editing content in front-end + # Fixed [topic,62165] : Canot login - admin_session_life not set + + +15-May-2006 Rey Gigataras + # Fixed [topic,61926] : Frontend static language text + # Fixed [topic,61971] : E-mail cloaking broken, TinyMCE `mce_href` problem + # Fixed : Frontend Content editing does not display correct publishing date/time + # Fixed : Frontend Content editing incorrect handling of 'Never' in `Finish Publishing` + # Fixed : Incorrect date/time values on `Content Items Manager` and `Static Content Manager` pages + + +14-May-2006 Rey Gigataras + * SECURITY A2 [ Low Level ]: add ability to selectively disable certain types of syndicated feeds + + ^ Upgrade to TinyMCE 2.0.6.1 + + # Fixed [topic,61897] : Changing any parameter for logged user returns to login screen + + +13-May-2006 Rey Gigataras + * SECURITY A1 [ Low Level ]: [artf4529] : User with access to administration area can easly create super administrator. + + # Fixed [artf4555] : Slight Bug in registration system + # Fixed [artf4641] : Module sites with one template - modules should not show up - itemid issue + # Fixed : `Itemid=99999999` appearing in next & prev navigation links + # Fixed : `Itemid=` appearing in `Blog` links items + + +13-May-2006 Andrew Eddie + # Fixed [artf3302] : PatTemplate custom Functions getpage() undefined + + +12-May-2006 Louis Landry + # Fixed [artf4284] : database::load() resets private properties + + +12-May-2006 Rey Gigataras + # Fixed [topic,60970] : Finish Publishing Time not working as expected + + +11-May-2006 Rey Gigataras + # Fixed [artf4614] : Warning in mosCreateGUID + # Fixed [artf4619] : task=category shows unpublished items + # Fixed [artf4621] : Media manager with long filenames = no button + # Fixed [artf4613] : Sub Menu Item deletion Security Bug + # Fixed [artf4613] : Restoring menu items without a valid parent + # Fixed [topic,59258] : bug when editing user profile + # Fixed [topic,61190] : Menu Item Inconsistency + + +10-May-2006 Sam Moffatt + # Fixed issue with login directly after activation causing error, now redirects to index.php + + +09-May-2006 Rey Gigataras + # Fixed [artf4577] : saveUser in com_user has incorrect escaping for password + + +28-Apr-2006 Alex Kempkens + # Fixed artf : Language loading incorrect in offline mode (related to Joom!Fish language changes) + + +27-Apr-2006 Rey Gigataras + + Support for restricting ability to access certain functionality for demo sites + + # Fixed [artf4527] : incorrect style in function botNoEditorEditorArea + # Fixed [topic,57926] : mod_poll.php Warning + + +26-Apr-2006 Rey Gigataras + # Fixed [artf3912] : Pear's cache lite and safe_mode + # Fixed [artf3711] : mosemailcloak generates invalid XHTML + # Fixed [artf3251] : Wrong file count in Media Manager + # Fixed [artf3196] : com_media does not properly manage file names with simple quotes (') + + +25-Apr-2006 Rey Gigataras + ^ PERFORMANCE [topic,54215] : MOSimage array affects edit page load time + + +24-Apr-2006 Rey Gigataras + * SECURITY A3 [ Low Level ]: logged in user session are not affected by changes of user account + + # Fixed [artf4503] : Hardcoded text in page navigation + # Fixed [artf4473] : Bad char in search + # Fixed [artf4499] : Editing Quotated Menu Item + # Fixed [artf4472] : Creating New User system message only sends to superusers + # Fixed : Unable to 'Delete' `Super Administrator` - with check to ensure at least one active `Super Administrator` still exists + # Fixed : Unable to 'change' group of `Administrator` & `Super Administrator` - with check to ensure at least one active `Super Administrator` still exists + + +20-Apr-2006 Rey Gigataras + * SECURITY A3 [ Low Level ]: Allow only one session per user account in Admin Backend + + + Allow `save` and `apply` actions to be completed before logging out expired sessions + + +20-Apr-2006 Andrew Eddie + # Fixed slow query in com_polls + # Fixed return address errors in patErrorManager + # Fixed MySQL 5 error when saving menu items + + +18-Apr-2006 Rey Gigataras + + Javascript validation checks to mod_poll + + +16-Apr-2006 Rey Gigataras + # Fixed [artf4424] : gethostbyaddr(): Address is not a valid IPv4 or IPv6 address + # Fixed [artf4407] : Image preview doesn't work with custom directory + # Fixed [topic,54741] : Who's Online guest count increments with RSS feed access + + +14-Apr-2006 Rey Gigataras + # Fixed [artf4400] : Search: Itemid in mod_search also finds trashed Itemid's + # Fixed [artf4399] : Search title in com_search is never from language file + + +12-Apr-2006 Rey Gigataras + # Fixed [artf4346] : $mainframe->login($username,$pwd) compatibility broken + # Fixed : `body` parameter for mailto tags + + +11-Apr-2006 Rey Gigataras + # Fixed [artf4340] : Itemid on menu - multiple links to same content + # Fixed : cache support for `Blog - Content Section Archive` & `Blog - Content Category Archive` + # Fixed : SEF.php incorrect handling of `mailto` & `javascript` links + # Fixed : $shownoauth default value in `configuration.php-dist` + # Fixed : `live_bookmarks` not being disbaled properly by security check; + # Fixed : admin `contact` and `weblink` ordering + + +08-Apr-2006 Rey Gigataras + # Fixed [topic,45136.0] : stop Cache system from creating large amount of Cache files + # Fixed [artf4302] : 'Read more' link is always displayed if 'Linked Titles' option enabled + # Fixed [artf4304] : Bugs in search.html.php + # Fixed : Content Popup page behaviour + + +07-Apr-2006 Rey Gigataras + # Fixed [artf4294] : InputFilter failed escaping string + # Fixed [artf4050] : mod_mainmenu.php not setting id=active_menu + + +06-Apr-2006 Rey Gigataras + * SECURITY A2 [ Low Level ]: check for menu item added to 'Edit Your Details' page + * SECURITY A2 [ Low Level ]: check for menu item added to 'Check-In My Items' page + * SECURITY A2 [ Low Level ]: check for menu item added to 'Submit News' page + * SECURITY A2 [ Low Level ]: check for menu item added to 'Submit Weblink' page + + # Fixed [artf4282] : Extra Empty Menu Span Tags + + +05-Apr-2006 Rey Gigataras + # Fixed [artf4010] : When creating new module. Two modules are created when clicking save + + +02-Apr-2006 Rey Gigataras + # Fixed [artf3575] : Correction needed in stylesheet + # Fixed [artf4089] : Problem with domit, extended characters and PHP 5.0.2 + + +01-Apr-2006 Rey Gigataras + # Fixed [topic,50547.0.html] : Print statement left in class.inputfilter.php + # Fixed [topic,48908.0.html] : Duplicate usernames / Length Checking + + +31-Mar-2006 Rey Gigataras + # Fixed [topic,46614.0.html] : mod_templatechooser not working when templates name has dashes + + +30-Mar-2006 Rey Gigataras + * SECURITY A1 [ Low Level ]: [artf3702] : breadcrumbs: information gathering possible by simple urlhacks + + # Fixed [topic,47932.0.html] : 1.0.8 com_contact - incorrect URL? + + ^ Upgrade to Geshi 1.0.7.8 + + +29-Mar-2006 Rey Gigataras + # Fixed [artf4133] : Blog - Content Section Archive + # Fixed [artf4093] : No parameter tool tip when ' is used in module.xml + # Fixed [artf4028] : url to the site is added to the entered link in a menu item (SEF disabled) + # Fixed [artf4102] : mosimage.php - Erroneous right alignment of images + # Fixed [artf4131] : com_contact displays non-localized message + + ^ Upgrade to TinyMCE 2.0.5.1 + ^ Upgrade to TinyMCE compressor 1.0.8 + ^ TinyMCE remove `Help` tab in help popup + ^ TinyMCE 'word wrap' by default for html source mode + + +27-Mar-2006 Alex Kempkens + # corrcted searchbot; finding dynamic content while searching for static + # updated core-SEF support for new multilingual_content config var + + +24-Mar-2006 Alex Kempkens + + Check for mambot/system directory in installer and installation dialogs + # [artf4066] content sections not being translated + + +16-Mar-2006 Rey Gigataras + # Fixed [artf3913] : [artf3809]: Error with < AND > in tinymce - static content manager + # Fixed : checked out lock icon visible for same user + # Fixed : Global Config JS error when no session_type value yet set - issue only when upgrading + # Fixed [topic,44206.0.html] : XML help files no longer supported + + +15-Mar-2006 Rey Gigataras + # Fixed [artf3927] : Typo in Installer Screen + # Fixed [artf3940] : single quotes/apostrophes (') + # Fixed [topic,46202.0.html] : Problem found in Session id function + + +13-Mar-2006 Rey Gigataras + ^ PERFORMANCE : com_content only add call to jos_content_rating where voting option activated + + +12-Mar-2006 Rey Gigataras + # Fixed [topic,44117.0.html] : com_menumanager can not handle simple quotes (') + # Fixed [topic,34821.0.html] : Allow search on static contents not linked to a menu + + ^ PERFORMANCE : com_statistics `Search Engine Text` page, results returned off by default as highly query intensive and can cause site lockup + ^ `Page Hits` into `Content` sub-menu + + +11-Mar-2006 Alex Kempkens + # Fixed some queries missing primary key for translations (contact, newsfeed) + + +11-Mar-2006 Rey Gigataras + # Fixed [artf3873] : Invalid Itemid for com_content Category Link + # Fixed [topic,45343.0.html] : Random image default behavoir + + + PERFORMANCE : Auto purge of expired messages for com_messages [default of 7 days] + + +10-Mar-2006 Rey Gigataras + # Fixed [artf3885] : Remove the last hardcoded texts + # Fixed [artf3713] : Joomla still doesn't work with SQL mode enabled + + ^ Ensure showPathway is only called once + + +09-Mar-2006 Rey Gigataras + # Fixed [artf3863] : mod_whosonline double ONLINE + # Fixed [topic,44644.0.html] : Miss spelled Position as Postition + # Fixed [topic,41593.0.html] : Table - content section - filter works only for the first page + + +08-Mar-2006 Rey Gigataras + # Fixed [artf3847] : A mistake in joomla_admin template + # Fixed [artf3748] : Archive - Access Denied + # Fixed [artf3592] : Archive Pagination Problem + # Fixed [topic,41627.0.html] : "Undefined variable: filter" + # Fixed [topic,43315.0.html] : Static text in content.php + # Fixed [topic,41466.0.html] : NullDate AND '0000-00-00 00:00:00' + + ^ Global define of _CURRENT_SERVER_TIME + ^ sef.php optimization + + +07-Mar-2006 Rey Gigataras + + Show whether Cache directory is writable where it is used - com_newsfeeds, com_syndicate, custom modules + + # Fixed [artf3818] : Path error for agent_browser.php in joomla.php + # Fixed ensure all require and include calls are using absolute paths + + +06-Mar-2006 Rey Gigataras + # Fixed [artf3756] : mossef bot rewrites javascript:void(0) in href + # Fixed [artf3745] : includes/joomla.php on line 790 setSessionGarbageClean + # Fixed [topic,41619.0.html] : mosimage caption problem + # Fixed [topic,42023.0.html] : sample data error with Link - Static Content CID value + + +02-Mar-2006 Rey Gigataras + # Fixed [artf3728] : Error if change the "Syndicate" name in db table "jos_components" + # Fixed [artf3731] : mod_newsflash shows errors when no items are available + # Fixed [artf3733] : Site (frontend): url to the site is added to the entered link in a content item. + # Fixed [artf3696] : Typo Site Mambot: Edit [ TinyMCE WYSIWYG Editor ] + # Fixed [artf3658] : "New" Content Link/Image Showing With No Categories Present + # Fixed [artf3697] : sefreltoabs error with links to other sites + + +01-Mar-2006 Rey Gigataras + * SECURITY A1 [ Low Level ]: Harden mosmsg + + # Fixed [artf3656] : contact-component, dropdown + + +28-Feb-2006 Rey Gigataras + # Fixed [artf3655] : Login module error + # Fixed [artf3668] : mosemailcloak bug with mailto: + # Fixed [artf3681] : invalid markup in com_content showCategories() + # Fixed [artf3688] : Hardcoded text in contact.html.php + # Fixed [artf3664] : Image links gets preceeded by "Live Site" URL after v1.0.8 upgrade + # Fixed [artf3703] : configuration.php-dist has a typo + # Fixed [topic,41404.0.html] : configuration.php-dist missing `;` + + +---------------- 1.0.8 Stable Released -- [25-Feb-2006 04:00 UTC] ------------------ + +This Release Contains following Security Fixes + +Medium Level Threat + * Hardening of Remember Me login functionality + * Protect against real server path disclosure via syndication component + * Limit arbitrary file creation via syndication component + * Protect against real server path disclosure in mod_templatechooser + + * Disallow `Weblink` item from being accessible when 'unpublished' + * Disallow `Polls` item from being accessible when 'unpublished' + + * Disallow `Newfeeds` item from being accessible when category 'unpublished' + * Disallow `Weblinks` item from being accessible when category 'unpublished' + + * Disallow `Content` item from being accessible despite section/category 'access level' + * Disallow `Newsfeed` item from being accessible despite category 'access level' + * Disallow `Weblink` item from being accessible despite category 'access level' + + * Disallow `Content` item from being visible despite category 'access level' in `Content Section` view - `Blog - Content Section` & `Blog - Content Section Archive` + + * Disallow `Content` items from being viewable when category/section 'unpublished' - mod_newsflash + + + Low Level Threat + * Harden frontend Session ID + * Harden against multiple Admin SQL Injection Vulnerabilities + * Disable ability to enter more than one email address in Contact Component contact form + * Harden Contact Component with param option to check for existance of session cookie - enabled by default + * Addiotnal check for correct Admin session name + + * Disallow access to syndication functionality + * Disallow `Newsfeeds` Categories from being accessible when 'unpublished' + * Disallow `Contact` Categories from being accessible when 'unpublished' + * Disallow `Weblink` Categories from being accessible when 'unpublished' + * Disallow `Content Section` from being accessible when section 'unpublished' - `List - Content Section` + * Disallow `Content Category` from being accessible when category/section 'unpublished' - `Table - Content Category` + + * Disallow `Contact` Categories from being accessible as per category 'access level' + * Disallow `Newsfeeds` Categories from being accessible as per category 'access level' + * Disallow `Weblinks` Categories from being accessible as per category 'access level' + * Disallow `Content Section` from being accessible as per section 'access level' - `List - Content Section` + * Disallow `Content Category` from being accessible as per section/category 'access level' - `Table - Content Category` + * Disallow `Content Category` from being accessible as per category 'access level' - `Blog - Content Category` & `Blog - Content Category Archive` + + * Disallow `Content` item links from being visible as per category/section 'access level' - mod_newsflash, mod_latestnews, mod_mostread + + * Disallow Category Search returning items despite section 'access level' & section 'state' + * Disallow Contact Search returning items despite 'access level' & category 'state' + * Disallow Content Search returning items despite section 'access level' + * Disallow Newsfeed Search returnings items despite category 'state' + * Disallow Weblink Search returning items despite category 'state' + +--- + + +25-Feb-2006 Rey Gigataras + # Fixed [topic,40568.0.html] : Conversion of & to & when editing 'new' modules, breaking xhtml compliance + # Fixed [topic,40568.0.html] : Itemid=99999999 visible when navigating polls + # Fixed [artf3630] : Site name printed twice in the popup window title (print, email to friend) + + ^ Upgraded to TinyMCE 2.0.4 + + - Depreciated Admin templates - mambo_admin & mambo_admin_blue + + +24-Feb-2006 Rey Gigataras + * SECURITY [ Low Level ]: Add check for correct Admin session name + + # Fixed HTTP_ACCEPT_ENCODING problems + # Fixed incorrect handling of external links with mossef + + ^ Special Flag to allow different login behaviour of site for Production vs online Demo site + + +23-Feb-2006 Robin Muilwijk + # Fixed [topic,39449.0.html] : typo in menu manager + + +23-Feb-2006 Rey Gigataras + ^ Global Config session life only controls purging of frontend logged in sessions + ^ Guests session separately purged at a hardcoded 900 seconds + + +22-Feb-2006 Rey Gigataras + # Fixed [artf3591] : Error if unpublish menu item + # Fixed [topic,39295.0.html] : SEF handling of custom .htaccess reconfigured urls + # Fixed [topic,39295.0.html] : mod_login return value incorrectly returning 'index.php?' if coming from site homepage + + ^ Frontend Session Tracking cookie uses `Expire at End of Session`, rather than expiry by a set time to resolve issues with incorrect system clocks + + +21-Feb-2006 Rey Gigataras + * SECURITY [ Medium Level ]: Real server path disclosure in mod_templatechooser + + # Fixed [topic,39295.0.html] : Incorrect favicon path in installer + # Fixed [topic,39295.0.html] : Admin logout does not clear/delete session being logged out + + ^ Remember Me Cookie amalgamated into a single cookie. + + +20-Feb-2006 Rey Gigataras + # Fixed [topic,39295.0.html] : error in TinyMCE 2.0.3 (toggle fullscreen mode) + + +20-Feb-2006 Andrew Eddie + # Fixed filelist param - would always show list entries related to images for default and do not use + + +19-Feb-2006 Rey Gigataras + # Fixed [topic,36462.0.html] : time check incorrectly being based on local time - rather than server time + # Fixed [topic,39103.0.html] : utf-8 encoded newsfeeds in a ISO-8559-1 site + + +18-Feb-2006 Rey Gigataras + # Fixed [topic,39101.0.html] : Newsfeeds do not display + + ^ PERFORMANCE : General query reduction work + ^ PERFORMANCE : Reduce queries used by search bots to load params + ^ PERFORMANCE : 'editor-xtd' bot group loaded only once - affect = reduction in queries + ^ Refactored session handling code for Admin sessions + + + session.gc_maxlifetime setting for Admin Sessions + + +17-Feb-2006 Rey Gigataras + # Fixed [artf3543] : Rev 2393 Language Manager Error + # Fixed [topic,22061.0.html] : Wrapper Autoheight ability set to off by default, as causes javascript errors when used on sites not on your domain + # Fixed [topic,30542.0.html] : MySQL 5 support in strict mode + # Fixed [artf3605] : Spelling error when saving content + # Fixed [artf3576] : Javascript conflict in mod_wrapper + + ^ PERFORMANCE : `dynamic` Itemid checks store previous query results - affect = reduction in queries + ^ PERFORMANCE : `static` Itemid counters now loads only once - affect = reduction in queries + ^ PERFORMANCE : 'content' bot group loaded only once instead of each time content is loaded - affect = reduction in queries + ^ PERFORMANCE : individual 'content' bot query to pull params loaded only once instead of each time content is loaded - affect = reduction in queries + + + new Admin Session Life Global Config param, allowing setting of admin session idle logout time + + query debug mode to backend + + +16-Feb-2006 Rey Gigataras + # Fixed [artf3523] : mosemailcloak issue with mailto params + # Fixed : disable mossef bot from working on mailto links + # Fixed [topic,36637.0.html] : SEF deactivated relative & absolute url handling + # Fixed [topic,36637.0.html] : Session username not correct for those coming from `Remember Me` cookie + + + PERFORMANCE : Simple check for all bots to determine whether they should process further + ^ PERFORMANCE : Reduce queries used by bots to load params - mosemailcloak, mosimage, mosloadposition, mospaging - affect = reduction in queries + ^ PERFORMANCE : 'editor-xtd' bot group loaded only when needed - affect = reduction in queries + + +15-Feb-2006 Rey Gigataras + # Fixed [artf3527] : "New" Content Link and Image Not Present When Category Empty + # Fixed [topic,36462.0.html] : Static Content Start/Finish publishing time is based on server time, not local time + # Fixed : Publisher submission message for frontend content editing/submission + + +14-Feb-2006 Rey Gigataras + * SECURITY [ Low Level ]: Disable ability to enter more than one email address in Contact Component contact form + + # Fixed [artf3144] : NULL values from SQL tables not loaded + # Fixed [topic,31769.0.html] : $access variable conflict com_content + # Fixed [topic,32201.0.html] : mod_related_items urls not xhtml compliant + # Fixed [topic,31185.0.html] : heading in pagination not working + # Fixed [topic,10947.0.html] : Add Prefix check to installer + # Fixed [artf3082] : Template preview *still* not available + # Fixed [artf2925] : mosGetParam has side affects + # Fixed [topic,38017.0.html] : Content -> New -> Cancel + + ^ Upgraded TinyMCE to 2.0.3 & TinyMCE GZip Compressor to 1.0.7 + + +13-Feb-2006 Rey Gigataras + * SECURITY [ Medium Level ]: Hardening of Remember Me login functionality + * SECURITY [ Low Level ]: Harden Contact Component with param option to check for existance of session cookie - enabled by default + + +12-Feb-2006 Rey Gigataras + * SECURITY [ Low Level ]: Multiple Admin SQL Injection Vulnerabilities + * SECURITY [ Low Level ]: Category Search returns items despite section 'access level' & section 'state' + * SECURITY [ Low Level ]: Contact Search returns items despite 'access level' & category 'state' + * SECURITY [ Low Level ]: Content Search returns items despite section 'access level' + * SECURITY [ Low Level ]: Newsfeed Search returns items despite category 'state' + * SECURITY [ Low Level ]: Weblink Search returns items despite category 'state' + + # Fixed [artf3391] : Aphostrophes in Category: Edit + # Fixed [artf3291] : Alert() problem + # Fixed [artf3188] : Unnecessary table cell in contact.html.php + # Fixed [artf3121] : css errors in tiny_mce and rhuk_solarflare_ii template + # Fixed [artf3181] : Task routing class + # Fixed [artf3400] : showCalendar does not get value of date + # Fixed [artf3348] : Bold tag overrides css in mod_poll.php + # Fixed [artf3120] : &and & &link not defined in admin.categories.php + # Fixed [artf3446] : Problems with mosimage with caption + # Fixed [artf3100] : Incorrect Response Headers for Missing Pages + # Fixed [artf3220] : Search bug: No way to update referenced search component + # Fixed [artf3438] : RSS Feed Created it not base on the same encoding of the content + # Fixed [artf3108] : Joomla 1.0.7 core SEF bug gives 404 on homepage + # Fixed [artf3169] : RSS feeds does not work with SEF disabled + + +11-Feb-2006 Rey Gigataras + * SECURITY [ Medium Level ]: Protect against real server path disclosure via syndication component + * SECURITY [ Medium Level ]: Limit arbitrary file creation via syndication component + + # Fixed [artf3397] : link to menu and loss of images list + # Fixed [artf3109] : 1.0.7 "The XML page cannot be displayed ERROR" ob_gzhandler issue + # Fixed [artf3447] : TinyMCE and relative urls + # Fixed [artf3183] : Sub-menu items of separators not showing in module menu selection list + # Fixed [artf3103] : $mosConfig_cachepath not used everywhere + # Fixed [artf3114] : mod_related_items outputs nothing + # Fixed [artf3234] : mod_related_items unitialized mosConfig_offset variable + # Fixed [artf3402] : Missing param in module + # Fixed [artf3067] : Reopen: Unhandled fragment identifier with core SEF enabled + # Fixed [topic,31813.0.html] : new .htaccess gives proper 404s [Steve Graham] + + + Disable session.use_trans_sid to .htaccess + + +10-Feb-2006 Rey Gigataras + * SECURITY [ Low Level ]: Harden frontend Session ID + + # Fixed [artf3421] : Session cleanup relies on administrator login + # Fixed [artf3307] : Error in code - non critical, but logout setcookie not working + # Fixed [artf3126] : Short open PHP tag in pathway.php + # Fixed [artf3126] : [artf3413] : small problem with variable in xml_domit_lite_parser.php + # Fixed [topic,34620.0.html] : Excessive Joomla Sessions, and AOL Login Problem [Steve Graham] + # Fixed mosWarning() $title error + + + New Session Type Global Config param + +08-Feb-2006 Rey Gigataras + * SECURITY [ Medium Level ]: # Fixed : `Content` items viewable when category/section 'unpublished' - mod_newsflash + * SECURITY [ Low Level ]: # Fixed : `Content` item links visible despite category/section 'access level' - mod_newsflash, mod_latestnews, mod_mostread + + # Fixed [artf3393] : Latestnews doesn't show static content + + +07-Feb-2006 Robin Muilwijk + # Fixed [artf3328], 1.0.7 EN Installation Typo - Step 1 + # Fixed [artf3401] : Spelling errors in two modules + + +31-Jan-2006 Rey Gigataras + + Additional Contact Component hardening + + +30-Jan-2006 Rey Gigataras + * SECURITY [ Medium Level ]: # Fixed : `Content` item accessible despite section/category 'access level' + * SECURITY [ Medium Level ]: # Fixed : `Content Section` view `Content` items visible despite category 'access level' - `Blog - Content Section` & `Blog - Content Section Archive` + * SECURITY [ Medium Level ]: # Fixed : `Newsfeed` item accessible despite category 'access level' + * SECURITY [ Medium Level ]: # Fixed : `Weblink` item accessible despite category 'access level' + * SECURITY [ Low Level ]: # Fixed : `Contact` Categories accessible despite category 'access level' + * SECURITY [ Low Level ]: # Fixed : `Newsfeeds` Categories accessible despite category 'access level' + * SECURITY [ Low Level ]: # Fixed : `Weblinks` Categories accessible despite category 'access level' + * SECURITY [ Low Level ]: # Fixed : `Content Category` view accessible despite section/category 'access level' - `Table - Content Category` + * SECURITY [ Low Level ]: # Fixed : `Content Category` view accessible despite category 'access level' - `Blog - Content Category` & `Blog - Content Category Archive` + * SECURITY [ Low Level ]: # Fixed : `Content Section` view accessible despite section 'access level' - `Table - Content Section` + + ^ Contact Items display Authorization block text if category 'access level' denies access + ^ Blog pages display Authorization block text if section/category 'access level' denies access + + +29-Jan-2006 Rey Gigataras + * SECURITY [ Medium Level ]: # Fixed : `Weblinks` item accessible when category 'unpublished' + + ^ Blog pages display Authorization block text if section/category being unpublished + + +25-Jan-2006 Rey Gigataras + * SECURITY [ Low Level ]: # Fixed : No way to disable access to syndication functionality + + +17-Jan-2006 Rey Gigataras + * SECURITY [ Medium Level ]: # Fixed : `Weblink` item accessible when 'unpublished' + * SECURITY [ Medium Level ]: # Fixed : `Polls` item accessible when 'unpublished' + * SECURITY [ Medium Level ]: # Fixed : `Newfeeds` item accessible when category 'unpublished' + * SECURITY [ Low Level ]: # Fixed : 'unpublished' `Newfeeds` Categories accessible + * SECURITY [ Low Level ]: # Fixed : 'unpublished' `Contact` Categories accessible + * SECURITY [ Low Level ]: # Fixed : 'unpublished' `Weblink` Categories accessible + * SECURITY [ Low Level ]: # Fixed : `Content Section` accessible when section 'unpublished' - `List - Content Section` + * SECURITY [ Low Level ]: # Fixed : `Content Category` view accessible when category/section 'unpublished' - `Table - Content Category` + + +---------------- 1.0.7 Released -- [15-Jan-2006 20:00 UTC] ------------------ + + +15-Jan-2006 Rey Gigataras + # Fixed : database password being incorrectly overwritten with a blank + + +---------------- 1.0.6 Released -- [15-Jan-2006 15:00 UTC] ------------------ + +This Release Contains following Security Fixes + +Low Level Threat +* Disallow Author from publishing items or changing publish state +* Hardened Contact Component against misuse +* Added simple filtering control ability to Contact Component +* Hardened misuse of Contact Component `email copy` ability when not activated +* Hardened misuse of Contact Component `VCard` ability when not activated +* `VCard` & `Email Copy` options set to hide by default +* Multiple Vulnerabilities in TinyMCE Compressor +* Hardened Itemid against misuse +* Hide database password in Global Configuration + +--- + +15-Jan-2006 Rey Gigataras + * SECURITY [ Low Level ]: Hide database password in Global Configuration + # Fixed [artf3064] : Warning: Invalid argument supplied mod_fullmenu Line 57 + # Fixed [artf3063] : Poll Component Output Display Error + +14-Jan-2006 Louis Landry + # Fixed Caching `Blog` pagination problem + +14-Jan-2006 Rey Gigataras + * SECURITY [ Low Level ]: disallow Author from publishing items or changing publish state [identified Max Dymond] + # Fixed [artf3055] : Weblink submit, no email to admin + # Fixed [artf3045] : Unhandled fragment identifier with core SEF enabled + # Fixed [artf3032] : 1783: Can't get custom CSS in Tiny MCE + # Fixed [artf3052] : Contact Component Re-Direct Issue + # Fixed [artf3043] : Login & Logout redirecting to $mosConfig_live_site + # Fixed [artf3040] : Site Modules | Display can be duplicated on Pages + # Fixed problem with display mod_rssfeed twice on a page + ^ Contact Component confirmation now uses mosredireect msg, rather than JS + +13-Jan-2005 Andrew Eddie + # Fixed bug in database::loadRowList that reutrn assoc and not numerical array + # Fixed bug in index2.php where joomlajavascript.js is not included + +13-Jan-2006 Rey Gigataras + * SECURITY [ Low Level ]: + simple filter check to Contact Component + # Fixed [artf3038] : Warning: array_search(): Wrong datatype for second argument in + # Fixed [artf3037] : New 404 tags aren't translated + # Fixed [artf3035] : Bug with mod_newsflash + +12-Jan-2006 Alex Kempkens + # Fixed mosFormateDate, handling offset's with value 0 + +12-Jan-2006 Rey Gigataras + * SECURITY [ Low Level ]: changed `Email Copy` param option for new Contacts now set to `hide` + # Fixed [artf2070] : mosHTML:encoding_converter() breaks with ö + # Fixed missing
  • tag in newsfeed component + # Fixed [artf1487] : Media Manager breaks when illegal characters in uploaded file name + # Fixed [artf2108] : Saving a parent inside of a child + + caching support to `Frontpage` component + + missing param for `Table - Weblink Category` + - sef handling in mod_search.php as SEF + - unnecessary `checked out` check in mod_latestnews.php and mod_mostread.php + - unnecessary param variable in mod_latestnews.php + +10-Jan-2006 Rey Gigataras + * SECURITY [ Low Level ]: Fixed [artf2386] : Preventing Spambots through com_contact + # Fixed [artf2622] : admin.users.php session_start called when a session is already open + # Fixed [artf2789] : invalid xhtml + # Fixed [artf2989] : User WYSIWYG editor setting resets after adding new user from backend + # Fixed [artf2986] : Wrong link to image-icon in weblinks + +08-Jan-2006 Johan Janssens + * SECURITY [ Low Level ]: Fixed Security Vulnerability in TinyMCE Compressor + +08-Jan-2006 Rey Gigataras + * SECURITY [ Low Level ]: Fixed [artf2950] : Information leak with Vcard hide function + * SECURITY [ Low Level ]: changed `VCard` param option for new Contacts now set to `hide` + # Fixed DOMIT bugs [identified by sarahk] http://sarahk.pcpropertymanager.com/blog/using-domit-rss/225/ + # Fixed [artf2793] : New user confirmation link warning on login + # Fixed [artf2732] : Pagination in the Blog section/category doesnt work + # Fixed [artf2943] : Incorrect Redirect for Weblinks + # Fixed [artf2945] : Undefined constant in php_http_exceptions.php + +07-Jan-2006 Rey Gigataras + # Fixed [artf2933] : Pathway problem on Windows + +06-Jan-2006 Rey Gigataras + ^ changed mod_archive so that no Itemid is assigned, meaning it uses the default Itemid=99999999 + # Fixed [artf2738] : Incorrect SEF links for archive com_content links + # Fixed [artf1809] : mospagebreak problem with "Special Characters" + # Fixed [artf2861] : article_seperator glitch + +05-Jan-2006 Rey Gigataras + # Fixed [artf2825] : RSS module SEF urls + +04-Jan-2006 Rey Gigataras + * SECURITY [ Low Level ]: Fixed [artf2050] : Itemid in index2.php + # Fixed Related items Module shows Expired items - Mambo Tracker [#7590] + # Fixed [artf2185] : Changing weblinks possible for everyone + +03-Jan-2006 Andy Miller + ^ Updated copyright information for iCandy Junior icons + +03-Jan-2005 Rey Gigataras + # Fixed XHTML validation error in `Blog` view with decmimal value widths + # Fixed XHTML validation error in `Table - Content Category` + # Fixed [artf2791] : RSS item links not SEF'd + # Fixed [artf2791] : RSS items have no category + # Fixed [artf2813] : Media Manager doesn't support ICO files + +02-Jan-2006 Rey Gigataras + # Fixed [artf2802] : All content made bold for Rss module published on the frontpage + # Fixed [artf2780] : Newsflash Read More bad link + # Fixed [artf2786] : Newsflash module not picking up "linked title" global setting + # Fixed [artf2810] : 1.0.x changelog incorrectly states release date of 1.0.5 + +30-Dec-2005 Rey Gigataras + # Fixed `Unlimited` banner impressions option + # Fixed [artf2776] : Multiple banners not possible + # Fixed [artf2788] : admin template css errors + +29-Dec-2005 Rey Gigataras + # Fixed [artf2646] : name="" not valid XHTML + # Fixed [artf2747] : title_alias is missing in mambots + # Fixed `Reset Clicks` button not working in admin component `Banner Manager` + # Fixed [artf2712] : Clicks reset on save + +29-Dec-2005 Andrew Eddie + ^ SEF error handling throws to new /templates/404.php file + # Rolled back changes to database::insertObject + + New prototype MySQL 5 driver + +24-Dec-2005 Emir Sakic + # Fixed a bug with 404 header being returned for homepage when SEF activated + # Fixed a bug with all items on frontpage returning Itemid=1 (duplicate content) + + +---------------- 1.0.5 Released -- [24-Dec-2005 10:00 UTC] ------------------ + + +This Release Contains following Security Fixes + +Medium Level Threats +* Hardened ability to use the contact component to proliferate spam + +--- + +21-Dec-2005 Andrew Eddie + # Fixed slow query in com_content (Author text in a content item is now set to Written By) + # Fixed bug in backend poll entry with ' is in option name + # Fixed bug where content modified date is not updated on a bluck publish/archive operation + + Added TEMPLATEURL to patTemplate preloaded variables + ^ patTemplate Translate now recognises 1.0 version language constants + +20-Dec-2005 Emir Sakic + # Fixed [artf2432] : Apostrophe in paths isn't escaped properly + +20-Dec-2005 Johan Janssens + # Fixed [artf2389] : gzip compression not operational + # Fixed [artf2599] : loosing Itemid afet submitting "ask for new password" + # Fixed [artf1712] : Search Mambots return duplicate results + # Fixed [artf2534] : Template chooser no longer able to manage SEF urls / XHTML validation + # Fixed [artf1410] : 'Special' access menu locks out 'public' menu's articles "read more" content + # Fixed [artf2595] : Deleted "mass mail" item menu in component menu + # Fixed [artf2518] : mod_latestnews problem + # Fixed [artf2591] : mosMakePath problem with mkdir on strato + # Fixed [artf2665] : Most Read module generates incorrect class for
  • statement + # Fixed [artf2666] : Pagination Error in Category Manager + # Fixed [artf2407] : parameter type=mos_category show only "- Select Content Category -" + +16-Dec-2005 Andy Miller + # Fixed mod_whosonline not rendering list properly + +07-Dec-2005 Andrew Eddie + + Added database::getAffectedRows to db connectors + +10-Dec-2005 Emir Sakic + # Fixed [artf2517] : "Cancel" the editing of content after "apply" not possible + +09-Dec-2005 Emir Sakic + # Fixed [artf2324] : SEF for components assumes option is always first part of query + # Fixed [artf1955] : Search results bug + +07-Dec-2005 Andrew Eddie + # Fixed unitialised array in mosHTML::MenuSelect method + + Added mosBackTrace debugging function + # Fixed bug in mosDBTable::load where null table values don't overwrite properly + +07-Dec-2005 Johan Janssens + # Fixed [artf2430] : invalid values in tabpane.css + # Fixed [artf2457] : VCard bug IS a bug + # Fixed [artf2218] : RSS Newsfeed module generates wrong rendering output + # Fixed [artf2453] : Random Image Module + # Fixed [artf2251] : Poll title error + # Fixed [artf2393] : Original editor cannot open content item if checked out + # Fixed [artf2323] : overlib_hideform_mini.js parse error + # Fixed [artf2248] : Incorrect hits count on multipage articles + # Fixed [artf2342] : getBlogCategoryCount + # Fixed [artf2464] : Contacts Component image path error + # Fixed [artf2404] : Contact detail html bug + ^ Replaced install.png with transparent image - contributed by joomlashack + # Fixed [artf2245] : RSS not showing enclosure tags + # Fixed [artf2247] : RSS newsfeed on Frontend missing link + # Fixed bug in Domit lite parser + # Fixed mosMail() is missing "ReplyTo:" field to avoid anti-spam rules (SPF) + # Fixed Small typo in mosBindArrayToObject + +06-Dec-2005 Alex Kempkens + # Fixed [artf2434]: Typo in database.php checkout function line 1050 + # Fixed [artf2398] : Parameter Text Area field name + +06-Dec-2005 Johan Janssens + # Fixed [artf2418] : Banners Client Manager Next Page Issue: Joomla 1.04 + # Fixed [artf2156] : memory exhastion error in joomla.xml.php + # Fixed [artf2378] : mosCommonHTML::CheckedOutProcessing not checking if the current user + has checked out the document + # Fixed [artf1948] : Pagination problem still exists + ^ Upgraded TinyMCE Compressor [1.0.4] + ^ Upgraded TinyMCE [2.0.1] + +01-Dec-2005 Andrew Eddie + # Fixed nullDate error in mosDBTable::checkin method + # Removed $migrate global in mosDBTable::store method + # Fixed some MySQL 5 issues (still very unreliable) + + Component may force frontend application to include joomla.javascript.js by: + $mainframe->set( 'joomlaJavascript', 1 ); + +01-Dec-2005 Andrew Eddie + # Fixed limit error in sections search bot + # Bug in gacl_api::add_group query [c/o Mambo bug #8199] + # Search highlighting fails when a "?" is entered [c/o Mambo bug #8260] + +30-Nov-2005 Emir Sakic + + Added 404 handling for missing content and components + + Added 404 handling to SEF for unknown files + +30-Nov-2005 Andrew Eddie + # Site templates allowed to have custom index2.php (fixes problems where custom code is required in index2) + +29-Nov-2005 Andrew Eddie + # Fixed [artf2258] : Parameter tooltips missing in 1.0.4 + +28-Nov-2005 Andrew Eddie + # Fixed [artf2329] : mosMainFrame::getBasePath refers to non-existant JFile class. + # Fixed [artf2246] : Error in frontend.html.php + # Fixed [artf2190] : mod_poll.php modification + # Fixed [artf2292] : [WITH FIX] Sql query missing hits + +24-Nov-2005 Emir Sakic + # Fixed [artf2225] : Email / Print redirects to homepage + # Fixed [artf1705] : Not same URL for same item : duplicate content + +23-Nov-2005 Johan Janssens + # Fixed : Content Finish Publishing & not authorized + +22-Nov-2005 Marko Schmuck + # Fixed [artf2240] : 1.0.4 URL encoding entire frontend? + # Fixed [artf2222] : ampReplace in content.html.php + + Versioncheck for new_link parameter for mysql_connect. + +22-Nov-2005 Levis Bisson + # Fixed [artf2221] : 1.0.4: includes/database.php faulty on PHP < 4.2.0 + # Fixed [artf2219] : Bug in pageNavigation.php - added "if not define _PN_LT or _PN_RT" + +22-Nov-2005 Johan Janssens + # Fixed [artf2224] : Problem with Media Manager + # Fixed : Can't create new folders in media manager + + +---------------- 1.0.4 Released -- [21-Nov-2005 10:00 UTC] ------------------ + + +This Release Contains following Security Fixes + +Critical Level Threat + * Potentional XSS injection through GET and other variables + * Hardened SEF against XSS injection + +Low Level Threat + * Potential SQL injection in Polls modules through the Itemid variable + * Potential SQL injection in several methods in mosDBTable class + * Potential misuse of Media component file management functions + * Add search limit param (default of 50) to `Search` Mambots to prevent search flooding + +--- + +20-Nov-2005 Levis Bisson + # Fixed Artifact [artf1967] displays with an escaped apostrophe in both title and TOC. + +20-Nov-2005 Emir Sakic + * SECURITY [ Critical Level ]: Hardened SEF against XSS injection + +19-Nov-2005 Levis Bisson + # replaced charset=utf-8 to charset=iso-8859-1 in language file + +19-Nov-2005 Andrew Eddie + * SECURITY [ Critical Level ]: Fixed XSS injection of global variable through the _GET array + +17-Nov-2005 Johan Janssens + ^ Replaced install.png with new image + - Reverted [artf2139] : admin menu xhtml + + Added clone function for PHP5 backwards compatibility + +16-Nov-2005 Rey Gigataras + # Fixed [artf2137] : editorArea xhtml + # Fixed [artf2139] : admin menu xhtml + # Fixed [artf2136] : Admin menubar valid xhtml + # Fixed [artf2135] : Admin invalid xhtml + # Fixed [artf2140] : mosMenuBar::publishList + # Fixed [artf2027] : uploading images from custom component + +13-Nov-2005 Rey Gigataras + # PERFORMANCE: Fixed [artf1993] : Inefficient queries in com_content + # Fixed [artf2021] : [artf1791] : Failed Login results in redirect to referring page + # Fixed [artf2021] : appendMetaTag() prepends instead of appends + # Fixed [artf1981] : incorrect url's at next/previous links at content items + # Fixed [artf2079] : SQL error in category manager thru contact manager + # Fixed [artf1586] : .htaccess - RewriteEngine problem + # Fixed [artf1976] : Check for custom icon in mod_quickicon.php + +11-Nov-2005 Andy Miller + # Fixed issue with RSS module not displaying inside module rendering wrapper + +10-Nov-2005 Rey Gigataras + # Fixed contact component dropdown select category bug + +07-Nov-2005 Rey Gigataras + # Fixed mod_quickicon `redeclaration of function` error possibilities + +07-Nov-2005 Johan Janssens + # Fixed [artf1648] : tinyMCE BR and P elements + # Fixed [artf1700] : TinyMCE doesn't support relative URL's for images + +07-Nov-2005 Andrew Eddie + * SECURITY [ Low Level ]: Fixed [artf1978] : mod_poll SQL Injection Vulnerability + * SECURITY [ Low Level ]: Fixed SQL injection possibility in several mosDBTable methods + * SECURITY [ Low Level ]: Fixed malicious injection into filename variables in com_media + ^ mosDBTable::publish_array renamed to publish + ^ mosDBTable::save no longer updates the ordering (must now be done separately) + +06-Nov-2005 Rey Gigataras + * SECURITY [ Low Level ]: Add search limit param (default of 50) to `Search` Mambots to prevent search flooding + # Fixed custom() & customX() functions in menu.html.php no checking for image in /administrator/images/ + +04-Nov-2005 Rey Gigataras + # Fixed [artf1953] : Page Class Suffix in Contacts component + # Fixed [artf1945] : mosToolTip not generating valid xhtml + +03-Nov-2005 Rey Gigataras + + modduleclass_sfx support to mod_poll + # Fixed [artf1902] : Incorrect number of table cells in mod_poll + +03-Nov-2005 Samuel Moffatt + # Fixed bug which prevented component uninstall if another XML file was in the directory + +01-Nov-2005 Rey Gigataras + # Fixed [artf1888] : linkable [category|section] URL incorrect + # Fixed [artf1620] : Hardcoded words in pdf.php + # Fixed [artf1887] : Content: Bug in creation date generation + +31-Oct-2005 Johan Janssens + # Fixed [artf1277] : News Feed Display Bad Accent character + +31-Oct-2005 Rey Gigataras + # Fixed [artf1739] : Problem with the menuitem type url and assigned templates and modules + # Fixed [artf1574] : Who is online after update to Joomla 1.0.3 no more work correctly + # Fixed [artf1666] : Notice: on component installation + # Fixed [artf1573] : Manage Banners | Error in Field Name + # Fixed [artf1597] : Small bug in loadAssocList function in database.php + # Fixed [artf1832] : Logout problem + # Fixed [artf1769] : Undefined index: 2 in includes/joomla.php on line 2721 + # Fixed [artf1749] : Email-to-friend is NOT actually from friend + # Fixed [artf1591] : page is expired at installation + # Fixed [artf1851] : 1.0.2 copy content has error + # Fixed [artf1569] : Display of mouseover in IE gives a problem with a dropdown-box + # Fixed [artf1869] : Poll produces MySQL-Error when accessed via Component Link + # Fixed [artf1694] : 1.0.3 undefined indexes filter_sectionid and catid on "Add New Content" + # Fixed [artf1834] : English Localisation + # Fixed [artf1771] : Wrong mosmsg + # Fixed [artf1792] : "Receive Submission Emails" label is misleading + # Fixed [artf1770] : Undefined index: HTTP_USER_AGENT + +30-Oct-2005 Rey Gigataras + ^ Upgraded TinyMCE Compressor [1.02] + ^ Upgraded TinyMCE [2.0 RC4] + +27-Oct-2005 Johan Janssens + # Fixed [artf1671] : Media Manager + # Fixed [artf1814] : Tab Class wrong + # Fixed [artf1086] : Icons at the control panel fall apart + +26-Oct-2005 Samuel Moffatt + # Fixed bug where a new database object with the same username, password and host but different database name would kill Joomla! + +25-Oct-2005 Johan Janssens + # Fixed [artf1733] : $contact->id used instead of $Itemid + # Fixed [artf1654] : base url above title tag + # Fixed [artf1738] : Registration - javascript alert + +23-Oct-2005 Rey Gigataras + # Fixed [artf1695] : Show Empty Categories in Section does not work + # Fixed [artf1710] : Unnecessary queries (optimization) + # Fixed [artf1711] : Missing whitespace in search results + # Fixed [artf1706] : Mambo logo not removed from admin images + # Fixed [artf1708] : Search CMT: Hardcoded date format + # Fixed [artf1689] : Joomla! Installer - Wording still not correct + # Fixed [artf1692] : email and print buttons (maybe also the PDF) does not validate + +19-Oct-2005 Andrew Eddie + # Fixed missing autoclear in "list-item" stock template + +19-Oct-2005 Rey Gigataras + # Fixed [artf1577] : MenuLink Blog section error + +19-Oct-2005 Levis Bisson + Applyed Feature Requests: +^ Artifact [artf1282] : Easier sorting of static content in creating menu links +^ Artifact [artf1162] : Remove hardcoding of <<, <, > and >> in pageNavigation.php + + +---------------- 1.0.3 Released -- [14-Oct-2005 10:00 UTC] ------------------ + + +Contains following Security Fixes +Medium Level Threat + * Fixed SQL injection bug in content submission (thanks Dead Krolik) + +Low Level Threat + * Fixed securitybug in admin.content.html.php when 2 logged in and try to edit the same content + * Fixed Search Component flooding, by limiting searching to between 3 and 20 characters + * Fixed [artf1405] : Joomla shows Items to unauthorized users + +------- + +14-Oct-2005 Rey Gigataras + # Fixed edit icon not showing on frontpage + # Fixed [artf1553] : database.php fails to pass resource id into mysql_get_server_info() call + # Fixed [artf1560] : Install1.php doesn't enforce rule against old_ table prefix + +13-Oct-2005 Andy Miller + # Fixed [artf1504] : rhuk_solarflare_ii Template | Menus with " not displaying correctly + +13-Oct-2005 Rey Gigataras + # Fixed duplicated module creation in install + # Fixed XHTML issue in rss feed module + # Fixed XHTML issue in com_search + # Fixed [artf1550] : Properly SEFify com_registration links + # Fixed [artf1533] : rhuk_solarflare_ii 2.2 active_menu + # Fixed [artf1354] : Can't create new user + # Fixed [artf1433] : Images in Templates + # Fixed [artf1531] : RSS Feed showing wrong livesite URL + +12-Oct-2005 Marko Schmuck + * SECURITY [ Low Level ]: Fixed security bug in admin.content.html.php when 2 logged in and try to edit the same content + +12-Oct-2005 Johan Janssens + # Fixed [artf1266] : gzip compression conflict + # Fixed [artf1453] : Weblink item missing approved parameter + # Fixed [artf1452] : Error deleting Language file + # Fixed [artf1373] : Pagination error + +12-Oct-2005 Rey Gigataras + ^ Core now automatically calculates the offset between yourself and the server + # Fixed bug in Global Config param `Time Offset` + # Fixed [artf1414] : Missing images in HTML_toolbar + # Fixed [artf1513] : PDF format does not work at version 1.0.2 + +11-Oct-2005 Rey Gigataras + * SECURITY [ Low Level ]: Fixed Search Component flooding, by limiting searching to between 3 and 20 characters + ^ Blog - Content Category Archive will no longer show dropdown selector when coming from Archive Module + # Fixed [artf1470] : Archives not working in the front end + # Fixed [artf1495] : Frontend Archive blog display + # Fixed [artf1364] : TinyMCE loads wrong template styles + # Fixed [artf1494] : Template fault in offline preview + # Fixed [artf1497] : mosemailcloak adds trailing space + # Fixed [artf1493] : mod_whosonline.php + +09-Oct-2005 Rey Gigataras + * SECURITY [ Medium Level ]: Fixed SQL injection bug in content submission + * SECURITY [ Low Level ]: Fixed [artf1405] : Joomla shows Items to unauthorized users + # Fixed [artf1454] : After update email_cloacking bot is always on + # Fixed [artf1447] : Bug in mosloadposition mambot + # Fixed [artf1483] : SEF default .htaccess file settings are too lax + # Fixed [artf1480] : Administrator type user can loggof Super Adminstrator + # Fixed [artf1422] : PDF Icon is set to on when it should be off + # Fixed [artf1476] : Error at "number of Trashed Items" in sections + # Fixed [artf1415] : Wrong image in editList() function of mosToolBar class + +08-Oct-2005 Johan Janssens + # Fixed [artf1384] : tinyMCE doesnt save converted entities + +07-Oct-2005 Andy Miller + # Fixed tabpane css font issue + +07-Oct-2005 Johan Janssens + # Fixed [artf1421] : unneeded file includes\domit\testing_domit.php + +07-Oct-2005 Andy Stewart + # Fixed [artf1382] : Added installation check to ensure "//" is not generated via PHP_SELF + # Fixed [artf1439] : Used correct ErrorMsg function and updated javascript redirect to remove POSTDATA message + # Fixed [artf1400] : Added a check of $other within com_categories to skip section exists check if set to "other" + +05-Oct-2005 Robin Muilwijk + # Fixed [artf1366] : Typo in admin, Adding a new menu item - Blog Content Category + + +---------------- 1.0.2 Released -- [02-Oct-2005 16:00 UTC] ------------------ + + +02-Oct-2005 Rey Gigataras + ^ Added check to mosCommonHTML::loadOverlib(); function that will stop it from being loaded twice on a page + # Fixed Content display not honouring Section or Category publish state + # Fixed [artf1344] : Link to menu shows wrong menu type + # Fixed [artf1189] : Long menu names get truncated, duplicate menus made + # Fixed [artf1192] : Unpublished Bots + # Fixed [artf1223] : Error with Edit items in categories and sections + # Fixed [artf1219] : Joomla Component Module displays Error! + # Fixed [artf1183] : Section module: Still "no items to display" + # Fixed [artf1241] : Editing content fails with MySQL 5.0.12b + # Fixed [artf1306] : modules - parameters of type text not stored correctly + +01-Oct-2005 Andy Miller + # Fixed base href in Content Preview for broken images + +01-Oct-2005 Johan Janssens + ^ Updated TinyMCE editor to version RC 3 + # Fixed [artf1221] : Unable to Submit Content (still not working post-patch) + # Fixed [artf1108] : Tooltips on mouseover causes parameter panel to widen + # Fixed [artf1217] : WYSIWYG-Editor and mospagebreak with 2 parameters + +01-Oct-2005 Andy Stewart + # Fixed [artf1305] - Added a check within mosimage mambot for introtext being hidden + # Fixes [artf1343] - Removed xml declaration at top of gpl.html + +01-Oct-2005 Arno Zijlstra + ^ Changed OSM banner 2 a little to show banner changing + +01-Oct-2005 Levis Bisson + # Fixed [artf1311] : Banners not showing / returning PHP error + # Fixed [artf1319] : Banners not showing in frontend / admin + +30-Sep-2005 Andy Miller + # Fixed poor rendering of fieldset with solarflare2 + ^ Updated solarflare2 template with new colors and logos + ^ Moved modules to divs, and shuffled pathway to give more button room + ^ Updated favicon and other Joomla! logos for admin + # Fixed alignment of footer in admin for safari/opera + +30-Sep-2005 Andy Stewart + + Updated installation routine to recognise port numbers other than 80 + # Fixed [artf1293] : added $op=mosGetParam so sendmail is called when running globals.php-off + +30-Sep-2005 Rey Gigataras + ^ Module Manager `position` dropdown ordering alphabetically + ^ Ability to Hide feed title for `New` modules used to display feeds + ^ Content Items `New` button sensitive to dropdown filters + # Fixed Seach Module not using Itemid of existng `Seach` component menu item + # Fixed `Link to Menu` problem with Sections menu ordering + # Fixed `Link to Menu` problem with Category = `Content Category` + # Fixed [artf1300] : PDF shows Author name despite setting content item + +30-Sep-2005 Levis Bisson + + Added UTF-8 support + # Fixed tooltips empty links + # Fixed [artf1265] : url in 'edit-menue-item' of submenues is wrong + # Fixed [artf1277] : News Feed Display Bad Accent character + +29-Sep-2005 Arno Zijlstra + # Fixed publish/unpublish select check in contacts + +29-Sep-2005 Rey Gigataras + # Fixed [artf1276] : tiny mce background + # Fixed [artf1281] : Bad name of XML file + # Fixed [artf1180] : Call-by-reference warning when editing menu + # Fixed [artf1188] : includes/vcard.class.php uses short open tags + +29-Sep-2005 Levis Bisson + # Fixed [artf1274] : Module display bug when using register/forgot password links + # Fixed [artf1238] : header("Location: $url")- some servers require an absolute URI + +28-Sep-2005 Levis Bisson + # Fixed [artf1250] : Order is no use when many pages + # Fixed [artf1254] : Unable to delete when count > 1 + # Fixed [artf1248] : Invalid argument supplied for 3P modules + +27-Sep-2005 Arno Zijlstra + # Fixed [artf1253] : Apply button image path + # Fixed [artf1240] : WITH FIX: banners component - undefined var task + # Fixed [artf1242] : Problem with "Who's online" + # Fixed [artf1218] : 'Search' does not include weblinks? + +25-Sep-2005 Emir Sakic + # Fixed [artf1185] : globals.php-off breaks pathway + # Fixed [artf1196] : undefined constant categoryid + # Fixed [artf1216] : madeyourweb no TAG + +24-Sep-2005 Rey Gigataras + ^ [artf1214] : pastarchives.jpg seems unintuitive. + +22-Sep-2005 Rey Gigataras + + Added Version Information to bottom of joomla_admin template, with link to 'Joomla! 1.0.x Series Information' + # Fixed [artf1175] : Create catagory with selection of Section + # Fixed [artf1179] : Custom RSS Newsfeed Module has nested + + +---------------- 1.0.1 Released -- [21-Sep-2005 16:30 UTC] ------------------ + + +21-Sep-2005 Rey Gigataras + # Fixed [artf1157] : Section module: Content not displayed, wrong header + # Fixed [artf1159] : Can't cancel "Submit - Content" menu item type form + # Fixed [artf1172] : "Help" link in Administration links to Mamboserver.com + # Fixed [artf1171] : mod_related_items shows all items twice + # Fixed [artf1167] : Component - Search + # Fixed [RC] incorrect redirect when cancelling from Frontend 'Submit - Content' + # Fixed undefined variable in Trash Manager + # Fixed [RC] `Trash` button when no item selected + # Fixed [RC] `New` Menu Item Type `Next` button bug + +20-Sep-2005 Levis Bisson + ^ added a chmod to the install unlink function + # Fixed [artf1150] : the created_by on initial creation of Static Content Item + +20-Sep-2005 Marko Schmuck + ^ Changed Time Offsets to hardcoded list with country/city names + +20-Sep-2005 Rey Gigataras + # Fixed /installation/ folder check + # Fixed [artf1153] : Quote appears in com_poll error + # Fixed [artf1151] : empty span + # Fixed [artf1089] : multile select image insert reverses list order + # Fixed [artf1138] : Joomla allows creation of double used username + # Fixed [artf1133] : There is no install request to make /mambot/editor writeable + +19-Sep-2005 Andrew Eddie + # Fixed incorrect js function in patTemplate sticky and ordering templates/links + +19-Sep-2005 Rey Gigataras + ^ Changed Overlib styling when creating new menu items + ^ Additional Overlib info for non-image files and directories + ^ 'Cancel' button for Media Manager + ^ Option to run TinyMCE in compressed mode - off by default + # Fixed [artf1111] : mosShowHead and the order of headers + # Fixed [artf1117] : database.php - bcc + # Fixed [artf1114] : database.php _nullDate + # Fixed TinyMCE errors caused by use of compressed tinymce_gzip.php [[artf1088]||[artf1034]||[artf1090]||[artf1044]] + # Installed Editor Mambots are now published by default + # Fixed error in RSS module + # Fixed [artf1106] : Default Editor Will Not Take Codes Like Java Script + # Fixed delete file in Media Manager + +18-Sep-2005 Arno Zijlstra + # Fixed [artf1084] :
    stays in empty content + # Fixed [artf1101]: Typo in Global Config + +18-Sep-2005 Andrew Eddie + # Fixed issues in patTemplate Translate Function and Modifier + # Fixed issue with patTemplate variable for Tabs graphics + +18-Sep-2005 Rey Gigataras + # Fixed [artf1046] : Menu Manager Item Publishing + # Fixed [artf1036] : newsflash error when logged in in frontend + # Fixed [artf1033] : madeyourweb template logo path + # Fixed [artf1039] : & to & translation in menu and contenttitle + # Fixed PHP5 passed by reference error in admin.content.php + # Fixed [artf1068] : live bookmark link is wrong + # Fixed [artf1030] : Bug Joomla 1.0.0 Stable (un)publishing News Feeds + # Fixed [artf1048] : Custom Module Bug + # Fixed [artf1080] : Joomla! Installer + # Fixed [artf1050] : error in sql - database update + # Fixed [artf1081] : com_categories can't edit category when clicking hyperlink + # Fixed [artf1053] : Can not unassign template + # Fixed [artf1079] : com_weblinks can't edit links + # Fixed [artf1029] : Site -> Global Configuration = greyed out top menu + # Fixed [artf1064] : Deletion of Modules and Fix + # Fixed [artf1052] : Double Installer Locations + # Fixed [artf1051] : Copyright bumped to the right of the site + # Fixed [artf1059] : component editor bug + # Fixed [artf1041] : mod_mainmenu.xml: escape character for apostrophe missing + # Fixed [artf1040] : category manager not in content-menu + +17-Sep-2005 Levis Bisson + # Fixed [artf1037]: Media Manager not uploading + # Fixed [artf1025]: Registration admin notification + # Fixed [artf1043]: Template Chooser doesn't work + # Fixed [artf1042]: Template Chooser shows rogue entry + + +---------------- 1.0.0 Released -- [17-Sep-2005 00:30 UTC] ------------------ + + +Contains following Security Fixes +Medium Level Threat + * Fixed SQL injection bugs in user activation (thanks Enno Klasing) + +Low Level Threat + * Fixed [#6775] Display of static content without Itemid + +------- + +16-Sep-2005 Andrew Eddie + # Fixed: 1014 : & amp ; in pathway + # Fixed: Missing space in mosimage IMG tags + # Fixed: Incomplete function call - mysql_insert_id() + + Added nullDate handling to database class + + Added database::NameQuote function for quoting field names + # Fixed: com_checkin to properly use database class + # Fixed: Missed stripslashes in`global configuration - site` + + Added admin menu item to clear all caches (for 3rd party addons) + +16-Sep-2005 Emir Sakic + # Fixed sorting by author on frontend category listing + + Added time offset to copyright year in footer + # Fixed spelling in sam + # Reflected some file name changes in installer CHMOD + # Fixed bugs in paged search component + +16-Sep-2005 Alex Kempkens + + template contest winner 'MadeYourWeb' added + +16-Sep-2005 Rey Gigataras + + Pagination Support for Search Component + ^ Ordering of Toolbar Icons/buttons now more consistent + ^ Frontend Edit, status info moved to an overlib + ^ Search Component converted to GET method + # Fixed [artf1018] : Warning Backend Statistic + # Fixed [artf1016] : Notice: RSS undefined constant + # Fixed [artf1020] : Hide mosimages in blogview doesn't work + # Various Search Component Fixes + # Fixed Search Component not honouring Show/Hide Date Global Config setting + # Fixed [#6668] No static content edit icon for frontend logged in author + # Fixed [#6710] `Link to menu` function from components Category not working + # Fixed [#7011] Subtle bug in saveUser() - admin.users.php + # Fixed [#7120] Articles with `publish_up` today after noon are shown with status `pending` + # Fixed [#6669] mosmail BCC not working, send as CC + # Fixed [#7422] Weblink submission emails + # Fixed [#7196] mosRedirect and Input Filter CGI Error + # Fixed [#6814] com_wrapper Iframe Name tag / relative url modifications + # Fixed [#6844] rss version is wrong in the Live Bookmark feeds + # Fixed [#7120] Articles with `publish_up` today after noon are shown with status `pending` + # Fixed [#7161] Apparently unncessary code in sendNewPass - registration.php + +15-Sep-2005 Andy Miller + ^ Fixed some width issues with Admin template in IE + ^ Fixed some UI issues with Banners Component + ^ Added a default header image for components that don't specify one + +15-Sep-2005 Andrew Eddie + - Removed unused globals from joomla.php + + Added mosAbstractLog class + +15-Sep-2005 Rey Gigataras + + added `Apply` button to frontend Content editing + ^ Added publish date to syndicated feeds output [credit: gharding] + ^ Added RSS Enclosure support to feedcreator [credit: Joseph L. LeBlanc] + ^ Added Google Sitemap support to feedcreator + ^ Modified layout of Media Manager + ^ Added Media Manager support for XCF, ODG, ODT, ODS, ODP file formats + # Fixed use of 302 redirect instead of 301 + # Content frontend `Save` Content redirects to full content view + # Fixed Wrapper auto-height problem + # Queries cleaned of incorrect encapsulation of integer values + # Fixed Login Component redirection [credit: David Gal] + +15-Sep-2005 Arno Zijlstra + ^ changed tab images to fit new color + ^ changed overlib colors + +14-Sep-2005 Rey Gigataras + ^ Ugraded TinyMCE [2.0 RC2] + ^ Param tip style change to dashed underline + # Queries cleaned of incorrect encapsulation of integer values + +14-Sep-2005 Andrew Eddie + # Added PHP 5 compatibility functions file_put_contents and file_get_contents + + Added new version of js calendar + + mosAbstractTasker::setAccessControl method + + mosUser::getUserListFromGroup + + mosParameters::toObject and mosParameters::toArray + +13-Sep-2005 Andrew Eddie + ^ Rationalised global configuration handling + # Fixed polls access bug + # Fixed module positions preview to show positions regardless of module count + ^ Modified database:setQuery method to take offset and record limit + + Added alternative version of globals.php that emulates register_globals=off + # Added missing parent_id field from mosCategory class + +12-Sep-2005 Rey Gigataras + + Per User Editor selection + # Module styling applied to custom/new modules + # Fixed Agent Browser bug + +12-Sep-2005 Andrew Eddie + + New onAfterMainframe event added to site index.php + + Added dtree javascript library + + Added some extra useful toolbar icons + + Added css for fieldsets and legends and some 1.1 admin style formating + + Added mosDBTable::isCheckedOut() method, applied to components + # fixed bug in typedcontent edit - checked out is done before object load and always passes + ^ Updated Help toolbar button to accept component based help files + ^ Updated version class with new methods + + Added support for params file to have root tag + +12-Sep-2005 Andy Stewart + # Fixed issue with new content where Categories weren't displayed for sections + +12-Sep-2005 Andrew Eddie + ^ Upgrade DOMIT! and DOMIT!RSS (fixes issues in PHP 4.4.x) + + Added database.mysqli.php, a MySQL 4.1.x compatible version + + Added [Check Again] button to installation check screen + ^ Changed web installer to always use the database connector + # Fixed PHP 4.4 issues with new objects returning by reference + +11-Sep-2005 Rey Gigataras + + Output Buffering for Admin [pulled from Johan's work in 1.1] + + Loading of WYSIWYG Editor only when `editorArea` is present [pulled from Johan's work in 1.1] + ^ Upgraded JSCookMenu [1.4.3] + ^ Upgraded wz_tooltip [3.34] + ^ Upgraded Overlib [4.21] + ^ editor-xtd mosimage & mospagebreak button hidden on category, section & module pages + # Poll class $this-> bug + # Fixed change creator dropdown to exclude registered users (who do not have author rights) + +11-sep-2005 Arno Zijlstra + + Added offlinebar.php + ^ Changed site offline check + ^ Cosmetic change to offline.php + +11-Sep-2005 Andrew Eddie + + Added sort up and down icons + + Added mosPageNav::setTemplateVars method + +10-Sep-2005 Rey Gigataras + + `Submit - Content` menu type [credit: Jason Murpy] + +09-Sep-2005 Andy Miller + ^ made changes to new joomla admin template + ^ changed login lnf to match new admin template + ^ removed border and width, set padding on div.main in admin + ^ changed Force Logout text + +09-Sep-2005 Alex Kempkens + ^ changed mosHTML::makeOption to handle different coulmn names + ^ corrected several calls from makeOption in order to become multi lingual compatible + ^ corrected little fixes in query handling in order to get multi lingual compatible + + Added system bot's for better integration of ml support, ssl & multi sites + +08-Sep-2005 Rey Gigataras + + Added back Sys Info link in menubar + + Added Changelog link to Help area + ^ Cosmetic change to Toolbar Icon appearance + ^ Cosmetic change to QuickIcon appearance + ^ Toolbar icons now 'coloured' no longer 'greyed out' + ^ Dropdown menu now shows on edit pages but is inactive + # Fixed Newsfeed component generates image tag instead of img tag + # Fixed Joomlaxml: tooltips need to use label instead of name + # Fixed One parameter too many in orderModule call in admin.modules.php + # Fixed inabiility to show/hide VCard + # Fixed Mambot Manager filtering + +08-Sep-2005 Alex Kempkens + + mosParameter::_mos_filelist for xml parameters + ^ mos_ table prefix to jos_ in installation and in some other files. + + added category handling for contact component + + added color adapted joomla_admin template + +07-Sep-2005 Andrew Eddie + # Added label tags to mod_login (WCAG compliance) + # Added label tags to com_contact (WCAG compliance) + # Added label tags to com_search (WCAG compliance) + # Added label tag support to mosHTML::selectList (WCAG compliance) + # Added label tag support to mosHTML::radioList (WCAG compliance) + +01-Sep-2005 Andrew Eddie + + Added article_separator span after a content item + * SECURITY [ Critical Level ]: Hardened mosGetParam by using phpInputFilter for NO_HTML mode + + Added new mosHash function to produce secure keys + * SECURITY [ Low Level ]: Hardened Email to Friend form + +31-Aug-2005 Andrew Eddie + + Added setTemplateVars method to admin pageNavigation class + ^ Added auto mapping function to mosAbstractTasker constructor + + Added patHTML class for patTemplate utility methods + ^ Upgraded patTemplate library + ! patTemplate::createTemplate has changed parameters + - Removed requirement to accept GPL on installation + # Fixed bug in Send New Password function - mail from not defined + # Fixed undefined $row variable in wrapper component + # Fixed undefined $params in contacts component + - Removed unused getids.php + - Removed redundant whitespace + ^ Convert 4xSpace to tab + +08-Aug-2005 Andrew Eddie + * SECURITY [ Medium Level ]: Fixed SQL injection bugs in user activation (thanks Enno Klasing) + ^ Encased text files in PHP wrapper to help obsfucate version info + # Changed admin session name to hash of live_site to allow you to log into more than one Joomla! on the same host + # Fixed hardcoded (c) character in web installer files + # Fixed slow query in admin User Manager list screen + # Fixed bug in poll stats calculation + # Updated bug fixes in phpMailer class + # Fixed login bug for nested Joomla! sites on the same domain + +02-Aug-2005 Alex Kempkens + * SECURITY [ Low Level ]: Fixed [#6775] Display of static content without Itemid + # Fixed [#6330] Corrected default value of field + + +----- Derived from Mambo 4.5.2.3 circa. 17 Aug 12005 ----- + diff -urN joomla-1.0.7/administrator/components/com_admin/admin.admin.html.php joomla-1.0.10/administrator/components/com_admin/admin.admin.html.php --- joomla-1.0.7/administrator/components/com_admin/admin.admin.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_admin/admin.admin.html.php 2006-06-25 16:54:02.000000000 -0400 @@ -1,6 +1,6 @@ @@ -137,7 +137,7 @@ User Agent: @@ -334,11 +334,12 @@
    - +
    For all Joomla! functions and features to work ALL of the following directories should be writeable: + mosHTML::writableCell( 'templates' ); + mosHTML::writableCell( $mosConfig_cachepath, 0, 'Cache Directory ' ); + mosHTML::writableCell( $sp, 0, 'Session Directory ' ); + ?>
    @@ -382,7 +386,7 @@ */ function help() { global $mosConfig_live_site; - $helpurl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); + $helpurl = strval( mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ) ); if ( $helpurl == 'http://help.mamboserver.com' ) { $helpurl = 'http://help.joomla.org'; @@ -390,8 +394,8 @@ $fullhelpurl = $helpurl . '/index2.php?option=com_content&task=findkey&pop=1&keyref='; - $helpsearch = mosGetParam( $_REQUEST, 'helpsearch', '' ); - $page = mosGetParam( $_REQUEST, 'page', 'joomla.whatsnew100.html' ); + $helpsearch = strval( mosGetParam( $_REQUEST, 'helpsearch', '' ) ); + $page = strval( mosGetParam( $_REQUEST, 'page', 'joomla.whatsnew100.html' ) ); $toc = getHelpToc( $helpsearch ); if (!eregi( '\.html$', $page )) { $page .= '.xml'; @@ -560,7 +564,7 @@ */ function getHelpTOC( $helpsearch ) { global $mosConfig_absolute_path; - $helpurl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); + $helpurl = strval( mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ) ); $files = mosReadDirectory( $mosConfig_absolute_path . '/help/', '\.xml$|\.html$' ); diff -urN joomla-1.0.7/administrator/components/com_admin/admin.admin.php joomla-1.0.10/administrator/components/com_admin/admin.admin.php --- joomla-1.0.7/administrator/components/com_admin/admin.admin.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_admin/admin.admin.php 2006-06-25 16:54:02.000000000 -0400 @@ -1,6 +1,6 @@ getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "viewban{$option}limitstart", 'limitstart', 0 ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "viewban{$option}limitstart", 'limitstart', 0 ) ); // get the total number of records $query = "SELECT COUNT(*)" @@ -186,7 +186,7 @@ } // Sets impressions to unlimited when `unlimited` checkbox ticked - $unlimited = mosGetParam( $_POST, 'unlimited', 0 ); + $unlimited = intval( mosGetParam( $_POST, 'unlimited', 0 ) ); if ( $unlimited ) { $row->imptotal = 0; } @@ -264,8 +264,8 @@ function viewBannerClients( $option ) { global $database, $mainframe, $mosConfig_list_limit; - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "viewcli{$option}limitstart", 'limitstart', 0 ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "viewcli{$option}limitstart", 'limitstart', 0 ) ); // get the total number of records $query = "SELECT COUNT(*)" diff -urN joomla-1.0.7/administrator/components/com_categories/admin.categories.html.php joomla-1.0.10/administrator/components/com_categories/admin.categories.html.php --- joomla-1.0.7/administrator/components/com_categories/admin.categories.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_categories/admin.categories.html.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@ checked_out_contact_category && ( $row->checked_out_contact_category != $my->id ) ) { - echo $row->name .' ( '. $row->title .' )'; + echo stripslashes( $row->name ) .' ( '. stripslashes( $row->title ) .' )'; } else { ?> - name .' ( '. $row->title .' )'; ?> + name ) .' ( '. stripslashes( $row->title ) .' )'; ?> id ? 'Edit' : 'New';?> - [ : name; ?> ] + [ : name); ?> ] @@ -312,7 +312,7 @@ Category Title: - + @@ -320,7 +320,7 @@ Category Name: - + @@ -333,12 +333,20 @@ + Ordering: + + + + + + + Image: - + \n"; exit(); } + $row->title = addslashes( $row->title ); + $row->name = addslashes( $row->name ); + + // handling for MOSImage directories + if ( $row->section > 0 ) { + $folders = mosGetParam( $_POST, 'folders', array() ); + $folders = implode( ',', $folders ); + + if ( strpos( $folders, '*2*' ) !== false ) { + $folders = '*2*'; + } else if ( strpos( $folders, '*1*' ) !== false ) { + $folders = '*1*'; + } else if ( strpos( $folders, '*0*' ) !== false ) { + $folders = '*0*'; + } else if ( strpos( $folders, ',*#*' ) !== false ) { + $folders = str_replace( ',*#*', '', $folders ); + } else if ( strpos( $folders, '*#*,' ) !== false ) { + $folders = str_replace( '*#*,', '', $folders ); + } else if ( strpos( $folders, '*#*' ) !== false ) { + $folders = str_replace( '*#*', '', $folders ); + } + + $row->params = 'imagefolders='. $folders; + } + if (!$row->check()) { echo "\n"; exit(); @@ -451,6 +522,7 @@ echo "\n"; exit(); } + $row->checkin(); $row->updateOrder( "section = '$row->section'" ); @@ -475,12 +547,16 @@ ; $database->setQuery( $query ); } - if (!$database->query()) { echo "\n"; exit(); } - + + if ($redirect == 'content') { + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + } + switch ( $task ) { case 'go2menu': mosRedirect( 'index2.php?option=com_menus&menutype='. $menu ); @@ -562,7 +638,12 @@ echo "\n"; } } - + + if ($section == 'content') { + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + } + if (count( $err )) { $cids = implode( "\', \'", $err ); $msg = 'Category(s): '. $cids .' cannot be removed as they contain records'; @@ -608,12 +689,17 @@ echo "\n"; exit(); } - + if (count( $cid ) == 1) { $row = new mosCategory( $database ); $row->checkin( $cid[0] ); } + if ($section == 'content') { + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + } + mosRedirect( 'index2.php?option=com_categories§ion='. $section ); } @@ -625,7 +711,7 @@ function cancelCategory() { global $database; - $redirect = mosGetParam( $_POST, 'redirect', '' ); + $redirect = strval( mosGetParam( $_POST, 'redirect', '' ) ); $row = new mosCategory( $database ); $row->bind( $_POST ); @@ -644,6 +730,9 @@ $row = new mosCategory( $database ); $row->load( $uid ); $row->move( $inc, "section = '$row->section'" ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option=com_categories§ion='. $row->section ); } @@ -701,7 +790,7 @@ function moveCategorySave( $cid, $sectionOld ) { global $database; - $sectionMove = mosGetParam( $_REQUEST, 'sectionmove', '' ); + $sectionMove = strval( mosGetParam( $_REQUEST, 'sectionmove', '' ) ); $cids = implode( ',', $cid ); $total = count( $cid ); @@ -726,7 +815,12 @@ } $sectionNew = new mosSection ( $database ); $sectionNew->load( $sectionMove ); - + + if ($sectionOld == 'content') { + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + } + $msg = $total ." Categories moved to ". $sectionNew->name; mosRedirect( 'index2.php?option=com_categories§ion='. $sectionOld .'&mosmsg='. $msg ); } @@ -784,7 +878,7 @@ function copyCategorySave( $cid, $sectionOld ) { global $database; - $sectionMove = mosGetParam( $_REQUEST, 'sectionmove', '' ); + $sectionMove = strval( mosGetParam( $_REQUEST, 'sectionmove', '' ) ); $contentid = mosGetParam( $_REQUEST, 'item', '' ); $total = count( $contentid ); @@ -836,7 +930,12 @@ $sectionNew = new mosSection ( $database ); $sectionNew->load( $sectionMove ); - + + if ($sectionOld == 'content') { + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + } + $msg = $total .' Categories copied to '. $sectionNew->name; mosRedirect( 'index2.php?option=com_categories§ion='. $sectionOld .'&mosmsg='. $msg ); } @@ -858,6 +957,11 @@ if ( !$row->store() ) { return $row->getError(); } + + if ($section == 'content') { + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + } mosRedirect( 'index2.php?option=com_categories§ion='. $section ); } @@ -869,12 +973,14 @@ $category->bind( $_POST ); $category->checkin(); - $redirect = mosGetParam( $_POST, 'redirect', '' ); - $menu = mosGetParam( $_POST, 'menuselect', '' ); - $name = mosGetParam( $_POST, 'link_name', '' ); + $redirect = strval( mosGetParam( $_POST, 'redirect', '' ) ); + $menu = strval( mosGetParam( $_POST, 'menuselect', '' ) ); + $name = strval( mosGetParam( $_POST, 'link_name', '' ) ); $sectionid = mosGetParam( $_POST, 'sectionid', '' ); - $type = mosGetParam( $_POST, 'link_type', '' ); + $type = strval( mosGetParam( $_POST, 'link_type', '' ) ); + $name = stripslashes( ampReplace($name) ); + switch ( $type ) { case 'content_category': $link = 'index.php?option=com_content&task=category§ionid='. $sectionid .'&id='. $id; @@ -930,7 +1036,12 @@ } $row->checkin(); $row->updateOrder( "menutype = '$menu'" ); - + + if ($redirect == 'content') { + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + } + $msg = $name .' ( '. $menutype .' ) in menu: '. $menu .' successfully created'; mosRedirect( 'index2.php?option=com_categories§ion='. $redirect .'&task=editA&hidemainmenu=1&id='. $id, $msg ); } @@ -970,7 +1081,30 @@ $row->updateOrder( $cond[1] ); } // foreach + if ($section == 'content') { + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + } + $msg = 'New ordering saved'; mosRedirect( 'index2.php?option=com_categories§ion='. $section, $msg ); } // saveOrder -?> + +function recursive_listdir( $base ) { + static $filelist = array(); + static $dirlist = array(); + + if(is_dir($base)) { + $dh = opendir($base); + while (false !== ($dir = readdir($dh))) { + if (is_dir($base .'/'. $dir) && $dir !== '.' && $dir !== '..' && strtolower($dir) !== 'cvs' && strtolower($dir) !== '.svn') { + $subbase = $base .'/'. $dir; + $dirlist[] = $subbase; + $subdirlist = recursive_listdir($subbase); + } + } + closedir($dh); + } + return $dirlist; +} +?> \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_config/admin.config.html.php joomla-1.0.10/administrator/components/com_config/admin.config.html.php --- joomla-1.0.7/administrator/components/com_config/admin.config.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_config/admin.config.html.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@
    @@ -143,14 +154,14 @@ Offline Message: - System Error Message: - @@ -189,11 +200,34 @@ ?> + Frontend Login: + + + + + + + Frontend User Params: + + + + + + Debug Site: - + + + ?> + Default WYSIWYG Editor: @@ -201,10 +235,13 @@ List Length: - + + + ?> + Favourites Site Icon: @@ -414,11 +451,37 @@   - Login Session Lifetime: + Site Session Lifetime:  seconds  - + site/frontend users. The higher the value the greater the security risk!'); ?> + +   + + + Admin Session Lifetime: + + +  seconds  + admin/backend users. The higher the value the greater the security risk!'); ?> + +   + + + Remember Expired Admin page: + + + + +   + + + Session Authentication Method: + + +    +
    If you have a number of users using AOL or behind Proxy banks, you might consider using the Level 2 setting' ); ?>   @@ -597,11 +660,11 @@ - + - + diff -urN joomla-1.0.7/administrator/components/com_config/admin.config.php joomla-1.0.10/administrator/components/com_config/admin.config.php --- joomla-1.0.7/administrator/components/com_config/admin.config.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_config/admin.config.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ config_list_limit ? $row->config_list_limit : 50 ) ); + $lists['frontend_login'] = mosHTML::yesnoRadioList( 'config_frontend_login', 'class="inputbox"', $row->config_frontend_login ); + // DEBUG $lists['debug'] = mosHTML::yesnoRadioList( 'config_debug', 'class="inputbox"', $row->config_debug ); @@ -137,6 +139,14 @@ // SERVER SETTINGS $lists['gzip'] = mosHTML::yesnoRadioList( 'config_gzip', 'class="inputbox"', $row->config_gzip ); + + $session = array( + mosHTML::makeOption( 0, 'Level 3 Security- Default & Highest' ), + mosHTML::makeOption( 1, 'Level 2 Security - Allow for proxy IPs' ), + mosHTML::makeOption( 2, 'Level 1 Security - Backward Compatibility' ) + ); + + $lists['session_type'] = mosHTML::selectList( $session, 'config_session_type', 'class="inputbox" size="1"', 'value', 'text', $row->config_session_type ); $errors = array( mosHTML::makeOption( -1, 'System Default' ), @@ -146,7 +156,8 @@ ); $lists['error_reporting'] = mosHTML::selectList( $errors, 'config_error_reporting', 'class="inputbox" size="1"', 'value', 'text', $row->config_error_reporting ); - + + $lists['admin_expired'] = mosHTML::yesnoRadioList( 'config_admin_expired', 'class="inputbox"', $row->config_admin_expired ); // LOCALE SETTINGS @@ -222,7 +233,8 @@ $lists['uniquemail'] = mosHTML::yesnoRadioList( 'config_uniquemail', 'class="inputbox"', $row->config_uniquemail ); $lists['shownoauth'] = mosHTML::yesnoRadioList( 'config_shownoauth', 'class="inputbox"', $row->config_shownoauth ); - + + $lists['frontend_userparams'] = mosHTML::yesnoRadioList( 'config_frontend_userparams', 'class="inputbox"', $row->config_frontend_userparams ); // META SETTINGS @@ -294,13 +306,26 @@ * Save the configuration */ function saveconfig( $task ) { - global $database, $mosConfig_absolute_path, $mosConfig_password; + global $database, $mosConfig_absolute_path, $mosConfig_password, $mosConfig_session_type; $row = new mosConfig(); if (!$row->bind( $_POST )) { mosRedirect( 'index2.php', $row->getError() ); } + // if Session Authentication Type changed, delete all old Frontend sessions only - which used old Authentication Type + if ( $mosConfig_session_type != $row->config_session_type ) { + $past = time(); + $query = "DELETE FROM #__session" + . "\n WHERE time < '$past'" + . "\n AND (" + . "\n ( guest = 1 AND userid = 0 ) OR ( guest = 0 AND gid > 0 )" + . "\n )" + ; + $database->setQuery( $query ); + $database->query(); + } + $server_time = date( 'O' ) / 100; $offset = $_POST['config_offset_user'] - $server_time; $row->config_offset = $offset; @@ -308,6 +333,23 @@ //override any possible database password change $row->config_password = $mosConfig_password; + // handling of special characters + $row->config_sitename = htmlspecialchars( $row->config_sitename, ENT_QUOTES ); + $row->config_MetaDesc = htmlspecialchars( $row->config_MetaDesc, ENT_QUOTES ); + $row->config_MetaKeys = htmlspecialchars( $row->config_MetaKeys, ENT_QUOTES ); + + // handling of quotes (double and single) and amp characters + // htmlspecialchars not used to preserve ability to insert other html characters + $row->config_offline_message = ampReplace( $row->config_offline_message ); + $row->config_offline_message = str_replace( '"', '"', $row->config_offline_message ); + $row->config_offline_message = str_replace( "'", ''', $row->config_offline_message ); + + // handling of quotes (double and single) and amp characters + // htmlspecialchars not used to preserve ability to insert other html characters + $row->config_error_message = ampReplace( $row->config_error_message ); + $row->config_error_message = str_replace( '"', '"', $row->config_error_message ); + $row->config_error_message = str_replace( "'", ''', $row->config_error_message ); + $config = "getVarText(); $config .= "setlocale (LC_TIME, \$mosConfig_locale);\n"; @@ -315,7 +357,7 @@ $fname = $mosConfig_absolute_path . '/configuration.php'; - $enable_write = mosGetParam($_POST,'enable_write',0); + $enable_write = intval( mosGetParam( $_POST, 'enable_write', 0 ) ); $oldperms = fileperms($fname); if ( $enable_write ) { @chmod( $fname, $oldperms | 0222); diff -urN joomla-1.0.7/administrator/components/com_config/config.class.php joomla-1.0.10/administrator/components/com_config/config.class.php --- joomla-1.0.7/administrator/components/com_config/config.class.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_config/config.class.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); require_once( $mainframe->getPath( 'class' ) ); -$id = mosGetParam( $_GET, 'id', 0 ); $cid = mosGetParam( $_POST, 'cid', array(0) ); if (!is_array( $cid )) { $cid = array(0); @@ -37,7 +36,7 @@ break; case 'edit': - editContact( $cid[0], $option ); + editContact( intval( $cid[0] ), $option ); break; case 'editA': @@ -61,11 +60,11 @@ break; case 'orderup': - orderContacts( $cid[0], -1, $option ); + orderContacts( intval( $cid[0] ), -1, $option ); break; case 'orderdown': - orderContacts( $cid[0], 1, $option ); + orderContacts( intval( $cid[0] ), 1, $option ); break; case 'cancel': @@ -84,9 +83,9 @@ function showContacts( $option ) { global $database, $mainframe, $mosConfig_list_limit; - $catid = $mainframe->getUserStateFromRequest( "catid{$option}", 'catid', 0 ); - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ); + $catid = intval( $mainframe->getUserStateFromRequest( "catid{$option}", 'catid', 0 ) ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ) ); $search = $mainframe->getUserStateFromRequest( "search{$option}", 'search', '' ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); @@ -302,7 +301,9 @@ $row = new mosContact( $database ); $row->load( $uid ); + $row->updateOrder(); $row->move( $inc, "published >= 0" ); + $row->updateOrder(); mosRedirect( "index2.php?option=$option" ); } diff -urN joomla-1.0.7/administrator/components/com_contact/contact.xml joomla-1.0.10/administrator/components/com_contact/contact.xml --- joomla-1.0.7/administrator/components/com_contact/contact.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_contact/contact.xml 2006-06-25 16:54:03.000000000 -0400 @@ -76,5 +76,10 @@ + + + + + diff -urN joomla-1.0.7/administrator/components/com_content/admin.content.html.php joomla-1.0.10/administrator/components/com_content/admin.content.html.php --- joomla-1.0.7/administrator/components/com_content/admin.content.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_content/admin.content.html.php 2006-06-25 16:54:04.000000000 -0400 @@ -1,1187 +1,1212 @@ - - - -
    Global Site Meta Description:
    Global Site Meta Keywords:
    Show Title Meta Tag:
    - - - - - - - - - - - - -
    - - Content Items Manager [ Section: All ] - - Content Items Manager [ Section: title; ?> ] - - - - - - - -
    - Filter: - - -
    - - - - - - - - - - - - - - - - - - - - - getNullDate(); - for ($i=0, $n=count( $rows ); $i < $n; $i++) { - $row = &$rows[$i]; - - $link = 'index2.php?option=com_content§ionid='. $redirect .'&task=edit&hidemainmenu=1&id='. $row->id; - - $row->sect_link = 'index2.php?option=com_sections&task=editA&hidemainmenu=1&id='. $row->sectionid; - $row->cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id='. $row->catid; - - $now = date( 'Y-m-d H:i:s' ); - if ( $now <= $row->publish_up && $row->state == "1" ) { - $img = 'publish_y.png'; - $alt = 'Published'; - } else if ( ( $now <= $row->publish_down || $row->publish_down == $nullDate ) && $row->state == "1" ) { - $img = 'publish_g.png'; - $alt = 'Published'; - } else if ( $now > $row->publish_down && $row->state == "1" ) { - $img = 'publish_r.png'; - $alt = 'Expired'; - } elseif ( $row->state == "0" ) { - $img = "publish_x.png"; - $alt = 'Unpublished'; - } - $times = ''; - if (isset($row->publish_up)) { - if ($row->publish_up == $nullDate) { - $times .= ""; - } else { - $times .= ""; - } - } - if (isset($row->publish_down)) { - if ($row->publish_down == $nullDate) { - $times .= ""; - } else { - $times .= ""; - } - } - - if ( $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ) ) { - if ( $row->created_by_alias ) { - $author = $row->created_by_alias; - } else { - $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id='. $row->created_by; - $author = ''. $row->author .''; - } - } else { - if ( $row->created_by_alias ) { - $author = $row->created_by_alias; - } else { - $author = $row->author; - } - } - - $date = mosFormatDate( $row->created, '%x' ); - - $access = mosCommonHTML::AccessProcessing( $row, $i ); - $checked = mosCommonHTML::CheckedOutProcessing( $row, $i ); - ?> - "> - - - - - - - - - - - - - - - - - - - - -
    - # - - - - Title - - Published - - Front Page - - Reorder - - Order - - Save Order - - Access - - ID - - Section - - Category - - Author - - Date -
    Start: Always
    Start: $row->publish_up
    Finish: No Expiry
    Finish: $row->publish_down
    - rowNumber( $i ); ?> - - - - checked_out && ( $row->checked_out != $my->id )) { - echo $row->title; - } else { - ?> - - title, ENT_QUOTES); ?> - - - - ')"> - <?php echo $alt; ?> - - - - <?php echo ( $row->frontpage ) ? 'Yes' : 'No';?> - - - orderUpIcon( $i, ($row->catid == @$rows[$i-1]->catid) ); ?> - - orderDownIcon( $i, $n, ($row->catid == @$rows[$i+1]->catid) ); ?> - - - - - - id; ?> - - - section_name; ?> - - - - name; ?> - - - - - -
    - - getListFooter(); ?> - - - - - - - - -
    - - -
    - - - - - - - - - - - - - - -
    - - Archive Manager [ Section: All ] - - Archive Manager [ Section: title; ?> ] - - - - - - - -
    - Filter: - - -
    - - - - - - - - - - - - - cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id='. $row->catid; - - if ( $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ) ) { - if ( $row->created_by_alias ) { - $author = $row->created_by_alias; - } else { - $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id='. $row->created_by; - $author = ''. $row->author .''; - } - } else { - if ( $row->created_by_alias ) { - $author = $row->created_by_alias; - } else { - $author = $row->author; - } - } - - $date = mosFormatDate( $row->created, '%x' ); - ?> - "> - - - - - - - - - -
    - # - - - - Title - - Order - - Save Order - - Category - - Author - - Date -
    - rowNumber( $i ); ?> - - id ); ?> - - title; ?> - - - - - name; ?> - - - - - -
    - - getListFooter(); ?> - - - - - - - - -
    - $row is passed with the id - * property set to 0. - * @param mosContent The category object - * @param string The html for the groups select list - */ - function editContent( &$row, $section, &$lists, &$sectioncategories, &$images, &$params, $option, $redirect, &$menus ) { - global $mosConfig_live_site; - - mosMakeHtmlSafe( $row ); - - $create_date = null; - if (intval( $row->created ) != 0) { - $create_date = mosFormatDate( $row->created, '%A, %d %B %Y %H:%M', '0' ); - } - $mod_date = null; - if (intval( $row->modified ) != 0) { - $mod_date = mosFormatDate( $row->modified, '%A, %d %B %Y %H:%M', '0' ); - } - - $tabs = new mosTabs(1); - - - // used to hide "Reset Hits" when hits = 0 - if ( !$row->hits ) { - $visibility = "style='display: none; visbility: hidden;'"; - } else { - $visibility = ""; - } - - mosCommonHTML::loadOverlib(); - mosCommonHTML::loadCalendar(); - ?> - -
    - - - - -
    - Content Item: - - id ? 'Edit' : 'New';?> - - id ) { - ?> - - [ Section: ] - - -
    - - - - - - -
    - - - - - - - - - - -
    - - - - - - - - - - - - - - - - -
    - Item Details -
    - Title: - - - - Section: - - -
    - Title Alias: - - - - Category: - - -
    -
    - Intro Text: (required) -
    introtext , 'introtext', '100%;', '350', '75', '20' ) ; ?> -
    - Main Text: (optional) -
    fulltext , 'fulltext', '100%;', '400', '75', '30' ) ; ?> -
    -
    - - - - -
    - startPane("content-pane"); - $tabs->startTab("Publishing","publish-page"); - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Publishing Info -
    - Show on Frontpage: - - frontpage ? 'checked="checked"' : ''; ?> /> -
    - Published: - - state ? 'checked="checked"' : ''; ?> /> -
    - Access Level: - -
    - Author Alias: - - -
    - Change Creator: - -
    Ordering: -
    - Override Created Date - - - -
    - Start Publishing: - - - -
    - Finish Publishing: - - - -
    -
    - - id ) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Content ID: - - id; ?> -
    - State: - - state > 0 ? 'Published' : ($row->state < 0 ? 'Archived' : 'Draft Unpublished');?> -
    - - Hits - : - - hits;?> -
    > - -
    -
    - - Revised - : - - version;?> times -
    - - Created - - - created ? "$create_date
    By$row->creator" : "New document"; ?> -
    - - Last Modified - - - modified ? "$mod_date
    By$row->modifier" : "Not modified";?> -
    - endTab(); - $tabs->startTab("Images","images-page"); - ?> - - - - - - - - - - - - - - -
    - MOSImage Control -
    - - - - - - -
    -
    - Gallery Images: -
    - -
    - Sub-folder: -
    -
    - -
    - -
    -
    - Content Images: -
    - -
    - - -
    -
    -
    -
    - Sample Image:
    - -
    -
    -
    - Active Image:
    - -
    -
    - Edit the image selected: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Source: - - -
    - Image Align: - - -
    - Alt Text: - - -
    - Border: - - -
    - Caption: - - -
    - Caption Position: - - -
    - Caption Align: - - -
    - Caption Width: - - -
    - -
    -
    - endTab(); - $tabs->startTab("Parameters","params-page"); - ?> - - - - - - - - - - -
    - Parameter Control -
    - * These Parameters only control what you see when you click to view an item fully * -

    -
    - render();?> -
    - endTab(); - $tabs->startTab("Meta Info","metadata-page"); - ?> - - - - - - - - - - - - - -
    - Meta Data -
    - Description: -
    - -
    - Keywords: -
    - -
    - -
    - endTab(); - $tabs->startTab("Link to Menu","link-page"); - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Link to Menu -
    - This will create a 'Link - Content Item' in the menu you select -

    -
    - Select a Menu - - -
    - Menu Item Name - - -
    - - -
    - Existing Menu Links -
    - None -
    -
    - endTab(); - $tabs->endPane(); - ?> -
    -
    - - - - - - - - - -
    - - - -
    -
    - - - - -
    - Move Items -
    - -
    - - - - - -
    - Move to Section/Category: -
    - -

    -
    - Items being Moved: -
    - "; - foreach ( $items as $item ) { - echo "
  • ". $item->title ."
  • "; - } - echo ""; - ?> -
    -

    - - - - - "; - } - ?> -
    - - -
    -
    - - - - -
    - Copy Content Items -
    - -
    - - - - - -
    - Copy to Section/Category: -
    - -

    -
    - Items being copied: -
    - "; - foreach ( $items as $item ) { - echo "
  • ". $item->title ."
  • "; - } - echo ""; - ?> -
    -

    - - - - - "; - } - ?> -
    - +
    + + + + + + + + + + + + + + +
    + + Content Items Manager [ Section: All ] + + Content Items Manager [ Section: title; ?> ] + + + + + + + +
    + Filter: + + +
    + + + + + + + + + + + + + + + + + + + + + getNullDate(); + for ($i=0, $n=count( $rows ); $i < $n; $i++) { + $row = &$rows[$i]; + + $link = 'index2.php?option=com_content§ionid='. $redirect .'&task=edit&hidemainmenu=1&id='. $row->id; + + $row->sect_link = 'index2.php?option=com_sections&task=editA&hidemainmenu=1&id='. $row->sectionid; + $row->cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id='. $row->catid; + + $now = _CURRENT_SERVER_TIME; + if ( $now <= $row->publish_up && $row->state == 1 ) { + // Published + $img = 'publish_y.png'; + $alt = 'Published'; + } else if ( ( $now <= $row->publish_down || $row->publish_down == $nullDate ) && $row->state == 1 ) { + // Pending + $img = 'publish_g.png'; + $alt = 'Published'; + } else if ( $now > $row->publish_down && $row->state == 1 ) { + // Expired + $img = 'publish_r.png'; + $alt = 'Expired'; + } elseif ( $row->state == 0 ) { + // Unpublished + $img = 'publish_x.png'; + $alt = 'Unpublished'; + } + + // correct times to include server offset info + $row->publish_up = mosFormatDate( $row->publish_up, _CURRENT_SERVER_TIME_FORMAT ); + if (trim( $row->publish_down ) == $nullDate || trim( $row->publish_down ) == '' || trim( $row->publish_down ) == '-' ) { + $row->publish_down = 'Never'; + } + $row->publish_down = mosFormatDate( $row->publish_down, _CURRENT_SERVER_TIME_FORMAT ); + + $times = ''; + if ($row->publish_up == $nullDate) { + $times .= ""; + } else { + $times .= ""; + } + if ($row->publish_down == $nullDate || $row->publish_down == 'Never') { + $times .= ""; + } else { + $times .= ""; + } + + if ( $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ) ) { + if ( $row->created_by_alias ) { + $author = $row->created_by_alias; + } else { + $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id='. $row->created_by; + $author = ''. $row->author .''; + } + } else { + if ( $row->created_by_alias ) { + $author = $row->created_by_alias; + } else { + $author = $row->author; + } + } + + $date = mosFormatDate( $row->created, '%x' ); + + $access = mosCommonHTML::AccessProcessing( $row, $i ); + $checked = mosCommonHTML::CheckedOutProcessing( $row, $i ); + ?> + "> + + + + + + + + + + + + + + + + + + + + +
    + # + + + + Title + + Published + + Front Page + + Reorder + + Order + + Save Order + + Access + + ID + + Section + + Category + + Author + + Date +
    Start: Always
    Start: $row->publish_up
    Finish: No Expiry
    Finish: $row->publish_down
    + rowNumber( $i ); ?> + + + + checked_out && ( $row->checked_out != $my->id )) { + echo $row->title; + } else { + ?> + + title, ENT_QUOTES); ?> + + + + ')"> + <?php echo $alt; ?> + + + + <?php echo ( $row->frontpage ) ? 'Yes' : 'No';?> + + + orderUpIcon( $i, ($row->catid == @$rows[$i-1]->catid) ); ?> + + orderDownIcon( $i, $n, ($row->catid == @$rows[$i+1]->catid) ); ?> + + + + + + id; ?> + + + section_name; ?> + + + + name; ?> + + + + + +
    + + getListFooter(); ?> + + + + + + + + +
    + + +
    + + + + + + + + + + + + + + +
    + + Archive Manager [ Section: All ] + + Archive Manager [ Section: title; ?> ] + + + + + + + +
    + Filter: + + +
    + + + + + + + + + + + + + cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id='. $row->catid; + + if ( $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ) ) { + if ( $row->created_by_alias ) { + $author = $row->created_by_alias; + } else { + $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id='. $row->created_by; + $author = ''. $row->author .''; + } + } else { + if ( $row->created_by_alias ) { + $author = $row->created_by_alias; + } else { + $author = $row->author; + } + } + + $date = mosFormatDate( $row->created, '%x' ); + ?> + "> + + + + + + + + + +
    + # + + + + Title + + Order + + Save Order + + Category + + Author + + Date +
    + rowNumber( $i ); ?> + + id ); ?> + + title; ?> + + + + + name; ?> + + + + + +
    + + getListFooter(); ?> + + + + + + + + +
    + $row is passed with the id + * property set to 0. + * @param mosContent The category object + * @param string The html for the groups select list + */ + function editContent( &$row, $section, &$lists, &$sectioncategories, &$images, &$params, $option, $redirect, &$menus ) { + global $database; + + mosMakeHtmlSafe( $row ); + + $nullDate = $database->getNullDate(); + $create_date = null; + + if ( $row->created != $nullDate ) { + $create_date = mosFormatDate( $row->created, '%A, %d %B %Y %H:%M', '0' ); + } + $mod_date = null; + if ( $row->modified != $nullDate ) { + $mod_date = mosFormatDate( $row->modified, '%A, %d %B %Y %H:%M', '0' ); + } + + $tabs = new mosTabs(1); + + // used to hide "Reset Hits" when hits = 0 + if ( !$row->hits ) { + $visibility = "style='display: none; visibility: hidden;'"; + } else { + $visibility = ""; + } + + mosCommonHTML::loadOverlib(); + mosCommonHTML::loadCalendar(); + ?> + +
    + + + + +
    + Content Item: + + id ? 'Edit' : 'New';?> + + id ) { + ?> + + [ Section: ] + + +
    + + + + + + +
    + + + + + + + + + + +
    + + + + + + + + + + + + + + + + +
    + Item Details +
    + Title: + + + + Section: + + +
    + Title Alias: + + + + Category: + + +
    +
    + Intro Text: (required) +
    introtext, 'introtext', '100%;', '350', '75', '20' ) ; ?> +
    + Main Text: (optional) +
    fulltext, 'fulltext', '100%;', '400', '75', '30' ) ; ?> +
    +
    + startPane("content-pane"); + $tabs->startTab("Publishing","publish-page"); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Publishing Info +
    + Show on Frontpage: + + frontpage ? 'checked="checked"' : ''; ?> /> +
    + Published: + + state ? 'checked="checked"' : ''; ?> /> +
    + Access Level: + + +
    + Author Alias: + + +
    + Change Creator: + + +
    Ordering: + +
    + Override Created Date + + + +
    + Start Publishing: + + + +
    + Finish Publishing: + + + +
    +
    + + id ) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Content ID: + + id; ?> +
    + State: + + state > 0 ? 'Published' : ($row->state < 0 ? 'Archived' : 'Draft Unpublished');?> +
    + + Hits + : + + hits;?> +
    > + +
    +
    + + Revised + : + + version;?> times +
    + + Created + + + + New document + +
    + + Last Modified + + + + Not modified + +
    + modifier; + } + ?> +
    + endTab(); + $tabs->startTab("Images","images-page"); + ?> + + + + + + + + + + + + + + +
    + MOSImage Control +
    + + + + + + +
    +
    + Gallery Images: +
    + +
    +
    + +
    + +
    +
    + Content Images: +
    + +
    + + +
    +
    + Sub-folder: +
    +
    + Sample Image:
    + Sample Image +
    +
    +
    + Active Image:
    + Active Image +
    +
    + Edit the image selected: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Source: + + +
    + Image Align: + + +
    + Alt Text: + + +
    + Border: + + +
    + Caption: + + +
    + Caption Position: + + +
    + Caption Align: + + +
    + Caption Width: + + +
    + +
    +
    + endTab(); + $tabs->startTab("Parameters","params-page"); + ?> + + + + + + + + + + +
    + Parameter Control +
    + * These Parameters only control what you see when you click to view an item fully * +

    +
    + render();?> +
    + endTab(); + $tabs->startTab("Meta Info","metadata-page"); + ?> + + + + + + + + + + + + + +
    + Meta Data +
    + Description: +
    + +
    + Keywords: +
    + +
    + +
    + endTab(); + $tabs->startTab("Link to Menu","link-page"); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Link to Menu +
    + This will create a 'Link - Content Item' in the menu you select +

    +
    + Select a Menu + + +
    + Menu Item Name + + +
    + + +
    + Existing Menu Links +
    + None +
    +
    + endTab(); + $tabs->endPane(); + ?> +
    + + + + + + + + + +
    + + + +
    +
    + + + + +
    + Move Items +
    + +
    + + + + + +
    + Move to Section/Category: +
    + +

    +
    + Items being Moved: +
    + "; + foreach ( $items as $item ) { + echo "
  • ". $item->title ."
  • "; + } + echo ""; + ?> +
    +

    + + + + + "; + } + ?> +
    + + +
    +
    + + + + +
    + Copy Content Items +
    + +
    + + + + + +
    + Copy to Section/Category: +
    + +

    +
    + Items being copied: +
    + "; + foreach ( $items as $item ) { + echo "
  • ". $item->title ."
  • "; + } + echo ""; + ?> +
    +

    + + + + + "; + } + ?> +
    + \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_content/admin.content.php joomla-1.0.10/administrator/components/com_content/admin.content.php --- joomla-1.0.7/administrator/components/com_content/admin.content.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_content/admin.content.php 2006-06-25 16:54:04.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); -$sectionid = mosGetParam( $_REQUEST, 'sectionid', 0 ); -$id = mosGetParam( $_REQUEST, 'id', '' ); +$sectionid = intval( mosGetParam( $_REQUEST, 'sectionid', 0 ) ); $cid = mosGetParam( $_POST, 'cid', array(0) ); if (!is_array( $cid )) { $cid = array(0); @@ -34,7 +33,7 @@ break; case 'editA': - editContent( $cid[0], '', $option ); + editContent( intval( $cid[0] ), '', $option ); break; case 'go2menu': @@ -43,7 +42,6 @@ case 'menulink': case 'apply': case 'save': - mosCache::cleanCache( 'com_content' ); saveContent( $sectionid, $task ); break; @@ -76,11 +74,11 @@ break; case 'orderup': - orderContent( $cid[0], -1, $option ); + orderContent( intval( $cid[0] ), -1, $option ); break; case 'orderdown': - orderContent( $cid[0], 1, $option ); + orderContent( intval( $cid[0] ), 1, $option ); break; case 'showarchive': @@ -104,15 +102,15 @@ break; case 'accesspublic': - accessMenu( $cid[0], 0, $option ); + accessMenu( intval( $cid[0] ), 0, $option ); break; case 'accessregistered': - accessMenu( $cid[0], 1, $option ); + accessMenu( intval( $cid[0] ), 1, $option ); break; case 'accessspecial': - accessMenu( $cid[0], 2, $option ); + accessMenu( intval( $cid[0] ), 2, $option ); break; case 'saveorder': @@ -131,11 +129,11 @@ function viewContent( $sectionid, $option ) { global $database, $mainframe, $mosConfig_list_limit; - $catid = $mainframe->getUserStateFromRequest( "catid{$option}{$sectionid}", 'catid', 0 ); - $filter_authorid = $mainframe->getUserStateFromRequest( "filter_authorid{$option}{$sectionid}", 'filter_authorid', 0 ); - $filter_sectionid = $mainframe->getUserStateFromRequest( "filter_sectionid{$option}{$sectionid}", 'filter_sectionid', 0 ); - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}{$sectionid}limitstart", 'limitstart', 0 ); + $catid = intval( $mainframe->getUserStateFromRequest( "catid{$option}{$sectionid}", 'catid', 0 ) ); + $filter_authorid = intval( $mainframe->getUserStateFromRequest( "filter_authorid{$option}{$sectionid}", 'filter_authorid', 0 ) ); + $filter_sectionid = intval( $mainframe->getUserStateFromRequest( "filter_sectionid{$option}{$sectionid}", 'filter_sectionid', 0 ) ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}{$sectionid}limitstart", 'limitstart', 0 ) ); $search = $mainframe->getUserStateFromRequest( "search{$option}{$sectionid}", 'search', '' ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); $redirect = $sectionid; @@ -190,7 +188,9 @@ // get the total number of records $query = "SELECT COUNT(*)" - . "\n FROM ( #__content AS c, #__categories AS cc, #__sections AS s )" + . "\n FROM #__content AS c" + . "\n LEFT JOIN #__categories AS cc ON cc.id = c.catid" + . "\n LEFT JOIN #__sections AS s ON s.id = c.sectionid" . ( count( $where ) ? "\n WHERE " . implode( ' AND ', $where ) : "" ) ; $database->setQuery( $query ); @@ -199,16 +199,17 @@ $pageNav = new mosPageNav( $total, $limitstart, $limit ); $query = "SELECT c.*, g.name AS groupname, cc.name, u.name AS editor, f.content_id AS frontpage, s.title AS section_name, v.name AS author" - . "\n FROM ( #__content AS c, #__categories AS cc, #__sections AS s )" + . "\n FROM #__content AS c" + . "\n LEFT JOIN #__categories AS cc ON cc.id = c.catid" + . "\n LEFT JOIN #__sections AS s ON s.id = c.sectionid" . "\n LEFT JOIN #__groups AS g ON g.id = c.access" . "\n LEFT JOIN #__users AS u ON u.id = c.checked_out" . "\n LEFT JOIN #__users AS v ON v.id = c.created_by" . "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = c.id" - . ( count( $where ) ? "\nWHERE " . implode( ' AND ', $where ) : '' ) + . ( count( $where ) ? "\n WHERE " . implode( ' AND ', $where ) : '' ) . $order - . "\n LIMIT $pageNav->limitstart, $pageNav->limit" ; - $database->setQuery( $query ); + $database->setQuery( $query, $pageNav->limitstart, $pageNav->limit ); $rows = $database->loadObjectList(); if ($database->getErrorNum()) { @@ -254,12 +255,12 @@ function viewArchive( $sectionid, $option ) { global $database, $mainframe, $mosConfig_list_limit; - $catid = $mainframe->getUserStateFromRequest( "catidarc{$option}{$sectionid}", 'catid', 0 ); - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "viewarc{$option}{$sectionid}limitstart", 'limitstart', 0 ); + $catid = intval( $mainframe->getUserStateFromRequest( "catidarc{$option}{$sectionid}", 'catid', 0 ) ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "viewarc{$option}{$sectionid}limitstart", 'limitstart', 0 ) ); + $filter_authorid = intval( $mainframe->getUserStateFromRequest( "filter_authorid{$option}{$sectionid}", 'filter_authorid', 0 ) ); + $filter_sectionid = intval( $mainframe->getUserStateFromRequest( "filter_sectionid{$option}{$sectionid}", 'filter_sectionid', 0 ) ); $search = $mainframe->getUserStateFromRequest( "searcharc{$option}{$sectionid}", 'search', '' ); - $filter_authorid = $mainframe->getUserStateFromRequest( "filter_authorid{$option}{$sectionid}", 'filter_authorid', 0 ); - $filter_sectionid = $mainframe->getUserStateFromRequest( "filter_sectionid{$option}{$sectionid}", 'filter_sectionid', 0 ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); $redirect = $sectionid; @@ -300,7 +301,9 @@ // get the total number of records $query = "SELECT COUNT(*)" - . "FROM ( #__content AS c, #__categories AS cc, #__sections AS s )" + . "\n FROM #__content AS c" + . "\n LEFT JOIN #__categories AS cc ON cc.id = c.catid" + . "\n LEFT JOIN #__sections AS s ON s.id = c.sectionid" . ( count( $where ) ? "\n WHERE " . implode( ' AND ', $where ) : '' ) ; $database->setQuery( $query ); @@ -310,7 +313,9 @@ $pageNav = new mosPageNav( $total, $limitstart, $limit ); $query = "SELECT c.*, g.name AS groupname, cc.name, v.name AS author" - . "\n FROM ( #__content AS c, #__categories AS cc, #__sections AS s )" + . "\n FROM #__content AS c" + . "\n LEFT JOIN #__categories AS cc ON cc.id = c.catid" + . "\n LEFT JOIN #__sections AS s ON s.id = c.sectionid" . "\n LEFT JOIN #__groups AS g ON g.id = c.access" . "\n LEFT JOIN #__users AS v ON v.id = c.created_by" . ( count( $where ) ? "\n WHERE " . implode( ' AND ', $where ) : '' ) @@ -366,7 +371,9 @@ global $database, $my, $mainframe; global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_offset; - $redirect = mosGetParam( $_POST, 'redirect', '' ); + $redirect = strval( mosGetParam( $_POST, 'redirect', '' ) ); + $nullDate = $database->getNullDate(); + if ( !$redirect ) { $redirect = $sectionid; } @@ -382,52 +389,29 @@ } } - if ( $sectionid == 0 ) { - $where = "\n WHERE section NOT LIKE '%com_%'"; - } else { - $where = "\n WHERE section = '$sectionid'"; - } - - // get the type name - which is a special category - if ($row->sectionid){ - $query = "SELECT name" - . "\n FROM #__sections" - . "\n WHERE id = $row->sectionid" - ; - $database->setQuery( $query ); - $section = $database->loadResult(); - $contentSection = $section; - } else { - $query = "SELECT name" - . "\n FROM #__sections" - . "\n WHERE id = $sectionid" - ; - $database->setQuery( $query ); - $section = $database->loadResult(); - $contentSection = $section; - } - // fail if checked out not by 'me' if ($row->checked_out && $row->checked_out != $my->id) { mosRedirect( 'index2.php?option=com_content', 'The module '. $row->title .' is currently being edited by another administrator' ); } + $selected_folders = NULL; if ($uid) { $row->checkout( $my->id ); + if (trim( $row->images )) { $row->images = explode( "\n", $row->images ); } else { $row->images = array(); } - $row->created = mosFormatDate( $row->created, '%Y-%m-%d %H:%M:%S' ); - $row->modified = mosFormatDate( $row->modified, '%Y-%m-%d %H:%M:%S' ); - $row->publish_up = mosFormatDate( $row->publish_up, '%Y-%m-%d %H:%M:%S' ); + $row->created = mosFormatDate( $row->created, _CURRENT_SERVER_TIME_FORMAT ); + $row->modified = $row->modified == $nullDate ? '' : mosFormatDate( $row->modified, _CURRENT_SERVER_TIME_FORMAT ); + $row->publish_up = mosFormatDate( $row->publish_up, _CURRENT_SERVER_TIME_FORMAT ); - $nullDate = $database->getNullDate(); - if (trim( $row->publish_down ) == $nullDate) { + if (trim( $row->publish_down ) == $nullDate || trim( $row->publish_down ) == '' || trim( $row->publish_down ) == '-' ) { $row->publish_down = 'Never'; } + $row->publish_down = mosFormatDate( $row->publish_down, _CURRENT_SERVER_TIME_FORMAT ); $query = "SELECT name" . "\n FROM #__users" @@ -436,12 +420,17 @@ $database->setQuery( $query ); $row->creator = $database->loadResult(); - $query = "SELECT name" - . "\n FROM #__users" - . "\n WHERE id = $row->modified_by" - ; - $database->setQuery( $query ); - $row->modifier = $database->loadResult(); + // test to reduce unneeded query + if ( $row->created_by == $row->modified_by ) { + $row->modifier = $row->creator; + } else { + $query = "SELECT name" + . "\n FROM #__users" + . "\n WHERE id = $row->modified_by" + ; + $database->setQuery( $query ); + $row->modifier = $database->loadResult(); + } $query = "SELECT content_id" . "\n FROM #__content_frontpage" @@ -463,16 +452,18 @@ $category->load( $_POST['catid'] ); $sectionid = $category->section; } else { - $row->catid = NULL; + $row->catid = 0; } + $row->sectionid = $sectionid; $row->version = 0; $row->state = 1; $row->ordering = 0; $row->images = array(); - $row->publish_up = date( 'Y-m-d', time() + $mosConfig_offset * 60 * 60 ); + $row->publish_up = date( 'Y-m-d H:i:s', time() + ( $mosConfig_offset * 60 * 60 ) ); $row->publish_down = 'Never'; $row->creator = ''; + $row->modified = $nullDate; $row->modifier = ''; $row->frontpage = 0; $menus = array(); @@ -492,39 +483,67 @@ $sections = $database->loadObjectList(); $lists['sectionid'] = mosHTML::selectList( $sections, 'sectionid', 'class="inputbox" size="1" '. $javascript, 'id', 'title', intval( $row->sectionid ) ); } - - $sections = $database->loadObjectList(); + + $contentSection = ''; + foreach($sections as $section) { + $section_list[] = $section->id; + // get the type name - which is a special category + if ($row->sectionid){ + if ( $section->id == $row->sectionid ) { + $contentSection = $section->title; + } + } else { + if ( $section->id == $sectionid ) { + $contentSection = $section->title; + } + } + } $sectioncategories = array(); $sectioncategories[-1] = array(); $sectioncategories[-1][] = mosHTML::makeOption( '-1', 'Select Category', 'id', 'name' ); + $section_list = implode( '\', \'', $section_list ); + + $query = "SELECT id, name, section" + . "\n FROM #__categories" + . "\n WHERE section IN ( '$section_list' )" + . "\n ORDER BY ordering" + ; + $database->setQuery( $query ); + $cat_list = $database->loadObjectList(); foreach($sections as $section) { $sectioncategories[$section->id] = array(); - $query = "SELECT id, name" - . "\n FROM #__categories" - . "\n WHERE section = '$section->id'" - . "\n ORDER BY ordering" - ; - $database->setQuery( $query ); - $rows2 = $database->loadObjectList(); + $rows2 = array(); + foreach($cat_list as $cat) { + if ($cat->section == $section->id) { + $rows2[] = $cat; + } + } foreach($rows2 as $row2) { $sectioncategories[$section->id][] = mosHTML::makeOption( $row2->id, $row2->name, 'id', 'name' ); } - } + } // get list of categories if ( !$row->catid && !$row->sectionid ) { $categories[] = mosHTML::makeOption( '-1', 'Select Category', 'id', 'name' ); $lists['catid'] = mosHTML::selectList( $categories, 'catid', 'class="inputbox" size="1"', 'id', 'name' ); } else { - $query = "SELECT id, name" - . "\n FROM #__categories" - . $where - . "\n ORDER BY ordering" - ; - $database->setQuery( $query ); - $categories[] = mosHTML::makeOption( '-1', 'Select Category', 'id', 'name' ); - $categories = array_merge( $categories, $database->loadObjectList() ); + if ( $sectionid == 0 ) { + //$where = "\n WHERE section NOT LIKE '%com_%'"; + foreach($cat_list as $cat) { + $categoriesA[] = $cat; + } + } else { + //$where = "\n WHERE section = '$sectionid'"; + foreach($cat_list as $cat) { + if ($cat->section == $sectionid) { + $categoriesA[] = $cat; + } + } + } + $categories[] = mosHTML::makeOption( '-1', 'Select Category', 'id', 'name' ); + $categories = array_merge( $categories, $categoriesA ); $lists['catid'] = mosHTML::selectList( $categories, 'catid', 'class="inputbox" size="1"', 'id', 'name', intval( $row->catid ) ); } @@ -537,18 +556,63 @@ ; $lists['ordering'] = mosAdminMenus::SpecificOrdering( $row, $uid, $query, 1 ); + // pull param column from category info + $query = "SELECT params" + . "\n FROM #__categories" + . "\n WHERE id = $row->catid" + ; + $database->setQuery( $query ); + $categoryParam = $database->loadResult(); + + $paramsCat = new mosParameters( $categoryParam, $mainframe->getPath( 'com_xml', 'com_categories' ), 'component' ); + $selected_folders = $paramsCat->get( 'imagefolders', '' ); + + if ( !$selected_folders ) { + $selected_folders = '*2*'; + } + + // check if images utilizes settings from section + if ( strpos( $selected_folders, '*2*' ) !== false ) { + unset( $selected_folders ); + // load param column from section info + $query = "SELECT params" + . "\n FROM #__sections" + . "\n WHERE id = $row->sectionid" + ; + $database->setQuery( $query ); + $sectionParam = $database->loadResult(); + + $paramsSec = new mosParameters( $sectionParam, $mainframe->getPath( 'com_xml', 'com_sections' ), 'component' ); + $selected_folders = $paramsSec->get( 'imagefolders', '' ); + } + + if ( trim( $selected_folders ) ) { + $temps = explode( ',', $selected_folders ); + foreach( $temps as $temp ) { + $temp = ampReplace( $temp); + $folders[] = mosHTML::makeOption( $temp, $temp ); + } + } else { + $folders[] = mosHTML::makeOption( '*1*' ); + } + // calls function to read image from directory $pathA = $mosConfig_absolute_path .'/images/stories'; $pathL = $mosConfig_live_site .'/images/stories'; $images = array(); - $folders = array(); - $folders[] = mosHTML::makeOption( '/' ); - mosAdminMenus::ReadImages( $pathA, '/', $folders, $images ); + + if ( $folders[0]->value == '*1*' ) { + $folders = array(); + $folders[] = mosHTML::makeOption( '/' ); + mosAdminMenus::ReadImages( $pathA, '/', $folders, $images ); + } else { + mosAdminMenus::ReadImagesX( $folders, $images ); + } // list of folders in images/stories/ $lists['folders'] = mosAdminMenus::GetImageFolders( $folders, $pathL ); // list of images in specfic folder in images/stories/ - $lists['imagefiles'] = mosAdminMenus::GetImages( $images, $pathL ); + $lists['imagefiles'] = mosAdminMenus::GetImages( $images, $pathL, $folders ); // list of saved images $lists['imagelist'] = mosAdminMenus::GetSavedImages( $row, $pathL ); @@ -569,7 +633,6 @@ $pos[] = mosHTML::makeOption( 'top', _CMN_TOP ); $lists['_caption_position'] = mosHTML::selectList( $pos, '_caption_position', 'class="inputbox" size="1"', 'value', 'text' ); - // get params definitions $params = new mosParameters( $row->attribs, $mainframe->getPath( 'com_xml', 'com_content' ), 'component' ); @@ -583,8 +646,9 @@ function saveContent( $sectionid, $task ) { global $database, $my, $mainframe, $mosConfig_offset; - $menu = mosGetParam( $_POST, 'menu', 'mainmenu' ); - $menuid = mosGetParam( $_POST, 'menuid', 0 ); + $menu = strval( mosGetParam( $_POST, 'menu', 'mainmenu' ) ); + $menuid = intval( mosGetParam( $_POST, 'menuid', 0 ) ); + $nullDate = $database->getNullDate(); $row = new mosContent( $database ); if (!$row->bind( $_POST )) { @@ -592,28 +656,33 @@ exit(); } - $isNew = ( $row->id < 1 ); - if ($isNew) { - $row->created = $row->created ? mosFormatDate( $row->created, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset ) : date( 'Y-m-d H:i:s' ); - $row->created_by = $row->created_by ? $row->created_by : $my->id; - } else { + if ($row->id) { $row->modified = date( 'Y-m-d H:i:s' ); $row->modified_by = $my->id; - $row->created = $row->created ? mosFormatDate( $row->created, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset ) : date( 'Y-m-d H:i:s' ); - $row->created_by = $row->created_by ? $row->created_by : $my->id; } - if (strlen(trim( $row->publish_up )) <= 10) { - $row->publish_up .= " 00:00:00"; + $row->created_by = $row->created_by ? $row->created_by : $my->id; + + if ($row->created && strlen(trim( $row->created )) <= 10) { + $row->created .= ' 00:00:00'; } - $row->publish_up = mosFormatDate($row->publish_up, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset ); + $row->created = $row->created ? mosFormatDate( $row->created, '%Y-%m-%d %H:%M:%S', -$mosConfig_offset ) : date( 'Y-m-d H:i:s' ); + + if (strlen(trim( $row->publish_up )) <= 10) { + $row->publish_up .= ' 00:00:00'; + } + $row->publish_up = mosFormatDate( $row->publish_up, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset ); - $nullDate = $database->getNullDate(); - if (trim( $row->publish_down ) == "Never") { + if (trim( $row->publish_down ) == 'Never' || trim( $row->publish_down ) == '') { $row->publish_down = $nullDate; + } else { + if (strlen(trim( $row->publish_down )) <= 10) { + $row->publish_down .= ' 00:00:00'; + } + $row->publish_down = mosFormatDate( $row->publish_down, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset ); } - $row->state = mosGetParam( $_REQUEST, 'published', 0 ); + $row->state = intval( mosGetParam( $_REQUEST, 'published', 0 ) ); $params = mosGetParam( $_POST, 'params', '' ); if (is_array( $params )) { @@ -652,7 +721,7 @@ require_once( $mainframe->getPath( 'class', 'com_frontpage' ) ); $fp = new mosFrontPage( $database ); - if (mosGetParam( $_REQUEST, 'frontpage', 0 )) { + if (intval( mosGetParam( $_REQUEST, 'frontpage', 0 ) )) { // toggles go to first place if (!$fp->load( $row->id )) { @@ -679,6 +748,9 @@ $row->checkin(); $row->updateOrder( "catid = $row->catid AND state >= 0" ); + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + $redirect = mosGetParam( $_POST, 'redirect', $sectionid ); switch ( $task ) { case 'go2menu': @@ -721,7 +793,7 @@ */ function changeContent( $cid=null, $state=0, $option ) { global $database, $my, $task; - + if (count( $cid ) < 1) { $action = $state == 1 ? 'publish' : ($state == -1 ? 'archive' : 'unpublish'); echo "\n"; @@ -746,6 +818,9 @@ $row->checkin( $cid[0] ); } + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + switch ( $state ) { case -1: $msg = $total .' Item(s) successfully Archived'; @@ -766,7 +841,7 @@ } $redirect = mosGetParam( $_POST, 'redirect', $row->sectionid ); - $rtask = mosGetParam( $_POST, 'returntask', '' ); + $rtask = strval( mosGetParam( $_POST, 'returntask', '' ) ); if ( $rtask ) { $rtask = '&task='. $rtask; } else { @@ -817,6 +892,9 @@ } $fp->updateOrder(); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option='. $option .'§ionid='. $section, $msg ); } @@ -844,8 +922,11 @@ exit(); } - $msg = $total ." Item(s) sent to the Trash"; - $return = mosGetParam( $_POST, 'returntask', '' ); + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + + $msg = $total ." Item(s) sent to the Trash"; + $return = strval( mosGetParam( $_POST, 'returntask', '' ) ); mosRedirect( 'index2.php?option='. $option .'&task='. $return .'§ionid='. $sectionid, $msg ); } @@ -875,6 +956,9 @@ $row->move( $inc, "catid = $row->catid AND state >= 0" ); $redirect = mosGetParam( $_POST, 'redirect', $row->sectionid ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option='. $option .'§ionid='. $redirect ); } @@ -973,6 +1057,9 @@ $row->store(); $row->updateOrder( "catid = $row->catid AND state >= 0" ); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $msg = $total. ' Item(s) successfully moved to Section: '. $section .', Category: '. $category; mosRedirect( 'index2.php?option='. $option .'§ionid='. $sectionid .'&mosmsg='. $msg ); @@ -1099,6 +1186,9 @@ } $row->updateOrder( "catid='". $row->catid ."' AND state >= 0" ); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $msg = $total. ' Item(s) successfully copied to Section: '. $section .', Category: '. $category; mosRedirect( 'index2.php?option='. $option .'§ionid='. $sectionid .'&mosmsg='. $msg ); @@ -1142,6 +1232,9 @@ $redirect = mosGetParam( $_POST, 'redirect', $row->sectionid ); + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + mosRedirect( 'index2.php?option='. $option .'§ionid='. $redirect ); } @@ -1160,9 +1253,11 @@ function menuLink( $redirect, $id ) { global $database; - $menu = mosGetParam( $_POST, 'menuselect', '' ); - $link = mosGetParam( $_POST, 'link_name', '' ); + $menu = strval( mosGetParam( $_POST, 'menuselect', '' ) ); + $link = strval( mosGetParam( $_POST, 'link_name', '' ) ); + $link = stripslashes( ampReplace($link) ); + $row = new mosMenu( $database ); $row->menutype = $menu; $row->name = $link; @@ -1182,20 +1277,23 @@ } $row->checkin(); $row->updateOrder( "menutype = '$row->menutype' AND parent = $row->parent" ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $msg = $link .' (Link - Content Item) in menu: '. $menu .' successfully created'; mosRedirect( 'index2.php?option=com_content§ionid='. $redirect .'&task=edit&hidemainmenu=1&id='. $id, $msg ); } function go2menu() { - $menu = mosGetParam( $_POST, 'menu', 'mainmenu' ); + $menu = strval( mosGetParam( $_POST, 'menu', 'mainmenu' ) ); mosRedirect( 'index2.php?option=com_menus&menutype='. $menu ); } function go2menuitem() { - $menu = mosGetParam( $_POST, 'menu', 'mainmenu' ); - $id = mosGetParam( $_POST, 'menuid', 0 ); + $menu = strval( mosGetParam( $_POST, 'menu', 'mainmenu' ) ); + $id = intval( mosGetParam( $_POST, 'menuid', 0 ) ); mosRedirect( 'index2.php?option=com_menus&menutype='. $menu .'&task=edit&hidemainmenu=1&id='. $id ); } @@ -1206,7 +1304,7 @@ $total = count( $cid ); $order = mosGetParam( $_POST, 'order', array(0) ); $redirect = mosGetParam( $_POST, 'redirect', 0 ); - $rettask = mosGetParam( $_POST, 'returntask', '' ); + $rettask = strval( mosGetParam( $_POST, 'returntask', '' ) ); $row = new mosContent( $database ); $conditions = array(); @@ -1237,6 +1335,9 @@ $row->updateOrder( $cond[1] ); } // foreach + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + $msg = 'New ordering saved'; switch ( $rettask ) { case 'showarchive': diff -urN joomla-1.0.7/administrator/components/com_frontpage/admin.frontpage.html.php joomla-1.0.10/administrator/components/com_frontpage/admin.frontpage.html.php --- joomla-1.0.7/administrator/components/com_frontpage/admin.frontpage.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_frontpage/admin.frontpage.html.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@ sect_link = 'index2.php?option=com_sections&task=editA&hidemainmenu=1&id='. $row->sectionid; $row->cat_link = 'index2.php?option=com_categories&task=editA&hidemainmenu=1&id='. $row->catid; - $now = date( 'Y-m-d H:i:s' ); + $now = _CURRENT_SERVER_TIME; if ( $now <= $row->publish_up && $row->state == '1' ) { $img = 'publish_y.png'; $alt = 'Published'; diff -urN joomla-1.0.7/administrator/components/com_frontpage/admin.frontpage.php joomla-1.0.10/administrator/components/com_frontpage/admin.frontpage.php --- joomla-1.0.7/administrator/components/com_frontpage/admin.frontpage.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_frontpage/admin.frontpage.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@ acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' ) - | $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_frontpage' ))) { +if (!($acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' ) | $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_frontpage' ))) { mosRedirect( 'index2.php', _NOT_AUTH ); } @@ -25,7 +24,6 @@ require_once( $mainframe->getPath( 'admin_html' ) ); require_once( $mainframe->getPath( 'class' ) ); -$task = mosGetParam( $_REQUEST, 'task', array(0) ); $cid = mosGetParam( $_POST, 'cid', array(0) ); if (!is_array( $cid )) { $cid = array(0); @@ -49,11 +47,11 @@ break; case 'orderup': - orderFrontPage( $cid[0], -1, $option ); + orderFrontPage( intval( $cid[0] ), -1, $option ); break; case 'orderdown': - orderFrontPage( $cid[0], 1, $option ); + orderFrontPage( intval( $cid[0] ), 1, $option ); break; case 'saveorder': @@ -61,15 +59,15 @@ break; case 'accesspublic': - accessMenu( $cid[0], 0 ); + accessMenu( intval( $cid[0] ), 0 ); break; case 'accessregistered': - accessMenu( $cid[0], 1 ); + accessMenu( intval( $cid[0] ), 1 ); break; case 'accessspecial': - accessMenu( $cid[0], 2 ); + accessMenu( intval( $cid[0] ), 2 ); break; default: @@ -84,12 +82,12 @@ function viewFrontPage( $option ) { global $database, $mainframe, $mosConfig_list_limit; - $catid = $mainframe->getUserStateFromRequest( "catid{$option}", 'catid', 0 ); - $filter_authorid = $mainframe->getUserStateFromRequest( "filter_authorid{$option}", 'filter_authorid', 0 ); - $filter_sectionid = $mainframe->getUserStateFromRequest( "filter_sectionid{$option}", 'filter_sectionid', 0 ); + $catid = intval( $mainframe->getUserStateFromRequest( "catid{$option}", 'catid', 0 ) ); + $filter_authorid = intval( $mainframe->getUserStateFromRequest( "filter_authorid{$option}", 'filter_authorid', 0 ) ); + $filter_sectionid = intval( $mainframe->getUserStateFromRequest( "filter_sectionid{$option}", 'filter_sectionid', 0 ) ); - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ) ); $search = $mainframe->getUserStateFromRequest( "search{$option}", 'search', '' ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); @@ -210,6 +208,9 @@ $row = new mosContent( $database ); $row->checkin( $cid[0] ); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( "index2.php?option=$option" ); } @@ -236,6 +237,9 @@ } } $fp->updateOrder(); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( "index2.php?option=$option" ); } @@ -250,6 +254,9 @@ $fp = new mosFrontPage( $database ); $fp->load( $uid ); $fp->move( $inc ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( "index2.php?option=$option" ); } @@ -272,6 +279,9 @@ if ( !$row->store() ) { return $row->getError(); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option=com_frontpage' ); } @@ -297,6 +307,9 @@ $row->load( $cid[$i] ); $row->updateOrder(); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $msg = 'New ordering saved'; mosRedirect( 'index2.php?option=com_frontpage', $msg ); diff -urN joomla-1.0.7/administrator/components/com_frontpage/frontpage.xml joomla-1.0.10/administrator/components/com_frontpage/frontpage.xml --- joomla-1.0.7/administrator/components/com_frontpage/frontpage.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_frontpage/frontpage.xml 2006-06-25 16:53:59.000000000 -0400 @@ -123,5 +123,10 @@ + + + + + diff -urN joomla-1.0.7/administrator/components/com_frontpage/toolbar.frontpage.php joomla-1.0.10/administrator/components/com_frontpage/toolbar.frontpage.php --- joomla-1.0.7/administrator/components/com_frontpage/toolbar.frontpage.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_frontpage/toolbar.frontpage.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'toolbar_html' ) ); require_once( $mainframe->getPath( 'toolbar_default' ) ); -$act = mosGetParam( $_REQUEST, 'act', '' ); -if ($act) { - $task = $act; -} - switch ($task) { default: TOOLBAR_FrontPage::_DEFAULT(); diff -urN joomla-1.0.7/administrator/components/com_installer/mambot/mambot.php joomla-1.0.10/administrator/components/com_installer/mambot/mambot.php --- joomla-1.0.7/administrator/components/com_installer/mambot/mambot.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_installer/mambot/mambot.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ +writableCell( 'mambots/system' );?> getPath( 'admin_html' ) ); // XML library require_once( "$mosConfig_absolute_path/includes/domit/xml_domit_lite_include.php" ); -$task = trim( strtolower( mosGetParam( $_REQUEST, 'task', '' ) ) ); $cid = mosGetParam( $_REQUEST, 'cid', array(0) ); - if (!is_array( $cid )) { $cid = array(0); } @@ -169,7 +166,7 @@ if ($fp = fopen("../configuration.php","w")){ fputs($fp, $config, strlen($config)); fclose($fp); - mosRedirect("index2.php","Configuration succesfully updated!"); + mosRedirect("index2.php","Configuration successfully updated!"); } else { mosRedirect("index2.php","Error! Make sure that configuration.php is writeable."); } @@ -217,8 +214,8 @@ } function saveLanguageSource( $option ) { - $language = mosGetParam( $_POST, 'language', '' ); - $filecontent = mosGetParam( $_POST, 'filecontent', '', _MOS_ALLOWHTML ); + $language = mosGetParam( $_POST, 'language', '' ); + $filecontent = mosGetParam( $_POST, 'filecontent', '', _MOS_ALLOWHTML ); if (!$language) { mosRedirect( "index2.php?option=$option&mosmsg=Operation failed: No language specified." ); diff -urN joomla-1.0.7/administrator/components/com_mambots/admin.mambots.php joomla-1.0.10/administrator/components/com_mambots/admin.mambots.php --- joomla-1.0.7/administrator/components/com_mambots/admin.mambots.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_mambots/admin.mambots.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); -$client = mosGetParam( $_REQUEST, 'client', '' ); +$client = strval( mosGetParam( $_REQUEST, 'client', '' ) ); $cid = mosGetParam( $_POST, 'cid', array(0) ); -$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); if (!is_array( $cid )) { $cid = array(0); } @@ -34,7 +33,7 @@ case 'new': case 'edit': - editMambot( $option, $cid[0], $client ); + editMambot( $option, intval( $cid[0] ), $client ); break; case 'editA': @@ -61,13 +60,13 @@ case 'orderup': case 'orderdown': - orderMambot( $cid[0], ($task == 'orderup' ? -1 : 1), $option, $client ); + orderMambot( intval( $cid[0] ), ($task == 'orderup' ? -1 : 1), $option, $client ); break; case 'accesspublic': case 'accessregistered': case 'accessspecial': - accessMenu( $cid[0], $task, $option, $client ); + accessMenu( intval( $cid[0] ), $task, $option, $client ); break; case 'saveorder': @@ -86,8 +85,8 @@ global $database, $mainframe, $mosConfig_list_limit; global $mosConfig_absolute_path; - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ) ); $filter_type = $mainframe->getUserStateFromRequest( "filter_type{$option}{$client}", 'filter_type', 1 ); $search = $mainframe->getUserStateFromRequest( "search{$option}{$client}", 'search', '' ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); diff -urN joomla-1.0.7/administrator/components/com_massmail/admin.massmail.php joomla-1.0.10/administrator/components/com_massmail/admin.massmail.php --- joomla-1.0.7/administrator/components/com_massmail/admin.massmail.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_massmail/admin.massmail.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ Height: '.$info[1] .'px'; - $overlib .= '
    Filesize: '. $filesize; - $overlib .= '

    *Click to Enlarge*'; + $overlib = ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= '
    '; + $overlib .= 'Width:'; + $overlib .= ''; + $overlib .= $info[0].' px'; + $overlib .= '
    '; + $overlib .= 'Height:'; + $overlib .= ''; + $overlib .= $info[1] .' px'; + $overlib .= '
    '; + $overlib .= 'Filesize:'; + $overlib .= ''; + $overlib .= $filesize; + $overlib .= '
    '; + $overlib .= '
    *Click to Enlarge*'; $overlib .= '
    *Click for Image Code*'; ?>
    -
    +
    - + 10 ? '...' : ''), ENT_QUOTES ); ?>
    @@ -244,28 +265,47 @@ } function show_dir( $path, $dir, $listdir ) { - $num_files = HTML_Media::num_files( COM_MEDIA_BASE . $listdir . $path ); + $count = HTML_Media::num_files( COM_MEDIA_BASE . $listdir . $path ); + + $num_files = $count[0]; + $num_dir = $count[1]; - // Fix for Bug [0000577] - if ($listdir=='/') { - $listdir=''; + if ($listdir == '/') { + $listdir = ''; } $link = 'index3.php?option=com_media&task=list&listdir='. $listdir . $path; - $overlib = 'Files '. $num_files; - $overlib .= '

    *Click to Open*'; + $overlib = ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= ''; + $overlib .= '
    '; + $overlib .= 'Files:'; + $overlib .= ''; + $overlib .= $num_files; + $overlib .= '
    '; + $overlib .= 'Folders:'; + $overlib .= ''; + $overlib .= $num_dir; + $overlib .= '
    '; + $overlib .= '
    *Click to Open*'; ?>
    - <?php echo $dir; ?> +
    - + 10 ? '...' : ''); ?>
    @@ -314,7 +354,6 @@ } function imageResize($width, $height, $target) { - //takes the larger size of the width and height and applies the //formula accordingly...this is so this script will work //dynamically with any size image @@ -337,21 +376,25 @@ } function num_files($dir) { - $total = 0; + $total_file = 0; + $total_dir = 0; if(is_dir($dir)) { - $d = dir($dir); - while (false !== ($entry = $d->read())) { - - if(substr($entry,0,1) != '.') { - $total++; + + while ( false !== ($entry = $d->read()) ) { + if ( substr($entry,0,1) != '.' && is_file($dir . DIRECTORY_SEPARATOR . $entry) && strpos( $entry, '.html' ) === false && strpos( $entry, '.php' ) === false ) { + $total_file++; + } + if ( substr($entry,0,1) != '.' && is_dir($dir . DIRECTORY_SEPARATOR . $entry) ) { + $total_dir++; } } + $d->close(); } - return $total - 1; + return array( $total_file, $total_dir ); } diff -urN joomla-1.0.7/administrator/components/com_media/admin.media.php joomla-1.0.10/administrator/components/com_media/admin.media.php --- joomla-1.0.7/administrator/components/com_media/admin.media.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_media/admin.media.php 2006-06-25 16:54:04.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); -//require_once( $mainframe->getPath( 'class' ) ); /** * Makes file name safe to use @@ -94,11 +93,10 @@ */ function delete_file( $listdir ) { $delFile = makeSafe( mosGetParam( $_REQUEST, 'delFile', '' ) ); - $fullPath = COM_MEDIA_BASE . $listdir . DIRECTORY_SEPARATOR . $delFile; + $fullPath = COM_MEDIA_BASE . $listdir . DIRECTORY_SEPARATOR . stripslashes( $delFile ); if (file_exists( $fullPath )) { unlink( $fullPath ); - } else { } } @@ -167,48 +165,49 @@ function do_upload($file, $dest_dir) { global $clearUploads; - if (file_exists($dest_dir.$file['name'])) { - mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], "Upload FAILED.File allready exists" ); - } - - $format = substr( $file['name'], -3 ); + if (file_exists($dest_dir.$file['name'])) { + mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], "Upload FAILED.File allready exists" ); + } + + $format = substr( $file['name'], -3 ); - $allowable = array ( - 'bmp', - 'csv', - 'doc', - 'epg', - 'gif', - 'ico', - 'jpg', - 'odg', - 'odp', - 'ods', - 'odt', - 'pdf', - 'png', - 'ppt', - 'swf', - 'txt', - 'xcf', - 'xls' - ); - - $noMatch = 0; - foreach( $allowable as $ext ) { - if ( strcasecmp( $format, $ext ) == 0 ) $noMatch = 1; + $allowable = array ( + 'bmp', + 'csv', + 'doc', + 'epg', + 'gif', + 'ico', + 'jpg', + 'odg', + 'odp', + 'ods', + 'odt', + 'pdf', + 'png', + 'ppt', + 'swf', + 'txt', + 'xcf', + 'xls' + ); + + $noMatch = 0; + foreach( $allowable as $ext ) { + if ( strcasecmp( $format, $ext ) == 0 ) { + $noMatch = 1; } - if(!$noMatch){ - mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], 'This file type is not supported' ); - } + } + if(!$noMatch){ + mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], 'This file type is not supported' ); + } - if (!move_uploaded_file($file['tmp_name'], $dest_dir.strtolower($file['name']))){ - mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], "Upload FAILED" ); - } - else { - mosChmod($dest_dir.strtolower($file['name'])); - mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], "Upload complete" ); - } + if (!move_uploaded_file($file['tmp_name'], $dest_dir.strtolower($file['name']))){ + mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], "Upload FAILED" ); + } else { + mosChmod($dest_dir.strtolower($file['name'])); + mosRedirect( "index2.php?option=com_media&listdir=".$_POST['dirPath'], "Upload complete" ); + } $clearUploads = true; } @@ -220,8 +219,8 @@ if(is_dir($base)) { $dh = opendir($base); while (false !== ($dir = readdir($dh))) { - if (is_dir($base ."/". $dir) && $dir !== '.' && $dir !== '..' && strtolower($dir) !== 'cvs' && strtolower($dir) !== '.svn') { - $subbase = $base ."/". $dir; + if (is_dir($base .'/'. $dir) && $dir !== '.' && $dir !== '..' && strtolower($dir) !== 'cvs' && strtolower($dir) !== '.svn') { + $subbase = $base .'/'. $dir; $dirlist[] = $subbase; $subdirlist = recursive_listdir($subbase); } @@ -278,19 +277,18 @@ while (false !== ($entry = $d->read())) { $img_file = $entry; - if(is_file( COM_MEDIA_BASE .$listdir.'/'.$img_file) && substr($entry,0,1) != '.' && strtolower($entry) !== 'index.html') { + if(is_file( COM_MEDIA_BASE .$listdir.'/'.$img_file) && substr($entry,0,1) != '.' && strtolower($entry) !== 'index.html' ) { if (eregi( $allowable, $img_file )) { - $image_info = @getimagesize( COM_MEDIA_BASE ."/".$listdir.'/'.$img_file); - $file_details['file'] = COM_MEDIA_BASE . $listdir."/".$img_file; - $file_details['img_info'] = $image_info; - $file_details['size'] = filesize( COM_MEDIA_BASE .$listdir."/".$img_file); - $images[$entry] = $file_details; + $image_info = @getimagesize( COM_MEDIA_BASE ."/".$listdir.'/'.$img_file); + $file_details['file'] = COM_MEDIA_BASE . $listdir."/".$img_file; + $file_details['img_info'] = $image_info; + $file_details['size'] = filesize( COM_MEDIA_BASE .$listdir."/".$img_file); + $images[$entry] = $file_details; } else { // file is document - $file_details['size'] = filesize( COM_MEDIA_BASE .$listdir."/".$img_file); - $file_details['file'] = COM_MEDIA_BASE .$listdir."/".$img_file; - //$docs[$entry] = $img_file; - $docs[$entry] = $file_details; + $file_details['size'] = filesize( COM_MEDIA_BASE .$listdir."/".$img_file); + $file_details['file'] = COM_MEDIA_BASE .$listdir."/".$img_file; + $docs[$entry] = $file_details; } } else if(is_dir( COM_MEDIA_BASE .'/'.$listdir.'/'.$img_file) && substr($entry,0,1) != '.' && strtolower($entry) !== 'cvs') { $folders[$entry] = $img_file; @@ -317,13 +315,12 @@ for($i=0; $i'; if(is_dir($dir)) { $d = @dir($dir); while ( false !== ( $entry = $d->read() ) ) { - //echo "#".$entry.'
    '; if($entry != '.' && $entry != '..') { $node = $dir.'/'.$entry; - //echo "NODE:".$node; if(is_file($node)) { - //echo " - is file
    "; unlink($node); } else if(is_dir($node)) { - //echo " - is Dir
    "; rm_all_dir($node); } } @@ -367,6 +358,5 @@ rmdir($dir); } - //echo "RM: $dir
    "; } ?> \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_menumanager/admin.menumanager.html.php joomla-1.0.10/administrator/components/com_menumanager/admin.menumanager.html.php --- joomla-1.0.7/administrator/components/com_menumanager/admin.menumanager.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menumanager/admin.menumanager.html.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ diff -urN joomla-1.0.7/administrator/components/com_menumanager/admin.menumanager.php joomla-1.0.10/administrator/components/com_menumanager/admin.menumanager.php --- joomla-1.0.7/administrator/components/com_menumanager/admin.menumanager.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menumanager/admin.menumanager.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); -$menu = mosGetParam( $_GET, 'menu', '' ); -$task = mosGetParam( $_REQUEST, 'task', array(0) ); -$type = mosGetParam( $_POST, 'type', '' ); +$menu = strval( mosGetParam( $_GET, 'menu', '' ) ); +$type = strval( mosGetParam( $_POST, 'type', '' ) ); $cid = mosGetParam( $_POST, 'cid', '' ); switch ($task) { @@ -75,8 +74,8 @@ function showMenu( $option ) { global $database, $mainframe, $mosConfig_list_limit; - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{". $option ."}limitstart", 'limitstart', 0 ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{". $option ."}limitstart", 'limitstart', 0 ) ); $menuTypes = mosAdminMenus::menutypes(); $total = count( $menuTypes ); @@ -199,9 +198,9 @@ function saveMenu() { global $database; - $menutype = mosGetParam( $_POST, 'menutype', '' ); - $old_menutype = mosGetParam( $_POST, 'old_menutype', '' ); - $new = mosGetParam( $_POST, 'new', 1 ); + $menutype = strval( mosGetParam( $_POST, 'menutype', '' ) ); + $old_menutype = strval( mosGetParam( $_POST, 'old_menutype', '' ) ); + $new = intval( mosGetParam( $_POST, 'new', 1 ) ); // block to stop renaming of 'mainmenu' menutype if ( $old_menutype == 'mainmenu' ) { @@ -211,6 +210,12 @@ } } + // check for ' in menu name + if (strstr($menutype, '\'')) { + echo "\n"; + exit; + } + // check for unique menutype for new menus $query = "SELECT params" . "\n FROM #__modules" @@ -429,6 +434,9 @@ $mod->updateOrder( "position='right'" ); } + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + $msg = 'Menu Deleted'; mosRedirect( 'index2.php?option=' . $option, $msg ); } @@ -459,8 +467,8 @@ function copyMenu( $option, $cid, $type ) { global $database; - $menu_name = mosGetParam( $_POST, 'menu_name', 'New Menu' ); - $module_name = mosGetParam( $_POST, 'module_name', 'New Module' ); + $menu_name = strval( mosGetParam( $_POST, 'menu_name', 'New Menu' ) ); + $module_name = strval( mosGetParam( $_POST, 'module_name', 'New Module' ) ); // check for unique menutype for new menu copy $query = "SELECT params" @@ -532,6 +540,9 @@ exit(); } + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + $msg = 'Copy of Menu `'. $type .'` created, consisting of '. $total .' items'; mosRedirect( 'index2.php?option=' . $option, $msg ); } diff -urN joomla-1.0.7/administrator/components/com_menumanager/toolbar.menumanager.php joomla-1.0.10/administrator/components/com_menumanager/toolbar.menumanager.php --- joomla-1.0.7/administrator/components/com_menumanager/toolbar.menumanager.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menumanager/toolbar.menumanager.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'toolbar_html' ) ); -//require_once( $mainframe->getPath( 'toolbar_default' ) ); - -$act = mosGetParam( $_REQUEST, 'act', '' ); -if ($act) { - $task = $act; -} switch ($task) { case 'new': diff -urN joomla-1.0.7/administrator/components/com_menus/admin.menus.html.php joomla-1.0.10/administrator/components/com_menus/admin.menus.html.php --- joomla-1.0.7/administrator/components/com_menus/admin.menus.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/admin.menus.html.php 2006-06-25 16:54:02.000000000 -0400 @@ -1,6 +1,6 @@ - * Note that some menu types appear in more that one grouping, but they are still the same menu type. + * Note that some menu types appear in more than one grouping, but they are still the same menu type. @@ -217,7 +217,7 @@ for ( $i=0; $i < $count; $i++ ) { $row = &$types_content[$i]; - $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&hidemainmenu=1&type='. $row->type; + $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type .'&hidemainmenu=1'; HTML_menusections::htmlOptions( $row, $link, $k, $i ); @@ -235,7 +235,7 @@ for ( $i=0; $i < $count; $i++ ) { $row = &$types_other[$i]; - $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type; + $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type.'&hidemainmenu=1'; HTML_menusections::htmlOptions( $row, $link, $k, $i ); @@ -253,7 +253,7 @@ for ( $i=0; $i < $count; $i++ ) { $row = &$types_submit[$i]; - $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type; + $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type.'&hidemainmenu=1'; HTML_menusections::htmlOptions( $row, $link, $k, $i ); @@ -273,7 +273,7 @@ for ( $i=0; $i < $count; $i++ ) { $row = &$types_component[$i]; - $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type; + $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type.'&hidemainmenu=1'; HTML_menusections::htmlOptions( $row, $link, $k, $i ); @@ -291,7 +291,7 @@ for ( $i=0; $i < $count; $i++ ) { $row = &$types_link[$i]; - $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type; + $link = 'index2.php?option=com_menus&menutype='. $menutype .'&task=edit&type='. $row->type.'&hidemainmenu=1'; HTML_menusections::htmlOptions( $row, $link, $k, $i ); diff -urN joomla-1.0.7/administrator/components/com_menus/admin.menus.php joomla-1.0.10/administrator/components/com_menus/admin.menus.php --- joomla-1.0.7/administrator/components/com_menus/admin.menus.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/admin.menus.php 2006-06-25 16:54:02.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); -$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); -$type = mosGetParam( $_REQUEST, 'type', false ); -$menutype = mosGetParam( $_REQUEST, 'menutype', 'mainmenu' ); -$task = mosGetParam( $_REQUEST, 'task', '' ); -$access = mosGetParam( $_POST, 'access', '' ); -$utaccess = mosGetParam( $_POST, 'utaccess', '' ); -$ItemName = mosGetParam( $_POST, 'ItemName', '' ); -$menu = mosGetParam( $_POST, 'menu', '' ); -$cid = mosGetParam( $_POST, 'cid', array(0) ); - $path = $mosConfig_absolute_path .'/administrator/components/com_menus/'; +$menutype = strval( mosGetParam( $_REQUEST, 'menutype', 'mainmenu' ) ); +$type = strval( mosGetParam( $_REQUEST, 'type', false ) ); +$menu = strval( mosGetParam( $_POST, 'menu', '' ) ); +$cid = mosGetParam( $_POST, 'cid', array(0) ); if (!is_array( $cid )) { $cid = array(0); } - switch ($task) { case 'new': addMenuItem( $cid, $menutype, $option, $task ); break; case 'edit': - $cid[0] = ( $id ? $id : $cid[0] ); + $cid[0] = ( $id ? $id : intval( $cid[0] ) ); $menu = new mosMenu( $database ); if ( $cid[0] ) { $menu->load( $cid[0] ); @@ -55,26 +48,19 @@ break; case 'save': - case 'apply': + case 'apply': + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); require_once( $path . $type .'/'. $type .'.menu.php' ); break; case 'publish': case 'unpublish': - if ($msg = publishMenuSection( $cid, ($task == 'publish') )) { - // proceed no further if the menu item can't be published - mosRedirect( 'index2.php?option=com_menus&menutype='. $menutype .'&mosmsg= '.$msg ); - } else { - mosRedirect( 'index2.php?option=com_menus&menutype='. $menutype ); - } + publishMenuSection( $cid, ($task == 'publish'), $menutype ); break; case 'remove': - if ($msg = TrashMenusection( $cid )) { - mosRedirect( 'index2.php?option=com_menus&menutype='. $menutype .'&mosmsg= '.$msg ); - } else { - mosRedirect( 'index2.php?option=com_menus&menutype='. $menutype ); - } + TrashMenusection( $cid, $menutype ); break; case 'cancel': @@ -82,23 +68,23 @@ break; case 'orderup': - orderMenu( $cid[0], -1, $option ); + orderMenu( intval( $cid[0] ), -1, $option ); break; case 'orderdown': - orderMenu( $cid[0], 1, $option ); + orderMenu( intval( $cid[0] ), 1, $option ); break; case 'accesspublic': - accessMenu( $cid[0], 0, $option, $menutype ); + accessMenu( intval( $cid[0] ), 0, $option, $menutype ); break; case 'accessregistered': - accessMenu( $cid[0], 1, $option, $menutype ); + accessMenu( intval( $cid[0] ), 1, $option, $menutype ); break; case 'accessspecial': - accessMenu( $cid[0], 2, $option, $menutype ); + accessMenu( intval( $cid[0] ), 2, $option, $menutype ); break; case 'movemenu': @@ -127,7 +113,7 @@ break; default: - $type = mosGetParam( $_REQUEST, 'type' ); + $type = strval( mosGetParam( $_REQUEST, 'type' ) ); if ($type) { // adding a new item - type selection form require_once( $path . $type .'/'. $type .'.menu.php' ); @@ -143,9 +129,9 @@ function viewMenuItems( $menutype, $option ) { global $database, $mainframe, $mosConfig_list_limit; - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart$menutype", 'limitstart', 0 ); - $levellimit = $mainframe->getUserStateFromRequest( "view{$option}limit$menutype", 'levellimit', 10 ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart$menutype", 'limitstart', 0 ) ); + $levellimit = intval( $mainframe->getUserStateFromRequest( "view{$option}limit$menutype", 'levellimit', 10 ) ); $search = $mainframe->getUserStateFromRequest( "search{$option}$menutype", 'search', '' ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); @@ -413,7 +399,7 @@ * @param array An array of id numbers * @param integer 0 if unpublishing, 1 if publishing */ -function publishMenuSection( $cid=null, $publish=1 ) { +function publishMenuSection( $cid=null, $publish=1, $menutype ) { global $database, $mosConfig_absolute_path; if (!is_array( $cid ) || count( $cid ) < 1) { @@ -440,21 +426,48 @@ require_once( $mosConfig_absolute_path . '/administrator/components/com_menus/' . $type . '/' . $type . '.menu.php' ); } } - return null; + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + + mosRedirect( 'index2.php?option=com_menus&menutype='. $menutype ); } /** * Trashes a menu record */ -function TrashMenuSection( $cid=NULL ) { +function TrashMenuSection( $cid=NULL, $menutype='mainmenu' ) { global $database; - - $state = "-2"; - //seperate contentids - $cids = implode( ',', $cid ); + + $nullDate = $database->getNullDate(); + $state = -2; + + $query = "SELECT *" + . "\n FROM #__menu" + . "\n WHERE menutype = '$menutype'" + . "\n AND published != $state" + . "\n ORDER BY menutype, parent, ordering" + ; + $database->setQuery( $query ); + $mitems = $database->loadObjectList(); + + // determine if selected item has an child items + $children = array(); + foreach ( $cid as $id ) { + foreach ( $mitems as $item ) { + if ( $item->parent == $id ) { + $children[] = $item->id; + } + } + } + $list = josMenuChildrenRecurse( $mitems, $children, $children ); + $list = array_merge( $cid, $list ); + + $ids = implode( ',', $list ); + $query = "UPDATE #__menu" - . "\n SET published = $state, ordering = 0" - . "\n WHERE id IN ( $cids )" + . "\n SET published = $state, ordering = 0, checked_out = 0, checked_out_time = '$nullDate'" + . "\n WHERE id IN ( $ids )" ; $database->setQuery( $query ); if ( !$database->query() ) { @@ -463,9 +476,12 @@ } $total = count( $cid ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); - $msg = $total ." Item(s) sent to the Trash"; - return $msg; + $msg = $total .' Item(s) sent to the Trash'; + mosRedirect( 'index2.php?option=com_menus&menutype='. $menutype, $msg ); } /** @@ -476,19 +492,12 @@ $menu = new mosMenu( $database ); $menu->bind( $_POST ); - $menuid = mosGetParam( $_POST, 'menuid', 0 ); + $menuid = intval( mosGetParam( $_POST, 'menuid', 0 ) ); if ( $menuid ) { $menu->id = $menuid; } $menu->checkin(); -/* - if ( $menu->type == 'content_typed' ) { - $contentid = mosGetParam( $_POST, 'id', 0 ); - $content = new mosContent( $database ); - $content->load( $contentid ); - $content->checkin(); - } -*/ + mosRedirect( 'index2.php?option='. $option .'&menutype='. $menu->menutype ); } @@ -502,6 +511,9 @@ $row = new mosMenu( $database ); $row->load( $uid ); $row->move( $inc, "menutype = '$row->menutype' AND parent = $row->parent" ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option='. $option .'&menutype='. $row->menutype ); } @@ -524,6 +536,9 @@ if (!$menu->store()) { return $menu->getError(); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option='. $option .'&menutype='. $menutype ); } @@ -601,14 +616,14 @@ * Save the item(s) to the menu selected */ function moveMenuSave( $option, $cid, $menu, $menutype ) { - global $database, $my; + global $database; // add all decendants to the list foreach ($cid as $id) addDescendants($id, $cid); - $row = new mosMenu( $database ); - $ordering = 1000000; - $firstroot = 0; + $row = new mosMenu( $database ); + $ordering = 1000000; + $firstroot = 0; foreach ($cid as $id) { $row->load( $id ); @@ -638,6 +653,9 @@ $row->updateOrder( "menutype = '$row->menutype' AND parent = $row->parent" ); } // if + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + $msg = count($cid) .' Menu Items moved to '. $menu; mosRedirect( 'index2.php?option='. $option .'&menutype='. $menutype .'&mosmsg='. $msg ); } // moveMenuSave @@ -711,6 +729,10 @@ } $curr->updateOrder( "menutype = '$curr->menutype' AND parent = $curr->parent" ); } // foreach + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + $msg = count( $cid ) .' Menu Items Copied to '. $menu; mosRedirect( 'index2.php?option='. $option .'&menutype='. $menutype .'&mosmsg='. $msg ); } @@ -776,18 +798,48 @@ if ($cond[1]==$condition) { $found = true; break; - } // if + } if (!$found) $conditions[] = array($row->id, $condition); - } // for - } // for + } + } // execute updateOrder for each group foreach ( $conditions as $cond ) { $row->load( $cond[0] ); $row->updateOrder( $cond[1] ); - } // foreach + } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $msg = 'New ordering saved'; mosRedirect( 'index2.php?option=com_menus&menutype='. $menutype, $msg ); -} // saveOrder +} + +/** +* Returns list of child items for a given set of ids from menu items supplied +* +*/ +function josMenuChildrenRecurse( $mitems, $parents, $list, $maxlevel=20, $level=0 ) { + // check to reduce recursive processing + if ( $level <= $maxlevel && count( $parents ) ) { + $children = array(); + foreach ( $parents as $id ) { + foreach ( $mitems as $item ) { + if ( $item->parent == $id ) { + $children[] = $item->id; + } + } + } + + // check to reduce recursive processing + if ( count( $children ) ) { + $list = josMenuChildrenRecurse( $mitems, $children, $list, $maxlevel, $level+1 ); + + $list = array_merge( $list, $children ); + } + } + + return $list; +} ?> \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_menus/components/components.class.php joomla-1.0.10/administrator/components/com_menus/components/components.class.php --- joomla-1.0.7/administrator/components/com_menus/components/components.class.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/components/components.class.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@ params, $mainframe->getPath( 'com_xml', $row->option ), 'component' ); diff -urN joomla-1.0.7/administrator/components/com_menus/contact_category_table/contact_category_table.xml joomla-1.0.10/administrator/components/com_menus/contact_category_table/contact_category_table.xml --- joomla-1.0.7/administrator/components/com_menus/contact_category_table/contact_category_table.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/contact_category_table/contact_category_table.xml 2006-06-25 16:54:00.000000000 -0400 @@ -61,5 +61,10 @@ + + + + + diff -urN joomla-1.0.7/administrator/components/com_menus/contact_item_link/contact_item_link.xml joomla-1.0.10/administrator/components/com_menus/contact_item_link/contact_item_link.xml --- joomla-1.0.7/administrator/components/com_menus/contact_item_link/contact_item_link.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/contact_item_link/contact_item_link.xml 2006-06-25 16:53:59.000000000 -0400 @@ -22,5 +22,10 @@ + + + + + diff -urN joomla-1.0.7/administrator/components/com_menus/content_blog_category/content_blog_category.xml joomla-1.0.10/administrator/components/com_menus/content_blog_category/content_blog_category.xml --- joomla-1.0.7/administrator/components/com_menus/content_blog_category/content_blog_category.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/content_blog_category/content_blog_category.xml 2006-06-25 16:54:02.000000000 -0400 @@ -126,5 +126,10 @@ + + + + + diff -urN joomla-1.0.7/administrator/components/com_menus/content_blog_section/content_blog_section.xml joomla-1.0.10/administrator/components/com_menus/content_blog_section/content_blog_section.xml --- joomla-1.0.7/administrator/components/com_menus/content_blog_section/content_blog_section.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/content_blog_section/content_blog_section.xml 2006-06-25 16:54:02.000000000 -0400 @@ -126,5 +126,10 @@ + + + + + diff -urN joomla-1.0.7/administrator/components/com_menus/content_category/content_category.xml joomla-1.0.10/administrator/components/com_menus/content_category/content_category.xml --- joomla-1.0.7/administrator/components/com_menus/content_category/content_category.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/content_category/content_category.xml 2006-06-25 16:54:02.000000000 -0400 @@ -23,6 +23,14 @@ + + + + + + + + @@ -102,5 +110,10 @@ + + + + + diff -urN joomla-1.0.7/administrator/components/com_menus/content_item_link/content_item_link.class.php joomla-1.0.10/administrator/components/com_menus/content_item_link/content_item_link.class.php --- joomla-1.0.7/administrator/components/com_menus/content_item_link/content_item_link.class.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/content_item_link/content_item_link.class.php 2006-06-25 16:54:02.000000000 -0400 @@ -1,6 +1,6 @@ bind( $_POST ); - $menuid = mosGetParam( $_POST, 'menuid', 0 ); + $menuid = intval( mosGetParam( $_POST, 'menuid', 0 ) ); if ( $menuid ) { $menu->id = $menuid; } diff -urN joomla-1.0.7/administrator/components/com_menus/content_item_link/content_item_link.xml joomla-1.0.10/administrator/components/com_menus/content_item_link/content_item_link.xml --- joomla-1.0.7/administrator/components/com_menus/content_item_link/content_item_link.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/content_item_link/content_item_link.xml 2006-06-25 16:54:02.000000000 -0400 @@ -12,5 +12,10 @@ Creates a link to a published Content Item in full view + + + + + diff -urN joomla-1.0.7/administrator/components/com_menus/content_section/content_section.xml joomla-1.0.10/administrator/components/com_menus/content_section/content_section.xml --- joomla-1.0.7/administrator/components/com_menus/content_section/content_section.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/content_section/content_section.xml 2006-06-25 16:54:00.000000000 -0400 @@ -1,6 +1,6 @@ - Table - Content Section + List - Content Section Content Joomla! Project July 2004 @@ -23,6 +23,14 @@ + + + + + + + + @@ -39,11 +47,11 @@ - + - + @@ -115,5 +123,10 @@ + + + + + \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_menus/content_typed/content_typed.class.php joomla-1.0.10/administrator/components/com_menus/content_typed/content_typed.class.php --- joomla-1.0.7/administrator/components/com_menus/content_typed/content_typed.class.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/content_typed/content_typed.class.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@ params, $mainframe->getPath( 'menu_xml', $menu->type ), 'menu' ); @@ -103,7 +103,7 @@ $menu = new mosMenu( $database ); $menu->bind( $_POST ); - $menuid = mosGetParam( $_POST, 'menuid', 0 ); + $menuid = intval( mosGetParam( $_POST, 'menuid', 0 ) ); if ( $menuid ) { $menu->id = $menuid; } diff -urN joomla-1.0.7/administrator/components/com_menus/content_typed/content_typed.xml joomla-1.0.10/administrator/components/com_menus/content_typed/content_typed.xml --- joomla-1.0.7/administrator/components/com_menus/content_typed/content_typed.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/content_typed/content_typed.xml 2006-06-25 16:53:59.000000000 -0400 @@ -12,5 +12,10 @@ Creates a link to Static Content Item + + + + + diff -urN joomla-1.0.7/administrator/components/com_menus/newsfeed_category_table/newsfeed_category_table.xml joomla-1.0.10/administrator/components/com_menus/newsfeed_category_table/newsfeed_category_table.xml --- joomla-1.0.7/administrator/components/com_menus/newsfeed_category_table/newsfeed_category_table.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/newsfeed_category_table/newsfeed_category_table.xml 2006-06-25 16:54:02.000000000 -0400 @@ -36,7 +36,7 @@ - + diff -urN joomla-1.0.7/administrator/components/com_menus/toolbar.menus.html.php joomla-1.0.10/administrator/components/com_menus/toolbar.menus.html.php --- joomla-1.0.7/administrator/components/com_menus/toolbar.menus.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/toolbar.menus.html.php 2006-06-25 16:54:02.000000000 -0400 @@ -1,6 +1,6 @@ stderr(); } } else { - $type = mosGetParam( $_REQUEST, 'type', null ); + $type = strval( mosGetParam( $_REQUEST, 'type', null ) ); $item_path = $path . $type .'/'. $type .'.menubar.php'; if ( $type ) { @@ -73,7 +73,7 @@ break; default: - $type = mosGetParam( $_REQUEST, 'type' ); + $type = strval( mosGetParam( $_REQUEST, 'type' ) ); $item_path = $path . $type .'/'. $type .'.menubar.php'; if ( $type ) { diff -urN joomla-1.0.7/administrator/components/com_menus/wrapper/wrapper.xml joomla-1.0.10/administrator/components/com_menus/wrapper/wrapper.xml --- joomla-1.0.7/administrator/components/com_menus/wrapper/wrapper.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_menus/wrapper/wrapper.xml 2006-06-25 16:53:59.000000000 -0400 @@ -31,7 +31,7 @@ - + diff -urN joomla-1.0.7/administrator/components/com_messages/admin.messages.html.php joomla-1.0.10/administrator/components/com_messages/admin.messages.html.php --- joomla-1.0.7/administrator/components/com_messages/admin.messages.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_messages/admin.messages.html.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ -
    - - - - - - -
    Private MessagingSearch: -
    - - - - - - - - - - - - "> - - - - - - - - -
    # - SubjectFromDateRead
    limitstart;?>message_id ); ?> - subject; ?> user_from; ?>date_time; ?>state ) == "1") { - echo "Read"; - } else { - echo "Unread"; - } ?>
    - getListFooter(); ?> - - - - -
    - - - - - -
    Private Messaging Configuration
    -startPane("messages"); -$tabs->startTab("General","general-page"); -?> -
    - + + + + + +
    + Private Messaging Configuration +
    + + + + + + + + + + + + + + +
    + Lock Inbox: + + +
    + Mail me on new Message: + + +
    + Auto Purge Messages: + + days old +
    + + + +
    + - - - - - - - - - - - -
    Lock Inbox:
    Mail me on new Message:
    - - -endTab(); -$tabs->endPane(); -?> - - - - + + function viewMessage( &$row, $option ) { + ?> + + +
    - + -
    View Private Message + View Private Message +
    - - - +
    + + - - + + - - + + - - + + - - + + -
    From:user_from;?> + From: + + user_from;?> +
    Posted:date_time;?> + Posted: + + date_time;?> +
    Subject:subject;?> + Subject: + + subject;?> +
    Message:
    message );?>
    + Message: + +
    message );?>
    +
    - - - - - - - - - - - - + + function newMessage($option, $recipientslist, $subject ) { + global $my; + ?> + + +
    - + -
    New Private Message + New Private Message +
    - -
    - +
    + + + - - + + - + - + -
    To: + To: + + +
    Subject: + Subject: +
    Message: + Message: +
    - - - -
    - \ No newline at end of file + + + + + + + \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_messages/admin.messages.php joomla-1.0.10/administrator/components/com_messages/admin.messages.php --- joomla-1.0.7/administrator/components/com_messages/admin.messages.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_messages/admin.messages.php 2006-06-25 16:54:03.000000000 -0400 @@ -18,7 +18,6 @@ require_once( $mainframe->getPath( 'admin_html' ) ); require_once( $mainframe->getPath( 'class' ) ); -$task = mosGetParam( $_REQUEST, 'task' ); $cid = mosGetParam( $_REQUEST, 'cid', array( 0 ) ); if (!is_array( $cid )) { $cid = array ( 0 ); @@ -34,11 +33,7 @@ break; case 'reply': - newMessage( - $option, - mosGetParam( $_REQUEST, 'userid', 0 ), - mosGetParam( $_REQUEST, 'subject', '' ) - ); + newMessage( $option ); break; case 'save': @@ -72,9 +67,21 @@ $database->setQuery( $query ); $data = $database->loadObjectList( 'cfg_name' ); - $vars = array(); - $vars['lock'] = mosHTML::yesnoSelectList( "vars[lock]", 'class="inputbox" size="1"', @$data['lock']->cfg_value ); - $vars['mail_on_new'] = mosHTML::yesnoSelectList( "vars[mail_on_new]", 'class="inputbox" size="1"', @$data['mail_on_new']->cfg_value ); + // initialize values if they do not exist + if (!isset($data['lock']->cfg_value)) { + $data['lock']->cfg_value = 0; + } + if (!isset($data['mail_on_new']->cfg_value)) { + $data['mail_on_new']->cfg_value = 0; + } + if (!isset($data['auto_purge']->cfg_value)) { + $data['auto_purge']->cfg_value = 7; + } + + $vars = array(); + $vars['lock'] = mosHTML::yesnoSelectList( "vars[lock]", 'class="inputbox" size="1"', $data['lock']->cfg_value ); + $vars['mail_on_new'] = mosHTML::yesnoSelectList( "vars[mail_on_new]", 'class="inputbox" size="1"', $data['mail_on_new']->cfg_value ); + $vars['auto_purge'] = $data['auto_purge']->cfg_value; HTML_messages::editConfig( $vars, $option ); @@ -102,9 +109,12 @@ mosRedirect( "index2.php?option=$option" ); } -function newMessage( $option, $user, $subject ) { - global $database, $mainframe, $my, $acl; - +function newMessage( $option ) { + global $database, $acl; + + $user = intval( mosGetParam( $_REQUEST, 'userid', 0 ) ); + $subject = strval( mosGetParam( $_REQUEST, 'subject', '' ) ); + // get available backend user groups $gid = $acl->get_group_id( 'Public Backend', 'ARO' ); $gids = $acl->get_group_children( $gid, 'ARO', 'RECURSE' ); @@ -112,6 +122,7 @@ // get list of usernames $recipients = array( mosHTML::makeOption( '0', '- Select User -' ) ); + $query = "SELECT id AS value, username AS text FROM #__users" . "\n WHERE gid IN ( $gids )" . "\n ORDER BY name" @@ -119,15 +130,8 @@ $database->setQuery( $query ); $recipients = array_merge( $recipients, $database->loadObjectList() ); - $recipientslist = - mosHTML::selectList( - $recipients, - 'user_id_to', - 'class="inputbox" size="1"', - 'value', - 'text', - $user - ); + $recipientslist = mosHTML::selectList( $recipients, 'user_id_to', 'class="inputbox" size="1"', 'value', 'text', $user ); + HTML_messages::newMessage($option, $recipientslist, $subject ); } @@ -139,11 +143,16 @@ echo "\n"; exit(); } + + if (!$row->check()) { + echo "\n"; + exit(); + } if (!$row->send()) { - mosRedirect( "index2.php?option=com_messages&mosmsg=" . $row->getError() ); + mosRedirect( 'index2.php?option=com_messages&mosmsg=' . $row->getError() ); } - mosRedirect( "index2.php?option=com_messages" ); + mosRedirect( 'index2.php?option=com_messages' ); } function showMessages( $option ) { diff -urN joomla-1.0.7/administrator/components/com_modules/admin.modules.html.php joomla-1.0.10/administrator/components/com_modules/admin.modules.html.php --- joomla-1.0.7/administrator/components/com_modules/admin.modules.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_modules/admin.modules.html.php 2006-06-25 16:54:04.000000000 -0400 @@ -1,6 +1,6 @@ titleA = ''; if ( $row->id ) { @@ -219,7 +219,6 @@ module == "") { getEditorContents( 'editor1', 'content' ); }?> - submitform(pressbutton); } submitform(pressbutton); } @@ -259,7 +258,7 @@ Details - + Title: @@ -340,13 +339,36 @@ Parameters - + render();?> + + module == "") { + ?> + + + + +
    + + gid == 25 ) { + $visible = 1; + } + mosHTML::writableCell( $mosConfig_cachepath, 0, 'Cache Directory ', $visible ); + ?> +
    +
    + @@ -354,7 +376,7 @@ - + - +
    Pages / Items
    Menu Item Link(s): @@ -375,7 +397,7 @@ Custom Output
    Content: diff -urN joomla-1.0.7/administrator/components/com_modules/admin.modules.php joomla-1.0.10/administrator/components/com_modules/admin.modules.php --- joomla-1.0.7/administrator/components/com_modules/admin.modules.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_modules/admin.modules.php 2006-06-25 16:54:04.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); -$client = mosGetParam( $_REQUEST, 'client', '' ); -$cid = mosGetParam( $_POST, 'cid', array(0) ); -$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); +$client = strval( mosGetParam( $_REQUEST, 'client', '' ) ); $moduleid = mosGetParam( $_REQUEST, 'moduleid', null ); +$cid = mosGetParam( $_POST, 'cid', array(0) ); if ($cid[0] == 0 && isset($moduleid) ) { $cid[0] = $moduleid; } @@ -40,7 +39,7 @@ break; case 'edit': - editModule( $option, $cid[0], $client ); + editModule( $option, intval( $cid[0] ), $client ); break; case 'editA': @@ -49,7 +48,6 @@ case 'save': case 'apply': - mosCache::cleanCache( 'com_content' ); saveModule( $option, $client, $task ); break; @@ -63,19 +61,18 @@ case 'publish': case 'unpublish': - mosCache::cleanCache( 'com_content' ); publishModule( $cid, ($task == 'publish'), $option, $client ); break; case 'orderup': case 'orderdown': - orderModule( $cid[0], ($task == 'orderup' ? -1 : 1), $option ); + orderModule( intval( $cid[0] ), ($task == 'orderup' ? -1 : 1), $option ); break; case 'accesspublic': case 'accessregistered': case 'accessspecial': - accessMenu( $cid[0], $task, $option, $client ); + accessMenu( intval( $cid[0] ), $task, $option, $client ); break; case 'saveorder': @@ -95,8 +92,8 @@ $filter_position = $mainframe->getUserStateFromRequest( "filter_position{$option}{$client}", 'filter_position', 0 ); $filter_type = $mainframe->getUserStateFromRequest( "filter_type{$option}{$client}", 'filter_type', 0 ); - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ) ); $search = $mainframe->getUserStateFromRequest( "search{$option}{$client}", 'search', '' ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); @@ -222,6 +219,8 @@ $database->query(); } + mosCache::cleanCache( 'com_content' ); + $msg = 'Module Copied ['. $row->title .']'; mosRedirect( 'index2.php?option='. $option .'&client='. $client, $msg ); } @@ -254,6 +253,7 @@ echo "\n"; exit(); } + $row->checkin(); if ($client == 'admin') { $where = "client_id=1"; @@ -294,6 +294,8 @@ } } + mosCache::cleanCache( 'com_content' ); + switch ( $task ) { case 'apply': $msg = 'Successfully Saved changes to Module: '. $row->title; @@ -326,7 +328,7 @@ mosErrorAlert( "The module ".$row->title." is currently being edited by another administrator" ); } - $row->content = htmlspecialchars( str_replace( '&', '&', $row->content ) ); + $row->content = htmlspecialchars( $row->content ); if ( $uid ) { $row->checkout( $my->id ); @@ -517,6 +519,8 @@ echo "\n"; } + mosCache::cleanCache( 'com_content' ); + mosRedirect( 'index2.php?option='. $option .'&client='. $client ); } @@ -552,6 +556,8 @@ $row->checkin( $cid[0] ); } + mosCache::cleanCache( 'com_content' ); + mosRedirect( 'index2.php?option='. $option .'&client='. $client ); } @@ -577,7 +583,7 @@ function orderModule( $uid, $inc, $option ) { global $database; - $client = mosGetParam( $_POST, 'client', '' ); + $client = strval( mosGetParam( $_POST, 'client', '' ) ); $row = new mosModule( $database ); $row->load( $uid ); @@ -594,6 +600,8 @@ $client = ''; } + mosCache::cleanCache( 'com_content' ); + mosRedirect( 'index2.php?option='. $option .'&client='. $client ); } @@ -629,6 +637,8 @@ return $row->getError(); } + mosCache::cleanCache( 'com_content' ); + mosRedirect( 'index2.php?option='. $option .'&client='. $client ); } @@ -667,6 +677,8 @@ $row->updateOrder( $cond[1] ); } // foreach + mosCache::cleanCache( 'com_content' ); + $msg = 'New ordering saved'; mosRedirect( 'index2.php?option=com_modules&client='. $client, $msg ); } // saveOrder diff -urN joomla-1.0.7/administrator/components/com_modules/toolbar.modules.php joomla-1.0.10/administrator/components/com_modules/toolbar.modules.php --- joomla-1.0.7/administrator/components/com_modules/toolbar.modules.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_modules/toolbar.modules.php 2006-06-25 16:54:04.000000000 -0400 @@ -1,6 +1,6 @@ @@ -132,6 +132,23 @@ ?>
    getListFooter(); ?> + + + + + +
    + + gid == 25 ) { + $visible = 1; + } + mosHTML::writableCell( $mosConfig_cachepath, 0, 'Cache Directory ', $visible ); + ?> +
    +
    diff -urN joomla-1.0.7/administrator/components/com_newsfeeds/admin.newsfeeds.php joomla-1.0.10/administrator/components/com_newsfeeds/admin.newsfeeds.php --- joomla-1.0.7/administrator/components/com_newsfeeds/admin.newsfeeds.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_newsfeeds/admin.newsfeeds.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); require_once( $mainframe->getPath( 'class' ) ); -$task = mosGetParam( $_REQUEST, 'task', array(0) ); $cid = mosGetParam( $_POST, 'cid', array(0) ); -$id = mosGetParam( $_GET, 'id', 0 ); if (!is_array( $cid )) { $cid = array(0); } @@ -38,7 +36,7 @@ break; case 'edit': - editNewsFeed( $cid[0], $option ); + editNewsFeed( intval( $cid[0] ), $option ); break; case 'editA': @@ -66,11 +64,11 @@ break; case 'orderup': - orderNewsFeed( $cid[0], -1, $option ); + orderNewsFeed( intval( $cid[0] ), -1, $option ); break; case 'orderdown': - orderNewsFeed( $cid[0], 1, $option ); + orderNewsFeed( intval( $cid[0] ), 1, $option ); break; default: @@ -85,9 +83,9 @@ function showNewsFeeds( $option ) { global $database, $mainframe, $mosConfig_list_limit; - $catid = $mainframe->getUserStateFromRequest( "catid{$option}", 'catid', 0 ); - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ); + $catid = intval( $mainframe->getUserStateFromRequest( "catid{$option}", 'catid', 0 ) ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ) ); // get the total number of records $query = "SELECT COUNT(*)" @@ -279,8 +277,8 @@ function orderNewsFeed( $id, $inc, $option ) { global $database; - $limit = mosGetParam( $_REQUEST, 'limit', 0 ); - $limitstart = mosGetParam( $_REQUEST, 'limitstart', 0 ); + $limit = intval( mosGetParam( $_REQUEST, 'limit', 0 ) ); + $limitstart = intval( mosGetParam( $_REQUEST, 'limitstart', 0 ) ); $catid = intval( mosGetParam( $_REQUEST, 'catid', 0 ) ); $row = new mosNewsFeed( $database ); diff -urN joomla-1.0.7/administrator/components/com_newsfeeds/newsfeeds.xml joomla-1.0.10/administrator/components/com_newsfeeds/newsfeeds.xml --- joomla-1.0.7/administrator/components/com_newsfeeds/newsfeeds.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_newsfeeds/newsfeeds.xml 2006-06-25 16:53:59.000000000 -0400 @@ -65,7 +65,7 @@ - + diff -urN joomla-1.0.7/administrator/components/com_poll/admin.poll.html.php joomla-1.0.10/administrator/components/com_poll/admin.poll.html.php --- joomla-1.0.7/administrator/components/com_poll/admin.poll.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_poll/admin.poll.html.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ + + Published: + + + + + + -

    Options: diff -urN joomla-1.0.7/administrator/components/com_poll/admin.poll.php joomla-1.0.10/administrator/components/com_poll/admin.poll.php --- joomla-1.0.7/administrator/components/com_poll/admin.poll.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_poll/admin.poll.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ) ); $query = "SELECT COUNT(*)" . "\n FROM #__polls" @@ -141,8 +141,11 @@ } // build the html select list - $lists['select'] = mosAdminMenus::MenuLinks( $lookup, 1, 1 ); + $lists['select'] = mosAdminMenus::MenuLinks( $lookup, 1, 1 ); + // build the html select list for published + $lists['published'] = mosAdminMenus::Published( $row ); + HTML_poll::editPoll($row, $options, $lists ); } diff -urN joomla-1.0.7/administrator/components/com_poll/toolbar.poll.php joomla-1.0.10/administrator/components/com_poll/toolbar.poll.php --- joomla-1.0.7/administrator/components/com_poll/toolbar.poll.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_poll/toolbar.poll.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ name != '' ) { $name = $row->name; } else { @@ -181,6 +182,8 @@ if ($row->image == "") { $row->image = 'blank.png'; } + + mosMakeHtmlSafe( $row, ENT_QUOTES, 'description' ); ?> \n"; exit(); } $row->checkin(); $row->updateOrder( "scope='$row->scope'" ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); switch ( $task ) { case 'go2menu': @@ -380,6 +434,9 @@ $msg = 'Sections(s): '. $cids .' cannot be removed as they contain categories'; mosRedirect( 'index2.php?option='. $option .'&scope='. $scope, $msg ); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $names = implode( ', ', $name ); $msg = 'Section(s): '. $names .' successfully deleted'; @@ -450,6 +507,9 @@ } } } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option='. $option .'&scope='. $scope ); } @@ -479,6 +539,9 @@ $row = new mosSection( $database ); $row->load( $uid ); $row->move( $inc, "scope = '$row->scope'" ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option='. $option .'&scope='. $scope ); } @@ -523,7 +586,7 @@ function copySectionSave( $sectionid ) { global $database; - $title = mosGetParam( $_REQUEST, 'title', '' ); + $title = strval( mosGetParam( $_REQUEST, 'title', '' ) ); $contentid = mosGetParam( $_REQUEST, 'content', '' ); $categoryid = mosGetParam( $_REQUEST, 'category', '' ); @@ -608,6 +671,9 @@ } $sectionOld = new mosSection ( $database ); $sectionOld->load( $sectionMove ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $msg = 'Section '. $sectionOld-> name .' and all its Categories and Items have been copied as '. $title; mosRedirect( 'index2.php?option=com_sections&scope=content&mosmsg='. $msg ); @@ -630,6 +696,9 @@ if ( !$row->store() ) { return $row->getError(); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option='. $option .'&scope='. $row->scope ); } @@ -641,10 +710,12 @@ $section->bind( $_POST ); $section->checkin(); - $menu = mosGetParam( $_POST, 'menuselect', '' ); - $name = mosGetParam( $_POST, 'link_name', '' ); - $type = mosGetParam( $_POST, 'link_type', '' ); + $menu = strval( mosGetParam( $_POST, 'menuselect', '' ) ); + $name = strval( mosGetParam( $_POST, 'link_name', '' ) ); + $type = strval( mosGetParam( $_POST, 'link_type', '' ) ); + $name = stripslashes( ampReplace($name) ); + switch ( $type ) { case 'content_section': $link = 'index.php?option=com_content&task=section&id='. $id; @@ -685,6 +756,9 @@ } $row->checkin(); $row->updateOrder( "menutype = '$menu'" ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $msg = $name .' ( '. $menutype .' ) in menu: '. $menu .' successfully created'; mosRedirect( 'index2.php?option=com_sections&scope=content&task=editA&hidemainmenu=1&id='. $id, $msg ); @@ -725,7 +799,28 @@ $row->updateOrder( $cond[1] ); } // foreach + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + $msg = 'New ordering saved'; mosRedirect( 'index2.php?option=com_sections&scope=content', $msg ); } // saveOrder -?> + +function recursive_listdir( $base ) { + static $filelist = array(); + static $dirlist = array(); + + if(is_dir($base)) { + $dh = opendir($base); + while (false !== ($dir = readdir($dh))) { + if (is_dir($base .'/'. $dir) && $dir !== '.' && $dir !== '..' && strtolower($dir) !== 'cvs' && strtolower($dir) !== '.svn') { + $subbase = $base .'/'. $dir; + $dirlist[] = $subbase; + $subdirlist = recursive_listdir($subbase); + } + } + closedir($dh); + } + return $dirlist; +} +?> \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_statistics/admin.statistics.html.php joomla-1.0.10/administrator/components/com_statistics/admin.statistics.html.php --- joomla-1.0.7/administrator/components/com_statistics/admin.statistics.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_statistics/admin.statistics.html.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@
    + - - + - + + + +
    +
    Search Engine Text : logging is : - getCfg( 'enable_log_searches' ) ? 'Enabled' : 'Disabled' ?> + getCfg( 'enable_log_searches' ) ? 'Enabled' : 'Disabled' ?> -
    + + + + + + + +
    - - - - + + + + + + - - - + + + + + -
    #Search TextTimes RequestedResults Returned + # + + Search Text + + Times Requested + + Results Returned +
    - limitstart; ?> + limitstart; ?> search_term;?>hits; ?>returns; ?> + search_term;?> + + hits; ?> + + returns; ?> +
    - getListFooter(); ?> - - -
    - + getListFooter(); ?> + + + + + +?> \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_statistics/admin.statistics.php joomla-1.0.10/administrator/components/com_statistics/admin.statistics.php --- joomla-1.0.7/administrator/components/com_statistics/admin.statistics.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_statistics/admin.statistics.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ loadBotGroup( 'search' ); - for ($i=0, $n = count($rows); $i < $n; $i++) { - $results = $_MAMBOTS->trigger( 'onSearch', array( $rows[$i]->search_term ) ); - - $count = 0; - for ($j = 0, $n2 = count( $results ); $j < $n2; $j++) { - $count += count( $results[$j] ); + $total = count($rows); + for ($i=0, $n = $total; $i < $n; $i++) { + // determine if number of results for search item should be calculated + // by default it is `off` as it is highly query intensive + if ( $showResults ) { + $results = $_MAMBOTS->trigger( 'onSearch', array( $rows[$i]->search_term ) ); + + $count = 0; + $total = count( $results ); + for ($j = 0, $n2 = $total; $j < $n2; $j++) { + $count += count( $results[$j] ); + } + + $rows[$i]->returns = $count; + } else { + $rows[$i]->returns = null; } - - $rows[$i]->returns = $count; } - HTML_statistics::showSearches( $rows, $pageNav, $option, $task ); + HTML_statistics::showSearches( $rows, $pageNav, $option, $task, $showResults ); } ?> \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_statistics/toolbar.statistics.php joomla-1.0.10/administrator/components/com_statistics/toolbar.statistics.php --- joomla-1.0.7/administrator/components/com_statistics/toolbar.statistics.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_statistics/toolbar.statistics.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'toolbar_html' ) ); switch ($task) { - - case "searches": + case 'searches': + case 'searchesresults': TOOLBAR_statistics::_SEARCHES(); break; diff -urN joomla-1.0.7/administrator/components/com_syndicate/admin.syndicate.html.php joomla-1.0.10/administrator/components/com_syndicate/admin.syndicate.html.php --- joomla-1.0.7/administrator/components/com_syndicate/admin.syndicate.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_syndicate/admin.syndicate.html.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@
    @@ -48,6 +48,23 @@ + + + + + +
    + + gid == 25 ) { + $visible = 1; + } + mosHTML::writableCell( $mosConfig_cachepath, 0, 'Cache Directory ', $visible ); + ?> +
    +
    diff -urN joomla-1.0.7/administrator/components/com_syndicate/admin.syndicate.php joomla-1.0.10/administrator/components/com_syndicate/admin.syndicate.php --- joomla-1.0.7/administrator/components/com_syndicate/admin.syndicate.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_syndicate/admin.syndicate.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); - switch ($task) { - case 'save': saveSyndicate( $option ); break; - case 'cancel': + case 'cancel': cancelSyndicate( ); break; @@ -43,11 +41,12 @@ * @param string The current GET/POST option */ function showSyndicate( $option ) { - global $database, $mainframe, $mosConfig_list_limit; + global $database, $mainframe; $query = "SELECT a.id" . "\n FROM #__components AS a" - . "\n WHERE a.name = 'Syndicate'" + . "\n WHERE ( a.admin_menu_link = 'option=com_syndicate' OR a.admin_menu_link = 'option=com_syndicate&hidemainmenu=1' )" + . "\n AND a.option = 'com_syndicate'" ; $database->setQuery( $query ); $id = $database->loadResult(); @@ -78,7 +77,7 @@ $_POST['params'] = mosParameters::textareaHandling( $txt ); } - $id = mosGetParam( $_POST, 'id', '17' ); + $id = intval( mosGetParam( $_POST, 'id', '17' ) ); $row = new mosComponent( $database ); $row->load( $id ); diff -urN joomla-1.0.7/administrator/components/com_syndicate/syndicate.xml joomla-1.0.10/administrator/components/com_syndicate/syndicate.xml --- joomla-1.0.7/administrator/components/com_syndicate/syndicate.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_syndicate/syndicate.xml 2006-06-25 16:53:59.000000000 -0400 @@ -9,6 +9,11 @@ 1.0.0 This component controls the Syndication settings + + + + + @@ -28,6 +33,27 @@ + + + + + + + + + + + + + + + + + + + + + diff -urN joomla-1.0.7/administrator/components/com_templates/admin.templates.html.php joomla-1.0.10/administrator/components/com_templates/admin.templates.html.php --- joomla-1.0.7/administrator/components/com_templates/admin.templates.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_templates/admin.templates.html.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ - + @@ -207,7 +207,7 @@ $tabs->endPane(); ?> - + diff -urN joomla-1.0.7/administrator/components/com_trash/admin.trash.php joomla-1.0.10/administrator/components/com_trash/admin.trash.php --- joomla-1.0.7/administrator/components/com_trash/admin.trash.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_trash/admin.trash.php 2006-06-25 16:53:59.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); require_once( $mainframe->getPath( 'class', 'com_frontpage' ) ); -$cid = mosGetParam( $_POST, 'cid', array(0) ); $mid = mosGetParam( $_POST, 'mid', array(0) ); +$cid = mosGetParam( $_POST, 'cid', array(0) ); if ( !is_array( $cid ) ) { $cid = array(0); } @@ -57,11 +57,12 @@ */ function viewTrash( $option ) { global $database, $mainframe, $mosConfig_list_limit; - require_once( $GLOBALS['mosConfig_absolute_path'] . '/administrator/includes/pageNavigation.php' ); - - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{". $option ."}limitstart", 'limitstart', 0 ); + + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 10 ) ); + require_once( $GLOBALS['mosConfig_absolute_path'] . '/administrator/includes/pageNavigation.php' ); + // get the total number of content $query = "SELECT count(*)" . "\n FROM #__content AS c" @@ -70,8 +71,8 @@ . "\n WHERE c.state = -2" ; $database->setQuery( $query ); - $total_content = $database->loadResult(); - $pageNav_content = new mosPageNav( $total_content, $limitstart, $limit ); + $total_content = $database->loadResult(); + $pageNav_content = new mosPageNav( $total_content, $limitstart, $limit ); // Query content items $query = "SELECT c.*, g.name AS groupname, cc.name AS catname, s.name AS sectname" @@ -82,21 +83,18 @@ . "\n LEFT JOIN #__users AS u ON u.id = c.checked_out" . "\n WHERE c.state = -2" . "\n ORDER BY s.name, cc.name, c.title" - . "\n LIMIT $pageNav_content->limitstart, $pageNav_content->limit " ; - $database->setQuery( $query ); + $database->setQuery( $query, $pageNav_content->limitstart, $pageNav_content->limit ); $contents = $database->loadObjectList(); - $query = "SELECT count(*)" . "\n FROM #__menu AS m" . "\n LEFT JOIN #__users AS u ON u.id = m.checked_out" . "\n WHERE m.published = -2" ; $database->setQuery( $query ); - $total_menu = $database->loadResult(); - //$total_menu = count( $total_menu ); - $pageNav_menu = new mosPageNav( $total_menu, $limitstart, $limit ); + $total_menu = $database->loadResult(); + $pageNav_menu = new mosPageNav( $total_menu, $limitstart, $limit ); // Query menu items $query = "SELECT m.*" @@ -104,14 +102,17 @@ . "\n LEFT JOIN #__users AS u ON u.id = m.checked_out" . "\n WHERE m.published = -2" . "\n ORDER BY m.menutype, m.ordering, m.ordering, m.name" - . "\n LIMIT $pageNav_menu->limitstart, $pageNav_menu->limit" ; - $database->setQuery( $query ); + $database->setQuery( $query, $pageNav_menu->limitstart, $pageNav_menu->limit ); $menus = $database->loadObjectList(); - for ( $i = 0; $i < $total_content; $i++ ) { + $num = $total_content; + if ( $limit < $total_content ) { + $num = $limit; + } + for ( $i = 0; $i < $num; $i++ ) { if ( ( $contents[$i]->sectionid == 0 ) && ( $contents[$i]->catid == 0 ) ) { - $contents[$i]->sectname = 'Typed Content'; + $contents[$i]->sectname = 'Static Content'; } } @@ -137,9 +138,9 @@ . "\n ORDER BY a.title" ; $database->setQuery( $query ); - $items = $database->loadObjectList(); - $id = $cid; - $type = "content"; + $items = $database->loadObjectList(); + $id = $cid; + $type = 'content'; } else if ( $mids ) { // Content Items query $query = "SELECT a.name" @@ -148,9 +149,9 @@ . "\n ORDER BY a.name" ; $database->setQuery( $query ); - $items = $database->loadObjectList(); - $id = $mid; - $type = "menu"; + $items = $database->loadObjectList(); + $id = $mid; + $type = 'menu'; } HTML_trash::showDelete( $option, $id, $items, $type ); @@ -240,26 +241,62 @@ $state = 0; $ordering = 9999; //seperate contentids - $cids = implode( ',', $cid ); + $cids = implode( ',', $cid ); if ( $type == 'content' ) { + // query to restore content items $query = "UPDATE #__content" . "\n SET state = $state, ordering = $ordering" . "\n WHERE id IN ( $cids )" ; - } else if ( $type == "menu" ) { - $query = "UPDATE #__menu" - . "\n SET published = $state, ordering = 9999" - . "\n WHERE id IN ( $cids )" - ; - } - - $database->setQuery( $query ); - if ( !$database->query() ) { - echo "\n"; - exit(); - } + $database->setQuery( $query ); + if ( !$database->query() ) { + echo "\n"; + exit(); + } + } else if ( $type == 'menu' ) { + sort( $cid ); + foreach ( $cid as $id ) { + $check = 1; + $row = new mosMenu( $database ); + $row->load( $id ); + + // check if menu item is a child item + if ( $row->parent != 0 ) { + $query = "SELECT id" + . "\n FROM #__menu" + . "\n WHERE id = $row->parent" + . "\n AND ( published = 0 OR published = 1 )" + ; + $database->setQuery( $query ); + $check = $database->loadResult(); + + if ( !$check ) { + // if menu items parent is not found that are published/unpublished make it a root menu item + $query = "UPDATE #__menu" + . "\n SET parent = 0, published = $state, ordering = 9999" + . "\n WHERE id = $id" + ; + } + } + + if ( $check ) { + // query to restore menu items + $query = "UPDATE #__menu" + . "\n SET published = $state, ordering = 9999" + . "\n WHERE id = $id" + ; + } + + $database->setQuery( $query ); + if ( !$database->query() ) { + echo "\n"; + exit(); + } + } + } + $msg = $total. " Item(s) successfully Restored"; mosRedirect( "index2.php?option=$option&mosmsg=". $msg ."" ); } diff -urN joomla-1.0.7/administrator/components/com_typedcontent/admin.typedcontent.html.php joomla-1.0.10/administrator/components/com_typedcontent/admin.typedcontent.html.php --- joomla-1.0.7/administrator/components/com_typedcontent/admin.typedcontent.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_typedcontent/admin.typedcontent.html.php 2006-06-25 16:54:05.000000000 -0400 @@ -1,764 +1,801 @@ - - - -
    Trash Manager
    - - - - - - - - -
    - Static Content Manager - - Filter:  - - - -    Order:  - - - - -
    - - - - - - - - - - - - - - - - getNullDate(); - for ($i=0, $n=count( $rows ); $i < $n; $i++) { - $row = &$rows[$i]; - - $now = date( 'Y-m-d H:i:s' ); - if ( $now <= $row->publish_up && $row->state == "1" ) { - $img = 'publish_y.png'; - $alt = 'Published'; - } else if ( ( $now <= $row->publish_down || $row->publish_down == $nullDate ) && $row->state == "1" ) { - $img = 'publish_g.png'; - $alt = 'Published'; - } else if ( $now > $row->publish_down && $row->state == "1" ) { - $img = 'publish_r.png'; - $alt = 'Expired'; - } elseif ( $row->state == "0" ) { - $img = "publish_x.png"; - $alt = 'Unpublished'; - } - $times = ''; - if (isset($row->publish_up)) { - if ($row->publish_up == $nullDate) { - $times .= ""; - } else { - $times .= ""; - } - } - if (isset($row->publish_down)) { - if ($row->publish_down == $nullDate) { - $times .= ""; - } else { - $times .= ""; - } - } - - if ( !$row->access ) { - $color_access = 'style="color: green;"'; - $task_access = 'accessregistered'; - } else if ( $row->access == 1 ) { - $color_access = 'style="color: red;"'; - $task_access = 'accessspecial'; - } else { - $color_access = 'style="color: black;"'; - $task_access = 'accesspublic'; - } - - $link = 'index2.php?option=com_typedcontent&task=edit&hidemainmenu=1&id='. $row->id; - - if ( $row->checked_out ) { - $checked = mosCommonHTML::checkedOut( $row ); - } else { - $checked = mosHTML::idBox( $i, $row->id, ($row->checked_out && $row->checked_out != $my->id ) ); - } - - if ( $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ) ) { - if ( $row->created_by_alias ) { - $author = $row->created_by_alias; - } else { - $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id='. $row->created_by; - $author = ''. $row->creator .''; - } - } else { - if ( $row->created_by_alias ) { - $author = $row->created_by_alias; - } else { - $author = $row->creator; - } - } - - $date = mosFormatDate( $row->created, '%x' ); - ?> - "> - - - - - - - - - - - - - - -
    - # - - - - Title - - Published - - Order - - Save Order - - Access - - ID - - Links - - Author - - Date -
    Start: Always
    Start: $row->publish_up
    Finish: No Expiry
    Finish: $row->publish_down
    - rowNumber( $i ); ?> - - - - checked_out && ( $row->checked_out != $my->id ) ) { - echo $row->title; - if ( $row->title_alias ) { - echo ' ('. $row->title_alias .')'; - } - } else { - ?> - - title; - if ( $row->title_alias ) { - echo ' ('. $row->title_alias .')'; - } - ?> - - - - ')"> - <?php echo $alt; ?> - - - - - > - groupname;?> - - - id;?> - - links;?> - - - - -
    - - getListFooter(); ?> - - - - - - - - hits ) { - $visibility = "style='display: none; visbility: hidden;'"; - } else { - $visibility = ""; - } - - mosCommonHTML::loadOverlib(); - mosCommonHTML::loadCalendar(); - ?> - - - - - - -
    - Static Content Item: - - id ? 'Edit' : 'New';?> - -
    - -
    - - - - - - -
    - - - - - - - - - - - - - - - -
    - Item Details -
    - Title: - - -
    - Title Alias: - - -
    - Text: (required)
    - introtext, 'introtext', '100%;', '500', '75', '50' ); - ?> -
    -
    - startPane("content-pane"); - $tabs->startTab("Publishing","publish-page"); - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Publishing Info -
    - State: - - state > 0 ? 'Published' : 'Draft Unpublished'; ?> -
    - Published: - - state ? 'checked="checked"' : ''; ?> /> -
    - Access Level: - - -
    - Author Alias: - - -
    - Change Creator: - - -
    - Override Created Date - - - -
    - Start Publishing: - - - -
    - Finish Publishing: - - - -
    -
    - - id ) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Content ID: - - id; ?> -
    - State - - state > 0 ? 'Published' : ($row->state < 0 ? 'Archived' : 'Draft Unpublished');?> -
    - Hits - - hits;?> -
    > - -
    -
    - Version - - version";?> -
    - Created - - created ? "$row->created
    By$row->creator" : "New document";?> -
    - Last Modified - - modified ? "$row->modified
    By$row->modifier" : "Not modified";?> -
    - Expires - - publish_down";?> -
    - endTab(); - $tabs->startTab("Images","images-page"); - ?> - - - - - - - - - - - - - - -
    - MOSImage Control -
    - - - - - - -
    -
    - Gallery Images: -
    - -
    - Sub-folder: -
    -
    - -
    - -
    -
    - Content Images: -
    - -
    - - -
    -
    -
    -
    - Sample Image:
    - -
    -
    -
    - Active Image:
    - -
    -
    - Edit the image selected: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Source - - -
    - Align - - -
    - Alt Text - - -
    - Border - - -
    - Caption: - - -
    - Caption Position: - - -
    - Caption Align: - - -
    - Width: - - -
    - -
    -
    - endTab(); - $tabs->startTab("Parameters","params-page"); - ?> - - - - - - - -
    - Parameter Control -
    - render();?> -
    - endTab(); - $tabs->startTab("Meta Info","metadata-page"); - ?> - - - - - - - - - - -
    - Meta Data -
    - Description:
    - -
    - Keywords:
    - -
    - endTab(); - $tabs->startTab("Link to Menu","link-page"); - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - Link to Menu -
    - This will create a 'Link - Static Content' in the menu you select -

    -
    - Select a Menu - - -
    - Menu Item Name - - -
    - - -
    - Existing Menu Links -
    - None -
    -
    - endTab(); - $tabs->endPane(); - ?> -
    - - - - - - -
    - +
    + + + + + + + + + + +
    + Static Content Manager + + Filter:  + + + +    Order:  + + + + +
    + + + + + + + + + + + + + + + + getNullDate(); + for ($i=0, $n=count( $rows ); $i < $n; $i++) { + $row = &$rows[$i]; + + $now = _CURRENT_SERVER_TIME; + if ( $now <= $row->publish_up && $row->state == 1 ) { + // Published + $img = 'publish_y.png'; + $alt = 'Published'; + } else if ( ( $now <= $row->publish_down || $row->publish_down == $nullDate ) && $row->state == 1 ) { + // Pending + $img = 'publish_g.png'; + $alt = 'Published'; + } else if ( $now > $row->publish_down && $row->state == 1 ) { + // Expired + $img = 'publish_r.png'; + $alt = 'Expired'; + } elseif ( $row->state == 0 ) { + // Unpublished + $img = 'publish_x.png'; + $alt = 'Unpublished'; + } + + // correct times to include server offset info + $row->publish_up = mosFormatDate( $row->publish_up, _CURRENT_SERVER_TIME_FORMAT ); + if (trim( $row->publish_down ) == $nullDate || trim( $row->publish_down ) == '' || trim( $row->publish_down ) == '-' ) { + $row->publish_down = 'Never'; + } + $row->publish_down = mosFormatDate( $row->publish_down, _CURRENT_SERVER_TIME_FORMAT ); + + $times = ''; + if ($row->publish_up == $nullDate) { + $times .= ""; + } else { + $times .= ""; + } + if ($row->publish_down == $nullDate || $row->publish_down == 'Never') { + $times .= ""; + } else { + $times .= ""; + } + + if ( !$row->access ) { + $color_access = 'style="color: green;"'; + $task_access = 'accessregistered'; + } else if ( $row->access == 1 ) { + $color_access = 'style="color: red;"'; + $task_access = 'accessspecial'; + } else { + $color_access = 'style="color: black;"'; + $task_access = 'accesspublic'; + } + + $link = 'index2.php?option=com_typedcontent&task=edit&hidemainmenu=1&id='. $row->id; + + $checked = mosCommonHTML::CheckedOutProcessing( $row, $i ); + + if ( $acl->acl_check( 'administration', 'manage', 'users', $my->usertype, 'components', 'com_users' ) ) { + if ( $row->created_by_alias ) { + $author = $row->created_by_alias; + } else { + $linkA = 'index2.php?option=com_users&task=editA&hidemainmenu=1&id='. $row->created_by; + $author = ''. $row->creator .''; + } + } else { + if ( $row->created_by_alias ) { + $author = $row->created_by_alias; + } else { + $author = $row->creator; + } + } + + $date = mosFormatDate( $row->created, '%x' ); + ?> + "> + + + + + + + + + + + + + + +
    + # + + + + Title + + Published + + Order + + Save Order + + Access + + ID + + Links + + Author + + Date +
    Start: Always
    Start: $row->publish_up
    Finish: No Expiry
    Finish: $row->publish_down
    + rowNumber( $i ); ?> + + + + checked_out && ( $row->checked_out != $my->id ) ) { + echo $row->title; + if ( $row->title_alias ) { + echo ' ('. $row->title_alias .')'; + } + } else { + ?> + + title; + if ( $row->title_alias ) { + echo ' ('. $row->title_alias .')'; + } + ?> + + + + ')"> + <?php echo $alt; ?> + + + + + > + groupname;?> + + + id;?> + + links;?> + + + + +
    + + getListFooter(); ?> + + + + + + +
    + getNullDate(); + + if ( $row->created != $nullDate ) { + $create_date = mosFormatDate( $row->created, '%A, %d %B %Y %H:%M', '0' ); + } + if ( $row->modified != $nullDate ) { + $mod_date = mosFormatDate( $row->modified, '%A, %d %B %Y %H:%M', '0' ); + } + + $tabs = new mosTabs( 1 ); + // used to hide "Reset Hits" when hits = 0 + if ( !$row->hits ) { + $visibility = "style='display: none; visibility: hidden;'"; + } else { + $visibility = ""; + } + + mosCommonHTML::loadOverlib(); + mosCommonHTML::loadCalendar(); + ?> + + + + + + +
    + Static Content Item: + + id ? 'Edit' : 'New';?> + +
    + +
    + + + + + + +
    + + + + + + + + + + + + + + + +
    + Item Details +
    + Title: + + +
    + Title Alias: + + +
    + Text: (required)
    + introtext, 'introtext', '100%;', '500', '75', '50' ); + ?> +
    +
    + startPane("content-pane"); + $tabs->startTab("Publishing","publish-page"); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Publishing Info +
    + State: + + state > 0 ? 'Published' : 'Draft Unpublished'; ?> +
    + Published: + + state ? 'checked="checked"' : ''; ?> /> +
    + Access Level: + + +
    + Author Alias: + + +
    + Change Creator: + + +
    + Override Created Date + + + +
    + Start Publishing: + + + +
    + Finish Publishing: + + + +
    +
    + + id ) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Content ID: + + id; ?> +
    + State + + state > 0 ? 'Published' : ($row->state < 0 ? 'Archived' : 'Draft Unpublished');?> +
    + Hits + + hits;?> +
    > + +
    +
    + Version + + version;?> times +
    + Created + + + New document + +
    + Last Modified + + + Not modified + +
    + modifier; + } + ?> +
    + Expires + + publish_down";?> +
    + endTab(); + $tabs->startTab("Images","images-page"); + ?> + + + + + + + + + + + + + + +
    + MOSImage Control +
    + + + + + + +
    +
    + Gallery Images: +
    + +
    +
    + +
    + +
    +
    + Content Images: +
    + +
    + + +
    +
    + Sub-folder: +
    +
    + Sample Image:
    + +
    +
    +
    + Active Image:
    + +
    +
    + Edit the image selected: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Source + + +
    + Align + + +
    + Alt Text + + +
    + Border + + +
    + Caption: + + +
    + Caption Position: + + +
    + Caption Align: + + +
    + Width: + + +
    + +
    +
    + endTab(); + $tabs->startTab("Parameters","params-page"); + ?> + + + + + + + +
    + Parameter Control +
    + render();?> +
    + endTab(); + $tabs->startTab("Meta Info","metadata-page"); + ?> + + + + + + + + + + +
    + Meta Data +
    + Description:
    + +
    + Keywords:
    + +
    + endTab(); + $tabs->startTab("Link to Menu","link-page"); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + Link to Menu +
    + This will create a 'Link - Static Content' in the menu you select +

    +
    + Select a Menu + + +
    + Menu Item Name + + +
    + + +
    + Existing Menu Links +
    + None +
    +
    + endTab(); + $tabs->endPane(); + ?> +
    + + + + + + +
    + \ No newline at end of file diff -urN joomla-1.0.7/administrator/components/com_typedcontent/admin.typedcontent.php joomla-1.0.10/administrator/components/com_typedcontent/admin.typedcontent.php --- joomla-1.0.7/administrator/components/com_typedcontent/admin.typedcontent.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_typedcontent/admin.typedcontent.php 2006-06-25 16:54:05.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); -$id = mosGetParam( $_REQUEST, 'id', '' ); $cid = mosGetParam( $_POST, 'cid', array(0) ); if (!is_array( $cid )) { $cid = array(0); } - switch ( $task ) { case 'cancel': cancel( $option ); @@ -38,7 +36,7 @@ break; case 'editA': - edit( $cid[0], $option ); + edit( intval( $cid[0] ), $option ); break; case 'go2menu': @@ -63,15 +61,15 @@ break; case 'accesspublic': - changeAccess( $cid[0], 0, $option ); + changeAccess( intval( $cid[0] ), 0, $option ); break; case 'accessregistered': - changeAccess( $cid[0], 1, $option ); + changeAccess( intval( $cid[0] ), 1, $option ); break; case 'accessspecial': - changeAccess( $cid[0], 2, $option ); + changeAccess( intval( $cid[0] ), 2, $option ); break; case 'saveorder': @@ -90,10 +88,10 @@ function view( $option ) { global $database, $mainframe, $mosConfig_list_limit; - $filter_authorid = $mainframe->getUserStateFromRequest( "filter_authorid{$option}", 'filter_authorid', 0 ); + $filter_authorid = intval( $mainframe->getUserStateFromRequest( "filter_authorid{$option}", 'filter_authorid', 0 ) ); $order = $mainframe->getUserStateFromRequest( "zorder", 'zorder', 'c.ordering DESC' ); - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ) ); $search = $mainframe->getUserStateFromRequest( "search{$option}", 'search', '' ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); @@ -196,31 +194,36 @@ */ function edit( $uid, $option ) { global $database, $my, $mainframe; - global $mosConfig_absolute_path, $mosConfig_live_site; + global $mosConfig_absolute_path, $mosConfig_live_site, $mosConfig_offset; - $nullDate = $database->getNullDate(); $row = new mosContent( $database ); + $row->load( $uid ); - $lists = array(); + $lists = array(); + $nullDate = $database->getNullDate(); if ($uid) { - // load the row from the db table - $row->load( $uid ); - // fail if checked out not by 'me' if ($row->isCheckedOut( $my->id )) { mosErrorAlert( "The module ".$row->title." is currently being edited by another administrator" ); } $row->checkout( $my->id ); + if (trim( $row->images )) { $row->images = explode( "\n", $row->images ); } else { $row->images = array(); } - if (trim( $row->publish_down ) == $nullDate) { - $row->publish_down = "Never"; + + $row->created = mosFormatDate( $row->created, _CURRENT_SERVER_TIME_FORMAT ); + $row->modified = $row->modified == $nullDate ? '' : mosFormatDate( $row->modified, _CURRENT_SERVER_TIME_FORMAT ); + $row->publish_up = mosFormatDate( $row->publish_up, _CURRENT_SERVER_TIME_FORMAT ); + + if (trim( $row->publish_down ) == $nullDate || trim( $row->publish_down ) == '' || trim( $row->publish_down ) == '-' ) { + $row->publish_down = 'Never'; } + $row->publish_down = mosFormatDate( $row->publish_down, _CURRENT_SERVER_TIME_FORMAT ); $query = "SELECT name" . "\n FROM #__users" @@ -229,12 +232,17 @@ $database->setQuery( $query ); $row->creator = $database->loadResult(); - $query = "SELECT name" - . "\n FROM #__users" - . "\n WHERE id = $row->modified_by" - ; - $database->setQuery( $query ); - $row->modifier = $database->loadResult(); + // test to reduce unneeded query + if ( $row->created_by == $row->modified_by ) { + $row->modifier = $row->creator; + } else { + $query = "SELECT name" + . "\n FROM #__users" + . "\n WHERE id = $row->modified_by" + ; + $database->setQuery( $query ); + $row->modifier = $database->loadResult(); + } // get list of links to this item $and = "\n AND componentid = ". $row->id; @@ -244,11 +252,12 @@ $row->version = 0; $row->state = 1; $row->images = array(); - $row->publish_up = date( "Y-m-d", time() ); - $row->publish_down = "Never"; + $row->publish_up = date( 'Y-m-d H:i:s', time() + ( $mosConfig_offset * 60 * 60 ) ); + $row->publish_down = 'Never'; $row->sectionid = 0; $row->catid = 0; $row->creator = ''; + $row->modified = $nullDate; $row->modifier = ''; $row->ordering = 0; $menus = array(); @@ -294,11 +303,11 @@ * Saves the typed content item */ function save( $option, $task ) { - global $database, $my; + global $database, $my, $mosConfig_offset; - $nullDate = $database->getNullDate(); - $menu = mosGetParam( $_POST, 'menu', 'mainmenu' ); - $menuid = mosGetParam( $_POST, 'menuid', 0 ); + $nullDate = $database->getNullDate(); + $menu = strval( mosGetParam( $_POST, 'menu', 'mainmenu' ) ); + $menuid = intval( mosGetParam( $_POST, 'menuid', 0 ) ); $row = new mosContent( $database ); if (!$row->bind( $_POST )) { @@ -306,16 +315,33 @@ exit(); } - if ( $row->id ) { - $row->modified = date( 'Y-m-d H:i:s' ); - $row->modified_by = $my->id; - } else { - $row->created = date( 'Y-m-d H:i:s' ); - $row->created_by = $row->created_by ? $row->created_by : $my->id; + if ($row->id) { + $row->modified = date( 'Y-m-d H:i:s' ); + $row->modified_by = $my->id; } - if (trim( $row->publish_down ) == 'Never') { + + $row->created_by = $row->created_by ? $row->created_by : $my->id; + + if ($row->created && strlen(trim( $row->created )) <= 10) { + $row->created .= ' 00:00:00'; + } + $row->created = $row->created ? mosFormatDate( $row->created, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset ) : date( 'Y-m-d H:i:s' ); + + if (strlen(trim( $row->publish_up )) <= 10) { + $row->publish_up .= ' 00:00:00'; + } + $row->publish_up = mosFormatDate($row->publish_up, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset ); + + if (trim( $row->publish_down ) == 'Never' || trim( $row->publish_down ) == '') { $row->publish_down = $nullDate; + } else { + if (strlen(trim( $row->publish_down )) <= 10) { + $row->publish_down .= ' 00:00:00'; + } + $row->publish_down = mosFormatDate( $row->publish_down, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset ); } + + $row->state = intval( mosGetParam( $_REQUEST, 'published', 0 ) ); // Save Parameters $params = mosGetParam( $_POST, 'params', '' ); @@ -330,8 +356,6 @@ // code cleaner for xhtml transitional compliance $row->introtext = str_replace( '
    ', '
    ', $row->introtext ); - $row->state = mosGetParam( $_REQUEST, 'published', 0 ); - $row->title = ampReplace( $row->title ); if (!$row->check()) { @@ -343,6 +367,9 @@ exit(); } $row->checkin(); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); switch ( $task ) { case 'go2menu': @@ -399,6 +426,9 @@ echo "\n"; exit(); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $msg = $total ." Item(s) sent to the Trash"; mosRedirect( 'index2.php?option='. $option, $msg ); @@ -439,6 +469,9 @@ $row = new mosContent( $database ); $row->checkin( $cid[0] ); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); if ( $state == "1" ) { $msg = $total ." Item(s) successfully Published"; @@ -465,6 +498,9 @@ if ( !$row->store() ) { return $row->getError(); } + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); mosRedirect( 'index2.php?option='. $option ); } @@ -502,9 +538,11 @@ function menuLink( $option, $id ) { global $database; - $menu = mosGetParam( $_POST, 'menuselect', '' ); - $link = mosGetParam( $_POST, 'link_name', '' ); + $menu = strval( mosGetParam( $_POST, 'menuselect', '' ) ); + $link = strval( mosGetParam( $_POST, 'link_name', '' ) ); + $link = stripslashes( ampReplace($link) ); + $row = new mosMenu( $database ); $row->menutype = $menu; $row->name = $link; @@ -524,6 +562,9 @@ } $row->checkin(); $row->updateOrder( "menutype='$row->menutype' AND parent='$row->parent'" ); + + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); $msg = $link .' (Link - Static Content) in menu: '. $menu .' successfully created'; mosRedirect( 'index2.php?option='. $option .'&task=edit&hidemainmenu=1&id='. $id, $msg ); @@ -537,7 +578,7 @@ $row->bind( $_POST ); $row->checkin(); - $menu = mosGetParam( $_POST, 'menu', 'mainmenu' ); + $menu = strval( mosGetParam( $_POST, 'menu', 'mainmenu' ) ); mosRedirect( 'index2.php?option=com_menus&menutype='. $menu ); } @@ -550,8 +591,8 @@ $row->bind( $_POST ); $row->checkin(); - $menu = mosGetParam( $_POST, 'menu', 'mainmenu' ); - $id = mosGetParam( $_POST, 'menuid', 0 ); + $menu = strval( mosGetParam( $_POST, 'menu', 'mainmenu' ) ); + $id = intval( mosGetParam( $_POST, 'menuid', 0 ) ); mosRedirect( 'index2.php?option=com_menus&menutype='. $menu .'&task=edit&hidemainmenu=1&id='. $id ); } @@ -591,6 +632,9 @@ $row->updateOrder( $cond[1] ); } // foreach + // clean any existing cache files + mosCache::cleanCache( 'com_content' ); + $msg = 'New ordering saved'; mosRedirect( 'index2.php?option=com_typedcontent', $msg ); } // saveOrder diff -urN joomla-1.0.7/administrator/components/com_users/admin.users.html.php joomla-1.0.10/administrator/components/com_users/admin.users.html.php --- joomla-1.0.7/administrator/components/com_users/admin.users.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_users/admin.users.html.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ - lastvisitDate, "%Y-%m-%d %H:%M:%S" ); ?> + lastvisitDate, _CURRENT_SERVER_TIME_FORMAT ); ?> id; ?> @@ -207,11 +207,11 @@ - + Name: - - + + @@ -219,7 +219,7 @@ Username: - + diff -urN joomla-1.0.7/administrator/components/com_users/admin.users.php joomla-1.0.10/administrator/components/com_users/admin.users.php --- joomla-1.0.7/administrator/components/com_users/admin.users.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_users/admin.users.php 2006-06-25 16:54:03.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'admin_html' ) ); require_once( $mainframe->getPath( 'class' ) ); -$task = mosGetParam( $_REQUEST, 'task' ); $cid = mosGetParam( $_REQUEST, 'cid', array( 0 ) ); -$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); if (!is_array( $cid )) { $cid = array ( 0 ); } @@ -44,7 +42,12 @@ case 'save': case 'apply': - saveUser( $option, $task ); + // check to see if functionality restricted for use as demo site + if ( $_VERSION->RESTRICT == 1 ) { + mosRedirect( 'index2.php?mosmsg=Functionality Restricted' ); + } else { + saveUser( $task ); + } break; case 'remove': @@ -52,7 +55,12 @@ break; case 'block': - changeUserBlock( $cid, 1, $option ); + // check to see if functionality restricted for use as demo site + if ( $_VERSION->RESTRICT == 1 ) { + mosRedirect( 'index2.php?mosmsg=Functionality Restricted' ); + } else { + changeUserBlock( $cid, 1, $option ); + } break; case 'unblock': @@ -85,9 +93,9 @@ global $database, $mainframe, $my, $acl, $mosConfig_list_limit; $filter_type = $mainframe->getUserStateFromRequest( "filter_type{$option}", 'filter_type', 0 ); - $filter_logged = $mainframe->getUserStateFromRequest( "filter_logged{$option}", 'filter_logged', 0 ); - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ); + $filter_logged = intval( $mainframe->getUserStateFromRequest( "filter_logged{$option}", 'filter_logged', 0 ) ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ) ); $search = $mainframe->getUserStateFromRequest( "search{$option}", 'search', '' ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); $where = array(); @@ -213,7 +221,7 @@ } $my_group = strtolower( $acl->get_group_name( $row->gid, 'ARO' ) ); - if ( $my_group == 'super administrator' ) { + if ( $my_group == 'super administrator' && $my->gid != 25 ) { $lists['gid'] = 'Super Administrator'; } else if ( $my->gid == 24 && $row->gid == 24 ) { $lists['gid'] = 'Administrator'; @@ -252,11 +260,12 @@ HTML_users::edituser( $row, $contact, $lists, $option, $uid, $params ); } -function saveUser( $option, $task ) { +function saveUser( $task ) { global $database, $my; global $mosConfig_live_site, $mosConfig_mailfrom, $mosConfig_fromname, $mosConfig_sitename; $row = new mosUser( $database ); + if (!$row->bind( $_POST )) { echo "\n"; exit(); @@ -277,6 +286,9 @@ } $row->registerDate = date( 'Y-m-d H:i:s' ); } else { + $original = new mosUser( $database ); + $original->load( $row->id ); + // existing user stuff if ($row->password == '') { // password set to null if empty @@ -284,8 +296,33 @@ } else { $row->password = md5( $row->password ); } + + // if group has been changed and where original group was a Super Admin + if ( $row->gid != $original->gid && $original->gid == 25 ) { + // count number of active super admins + $query = "SELECT COUNT( id )" + . "\n FROM #__users" + . "\n WHERE gid = 25" + . "\n AND block = 0" + ; + $database->setQuery( $query ); + $count = $database->loadResult(); + + if ( $count <= 1 ) { + // disallow change if only one Super Admin exists + echo "\n"; + exit(); + } + } } + // if user is made a Super Admin group and user is NOT a Super Admin + if ( $row->gid == 25 && $my->gid != 25 ) { + // disallow creation of Super Admin by non Super Admin users + echo "\n"; + exit(); + } + // save usertype to usetype column $query = "SELECT name" . "\n FROM #__core_acl_aro_groups" @@ -366,9 +403,18 @@ $adminName = $admin->name; $adminEmail = $admin->email; } + mosMail( $adminEmail, $adminName, $row->email, $subject, $message ); } + if (!$isNew) { + // if group has been changed + if ( $original->gid != $row->gid ) { + // delete user acounts active sessions + logoutUser( $row->id, 'com_users', 'change' ); + } + } + switch ( $task ) { case 'apply': $msg = 'Successfully Saved changes to User: '. $row->name; @@ -405,15 +451,37 @@ // check for a super admin ... can't delete them $groups = $acl->get_object_groups( 'users', $id, 'ARO' ); $this_group = strtolower( $acl->get_group_name( $groups[0], 'ARO' ) ); - if ( $this_group == 'super administrator' ) { + if ( $this_group == 'super administrator' && $my->gid != 25 ) { $msg = "You cannot delete a Super Administrator"; } else if ( $id == $my->id ){ $msg = "You cannot delete Yourself!"; } else if ( ( $this_group == 'administrator' ) && ( $my->gid == 24 ) ){ $msg = "You cannot delete another `Administrator` only `Super Administrators` have this power"; } else { - $obj->delete( $id ); - $msg = $obj->getError(); + $obj->load( $id ); + $count = 2; + if ( $obj->gid == 25 ) { + // count number of active super admins + $query = "SELECT COUNT( id )" + . "\n FROM #__users" + . "\n WHERE gid = 25" + . "\n AND block = 0" + ; + $database->setQuery( $query ); + $count = $database->loadResult(); + } + + if ( $count <= 1 && $obj->gid == 25 ) { + // cannot delete Super Admin where it is the only one that exists + $msg = "You cannot delete this Super Administrator as it is the only active Super Administrator for your site"; + } else { + // delete user + $obj->delete( $id ); + $msg = $obj->getError(); + + // delete user acounts active sessions + logoutUser( $id, 'com_users', 'remove' ); + } } } } @@ -447,6 +515,14 @@ echo "\n"; exit(); } + + // if action is to block a user + if ( $block == 1 ) { + foreach( $cid as $id ) { + // delete user acounts active sessions + logoutUser( $id, 'com_users', 'block' ); + } + } mosRedirect( 'index2.php?option='. $option ); } @@ -496,6 +572,12 @@ mosRedirect( 'index2.php', $database->getErrorMsg() ); break; + case 'remove': + case 'block': + case 'change': + return; + break; + default: mosRedirect( 'index2.php?option='. $option, $database->getErrorMsg() ); break; diff -urN joomla-1.0.7/administrator/components/com_weblinks/admin.weblinks.php joomla-1.0.10/administrator/components/com_weblinks/admin.weblinks.php --- joomla-1.0.7/administrator/components/com_weblinks/admin.weblinks.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/components/com_weblinks/admin.weblinks.php 2006-06-25 16:54:04.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'class' ) ); $cid = mosGetParam( $_POST, 'cid', array(0) ); -$id = mosGetParam( $_GET, 'id', 0 ); switch ($task) { case 'new': @@ -64,11 +63,11 @@ break; case 'orderup': - orderWeblinks( $cid[0], -1, $option ); + orderWeblinks( intval( $cid[0] ), -1, $option ); break; case 'orderdown': - orderWeblinks( $cid[0], 1, $option ); + orderWeblinks( intval( $cid[0] ), 1, $option ); break; default: @@ -83,9 +82,9 @@ function showWeblinks( $option ) { global $database, $mainframe, $mosConfig_list_limit; - $catid = $mainframe->getUserStateFromRequest( "catid{$option}", 'catid', 0 ); - $limit = $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ); - $limitstart = $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ); + $catid = intval( $mainframe->getUserStateFromRequest( "catid{$option}", 'catid', 0 ) ); + $limit = intval( $mainframe->getUserStateFromRequest( "viewlistlimit", 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( $mainframe->getUserStateFromRequest( "view{$option}limitstart", 'limitstart', 0 ) ); $search = $mainframe->getUserStateFromRequest( "search{$option}", 'search', '' ); $search = $database->getEscaped( trim( strtolower( $search ) ) ); @@ -137,7 +136,7 @@ * @param integer The unique id of the record to edit (0 if new) */ function editWeblink( $option, $id ) { - global $database, $my, $mosConfig_absolute_path, $mosConfig_live_site; + global $database, $my, $mosConfig_absolute_path; $lists = array(); @@ -157,7 +156,7 @@ $row->published = 1; $row->approved = 1; $row->order = 0; - $row->catid = mosGetParam( $_POST, 'catid', 0 ); + $row->catid = intval( mosGetParam( $_POST, 'catid', 0 ) ); } // build the html select list for ordering @@ -286,7 +285,9 @@ global $database; $row = new mosWeblink( $database ); $row->load( $uid ); + $row->updateOrder(); $row->move( $inc, "published >= 0" ); + $row->updateOrder(); mosRedirect( "index2.php?option=$option" ); } Binary files joomla-1.0.7/administrator/images/calendar.png and joomla-1.0.10/administrator/images/calendar.png differ Binary files joomla-1.0.7/administrator/images/calendar_f2.png and joomla-1.0.10/administrator/images/calendar_f2.png differ Binary files joomla-1.0.7/administrator/images/cut.png and joomla-1.0.10/administrator/images/cut.png differ Binary files joomla-1.0.7/administrator/images/cut_f2.png and joomla-1.0.10/administrator/images/cut_f2.png differ Binary files joomla-1.0.7/administrator/images/day.png and joomla-1.0.10/administrator/images/day.png differ Binary files joomla-1.0.7/administrator/images/day_f2.png and joomla-1.0.10/administrator/images/day_f2.png differ Binary files joomla-1.0.7/administrator/images/edittime.png and joomla-1.0.10/administrator/images/edittime.png differ Binary files joomla-1.0.7/administrator/images/edittime_f2.png and joomla-1.0.10/administrator/images/edittime_f2.png differ Binary files joomla-1.0.7/administrator/images/extensions.png and joomla-1.0.10/administrator/images/extensions.png differ Binary files joomla-1.0.7/administrator/images/extensions_f2.png and joomla-1.0.10/administrator/images/extensions_f2.png differ Binary files joomla-1.0.7/administrator/images/file.png and joomla-1.0.10/administrator/images/file.png differ Binary files joomla-1.0.7/administrator/images/file_f2.png and joomla-1.0.10/administrator/images/file_f2.png differ Binary files joomla-1.0.7/administrator/images/folder_add.png and joomla-1.0.10/administrator/images/folder_add.png differ Binary files joomla-1.0.7/administrator/images/folder_add_f2.png and joomla-1.0.10/administrator/images/folder_add_f2.png differ Binary files joomla-1.0.7/administrator/images/go.png and joomla-1.0.10/administrator/images/go.png differ Binary files joomla-1.0.7/administrator/images/go_f2.png and joomla-1.0.10/administrator/images/go_f2.png differ Binary files joomla-1.0.7/administrator/images/groups.png and joomla-1.0.10/administrator/images/groups.png differ Binary files joomla-1.0.7/administrator/images/groups_f2.png and joomla-1.0.10/administrator/images/groups_f2.png differ Binary files joomla-1.0.7/administrator/images/month.png and joomla-1.0.10/administrator/images/month.png differ Binary files joomla-1.0.7/administrator/images/month_f2.png and joomla-1.0.10/administrator/images/month_f2.png differ Binary files joomla-1.0.7/administrator/images/note.png and joomla-1.0.10/administrator/images/note.png differ Binary files joomla-1.0.7/administrator/images/note_f2.png and joomla-1.0.10/administrator/images/note_f2.png differ Binary files joomla-1.0.7/administrator/images/paste.png and joomla-1.0.10/administrator/images/paste.png differ Binary files joomla-1.0.7/administrator/images/paste_f2.png and joomla-1.0.10/administrator/images/paste_f2.png differ Binary files joomla-1.0.7/administrator/images/print.png and joomla-1.0.10/administrator/images/print.png differ Binary files joomla-1.0.7/administrator/images/print_f2.png and joomla-1.0.10/administrator/images/print_f2.png differ Binary files joomla-1.0.7/administrator/images/properties.png and joomla-1.0.10/administrator/images/properties.png differ Binary files joomla-1.0.7/administrator/images/properties_f2.png and joomla-1.0.10/administrator/images/properties_f2.png differ Binary files joomla-1.0.7/administrator/images/reload.png and joomla-1.0.10/administrator/images/reload.png differ Binary files joomla-1.0.7/administrator/images/reload_f2.png and joomla-1.0.10/administrator/images/reload_f2.png differ Binary files joomla-1.0.7/administrator/images/rename.png and joomla-1.0.10/administrator/images/rename.png differ Binary files joomla-1.0.7/administrator/images/rename_f2.png and joomla-1.0.10/administrator/images/rename_f2.png differ Binary files joomla-1.0.7/administrator/images/switch.png and joomla-1.0.10/administrator/images/switch.png differ Binary files joomla-1.0.7/administrator/images/switch_f2.png and joomla-1.0.10/administrator/images/switch_f2.png differ Binary files joomla-1.0.7/administrator/images/task.png and joomla-1.0.10/administrator/images/task.png differ Binary files joomla-1.0.7/administrator/images/task_f2.png and joomla-1.0.10/administrator/images/task_f2.png differ Binary files joomla-1.0.7/administrator/images/themes.png and joomla-1.0.10/administrator/images/themes.png differ Binary files joomla-1.0.7/administrator/images/themes_f2.png and joomla-1.0.10/administrator/images/themes_f2.png differ Binary files joomla-1.0.7/administrator/images/tool.png and joomla-1.0.10/administrator/images/tool.png differ Binary files joomla-1.0.7/administrator/images/tool_f2.png and joomla-1.0.10/administrator/images/tool_f2.png differ Binary files joomla-1.0.7/administrator/images/week.png and joomla-1.0.10/administrator/images/week.png differ Binary files joomla-1.0.7/administrator/images/week_f2.png and joomla-1.0.10/administrator/images/week_f2.png differ diff -urN joomla-1.0.7/administrator/includes/admin.php joomla-1.0.10/administrator/includes/admin.php --- joomla-1.0.7/administrator/includes/admin.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/includes/admin.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ get( 'rssurl', '' ); $rssitems = $params->get( 'rssitems', '' ); $rssdesc = $params->get( 'rssdesc', '' ); $moduleclass_sfx = $params->get( 'moduleclass_sfx', '' ); - + $rsscache = $params->get( 'rsscache', 3600 ); + $cachePath = $mosConfig_cachepath .'/'; + echo ''; if ($module->content) { @@ -140,8 +141,7 @@ // feed output if ( $rssurl ) { - $cacheDir = $mosConfig_absolute_path .'/cache/'; - if (!is_writable( $cacheDir )) { + if (!is_writable( $cachePath )) { echo ''; echo ''; echo ''; @@ -149,38 +149,55 @@ $LitePath = $mosConfig_absolute_path .'/includes/Cache/Lite.php'; require_once( $mosConfig_absolute_path .'/includes/domit/xml_domit_rss_lite.php'); $rssDoc = new xml_domit_rss_document_lite(); - $rssDoc->useCacheLite(true, $LitePath, $cacheDir, 3600); - $rssDoc->loadRSS( $rssurl ); - $totalChannels = $rssDoc->getChannelCount(); - - for ($i = 0; $i < $totalChannels; $i++) { - $currChannel =& $rssDoc->getChannel($i); - echo ''; - echo ''; - echo ''; - if ($rssdesc) { - echo ''; - echo ''; - echo ''; - } - - $actualItems = $currChannel->getItemCount(); - $setItems = $rssitems; - - if ($setItems > $actualItems) { - $totalItems = $actualItems; - } else { - $totalItems = $setItems; - } - - for ($j = 0; $j < $totalItems; $j++) { - $currItem =& $currChannel->getItem($j); + $rssDoc->useCacheLite(true, $LitePath, $cachePath, $rsscache); + $success = $rssDoc->loadRSS( $rssurl ); + + if ( $success ) { + $totalChannels = $rssDoc->getChannelCount(); + + for ($i = 0; $i < $totalChannels; $i++) { + $currChannel =& $rssDoc->getChannel($i); + + $feed_title = $currChannel->getTitle(); + $feed_title = mosCommonHTML::newsfeedEncoding( $rssDoc, $feed_title ); echo ''; - echo ''; + echo ''; echo ''; + + if ($rssdesc) { + $feed_descrip = $currChannel->getDescription(); + $feed_descrip = mosCommonHTML::newsfeedEncoding( $rssDoc, $feed_descrip ); + + echo ''; + echo ''; + echo ''; + } + + $actualItems = $currChannel->getItemCount(); + $setItems = $rssitems; + + if ($setItems > $actualItems) { + $totalItems = $actualItems; + } else { + $totalItems = $setItems; + } + + for ($j = 0; $j < $totalItems; $j++) { + $currItem =& $currChannel->getItem($j); + + $item_title = $currItem->getTitle(); + $item_title = mosCommonHTML::newsfeedEncoding( $rssDoc, $item_title ); + + $text = $currItem->getDescription(); + $text = mosCommonHTML::newsfeedEncoding( $rssDoc, $text ); + + echo ''; + echo ''; + echo ''; + } } } } diff -urN joomla-1.0.7/administrator/includes/auth.php joomla-1.0.10/administrator/includes/auth.php --- joomla-1.0.7/administrator/includes/auth.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/includes/auth.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ id = mosGetParam( $_SESSION, 'session_user_id', '' ); -$my->username = mosGetParam( $_SESSION, 'session_username', '' ); -$my->usertype = mosGetParam( $_SESSION, 'session_usertype', '' ); -$my->gid = mosGetParam( $_SESSION, 'session_gid', '' ); -$session_id = mosGetParam( $_SESSION, 'session_id', '' ); -$logintime = mosGetParam( $_SESSION, 'session_logintime', '' ); +$my->id = intval( mosGetParam( $_SESSION, 'session_user_id', '' ) ); +$my->username = strval( mosGetParam( $_SESSION, 'session_username', '' ) ); +$my->usertype = strval( mosGetParam( $_SESSION, 'session_usertype', '' ) ); +$my->gid = intval( mosGetParam( $_SESSION, 'session_gid', '' ) ); +$session_id = strval( mosGetParam( $_SESSION, 'session_id', '' ) ); +$logintime = strval( mosGetParam( $_SESSION, 'session_logintime', '' ) ); if ( $session_id != md5( $my->id.$my->username.$my->usertype.$logintime ) ) { mosRedirect( "index.php" ); diff -urN joomla-1.0.7/administrator/includes/menubar.html.php joomla-1.0.10/administrator/includes/menubar.html.php --- joomla-1.0.7/administrator/includes/menubar.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/includes/menubar.html.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ - - + id .'&Itemid='. $Itemid; ?> - @@ -186,7 +183,6 @@ - getTemplate(); $sitename = $mainframe->getCfg( 'sitename' ); - $hide_js = mosGetParam($_REQUEST,'hide_js', 0 ); + $hide_js = intval( mosGetParam($_REQUEST,'hide_js', 0 ) ); ?> - - - - - - "._E_EXPIRES." "; - $docinfo .= $row->publish_down."
    "; - $docinfo .= ""._E_VERSION." "; - $docinfo .= $row->version."
    "; - $docinfo .= ""._E_CREATED." "; - $docinfo .= $row->created."
    "; - $docinfo .= ""._E_LAST_MOD." "; - $docinfo .= $row->modified."
    "; - $docinfo .= ""._E_HITS." "; - $docinfo .= $row->hits."
    "; - ?> - - -
    Please make cache directory writable.
    '; - echo $currChannel->getTitle() .'
    '. $currChannel->getDescription() .'
    '; - echo $currItem->getTitle() .' - '. $currItem->getDescription() .''; + echo $feed_title .'
    '. $feed_descrip .'
    '; + echo $item_title .' - '. $text .'
    @@ -123,7 +123,7 @@ * @param string An override for the alt text */ function addNewX( $task='new', $alt='New' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'new_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'new_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -139,7 +139,7 @@ * @param string An override for the alt text */ function publish( $task='publish', $alt='Publish' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -155,7 +155,7 @@ * @param string An override for the alt text */ function publishList( $task='publish', $alt='Publish' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -171,7 +171,7 @@ * @param string An override for the alt text */ function makeDefault( $task='default', $alt='Default' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -187,7 +187,7 @@ * @param string An override for the alt text */ function assign( $task='assign', $alt='Assign' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'publish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -203,7 +203,7 @@ * @param string An override for the alt text */ function unpublish( $task='unpublish', $alt='Unpublish' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'unpublish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'unpublish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -219,7 +219,7 @@ * @param string An override for the alt text */ function unpublishList( $task='unpublish', $alt='Unpublish' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'unpublish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'unpublish_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -235,7 +235,7 @@ * @param string An override for the alt text */ function archiveList( $task='archive', $alt='Archive' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'archive_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'archive_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -251,7 +251,7 @@ * @param string An override for the alt text */ function unarchiveList( $task='unarchive', $alt='Unarchive' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'unarchive_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'unarchive_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -267,7 +267,7 @@ * @param string An override for the alt text */ function editList( $task='edit', $alt='Edit' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'edit_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'edit_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -284,7 +284,7 @@ * @param string An override for the alt text */ function editListX( $task='edit', $alt='Edit' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'edit_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'edit_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -300,7 +300,7 @@ * @param string An override for the alt text */ function editHtml( $task='edit_source', $alt='Edit HTML' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'html_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'html_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -317,7 +317,7 @@ * @param string An override for the alt text */ function editHtmlX( $task='edit_source', $alt='Edit HTML' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'html_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'html_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -333,7 +333,7 @@ * @param string An override for the alt text */ function editCss( $task='edit_css', $alt='Edit CSS' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'css_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'css_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -350,7 +350,7 @@ * @param string An override for the alt text */ function editCssX( $task='edit_css', $alt='Edit CSS' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'css_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'css_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -367,7 +367,7 @@ * @param string An override for the alt text */ function deleteList( $msg='', $task='remove', $alt='Delete' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -385,7 +385,7 @@ * @param string An override for the alt text */ function deleteListX( $msg='', $task='remove', $alt='Delete' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -399,7 +399,7 @@ * Write a trash button that will move items to Trash Manager */ function trash( $task='remove', $alt='Trash', $check=true ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'delete_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); if ( $check ) { $js = "javascript:if (document.adminForm.boxchecked.value == 0){ alert('Please make a selection from the list to Trash'); } else { submitbutton('$task');}"; @@ -422,14 +422,18 @@ */ function preview( $popup='', $updateEditors=false ) { global $database; - $image2 = mosAdminMenus::ImageCheckAdmin( 'preview_f2.png', '/administrator/images/', NULL, NULL, 'Preview', 'preview', 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'preview_f2.png', '/administrator/images/', NULL, NULL, 'Preview', 'preview', 1, 'middle', 'Preview' ); - $sql = "SELECT template FROM #__templates_menu WHERE client_id='0' AND menuid='0'"; + $sql = "SELECT template" + . "\n FROM #__templates_menu" + . "\n WHERE client_id = 0" + . "\n AND menuid = 0"; $database->setQuery( $sql ); - $cur_template = $database->loadResult(); + $cur_template = $database->loadResult(); ?> - @@ -454,7 +459,7 @@ */ function help( $ref, $com=false ) { global $mosConfig_live_site; - $image2 = mosAdminMenus::ImageCheckAdmin( 'help_f2.png', '/administrator/images/', NULL, NULL, 'Help', 'help', 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'help_f2.png', '/administrator/images/', NULL, NULL, 'Help', 'help', 1, 'middle', 'Help' ); $helpUrl = mosGetParam( $GLOBALS, 'mosConfig_helpurl', '' ); if ( $helpUrl == 'http://help.mamboserver.com' ) { @@ -464,7 +469,7 @@ if ($com) { // help file for 3PD Components $url = $mosConfig_live_site . '/administrator/components/' . $GLOBALS['option'] . '/help/'; - if (!eregi( '\.html$', $ref )) { + if (!eregi( '\.html$', $ref ) && !eregi( '\.xml$', $ref )) { $ref = $ref . '.html'; } $url .= $ref; @@ -475,7 +480,9 @@ } else { // Included html help files $url = $mosConfig_live_site . '/help/'; - $ref = $ref . '.html'; + if (!eregi( '\.html$', $ref ) && !eregi( '\.xml$', $ref )) { + $ref = $ref . '.html'; + } $url .= $ref; } ?> @@ -495,7 +502,7 @@ */ function apply( $task='apply', $alt='Apply' ) { $image = mosAdminMenus::ImageCheckAdmin( 'apply.png', '/administrator/images/', NULL, NULL, $alt, $task ); - $image2 = mosAdminMenus::ImageCheckAdmin( 'apply_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'apply_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -512,7 +519,7 @@ * @param string An override for the alt text */ function save( $task='save', $alt='Save' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'save_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'save_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -556,7 +563,7 @@ * @param string An override for the alt text */ function cancel( $task='cancel', $alt='Cancel' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'cancel_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'cancel_f2.png', '/administrator/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -571,7 +578,7 @@ * any other operation */ function back( $alt='Back', $href='' ) { - $image2 = mosAdminMenus::ImageCheckAdmin( 'back_f2.png', '/administrator/images/', NULL, NULL, 'back', 'cancel', 1 ); + $image2 = mosAdminMenus::ImageCheckAdmin( 'back_f2.png', '/administrator/images/', NULL, NULL, 'back', 'cancel', 1, 'middle', $alt ); if ( $href ) { $link = $href; } else { @@ -603,15 +610,9 @@ * @param string The sub-drectory to upload the media to */ function media_manager( $directory='', $alt='Upload' ) { - global $database; + global $database, $mainframe; - $query = "SELECT template" - . "\n FROM #__templates_menu" - . "\n WHERE client_id = 1" - . "\n AND menuid = 0" - ; - $database->setQuery( $query ); - $cur_template = $database->loadResult(); + $cur_template = $mainframe->getTemplate(); $image2 = mosAdminMenus::ImageCheckAdmin( 'upload_f2.png', '/administrator/images/', NULL, NULL, 'Upload Image', 'uploadPic', 1 ); ?> diff -urN joomla-1.0.7/administrator/index.php joomla-1.0.10/administrator/index.php --- joomla-1.0.7/administrator/index.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/index.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ SVN == 0) { define( '_INSTALL_CHECK', 1 ); - include ('../offline.php'); + include ($mosConfig_absolute_path .'/offline.php'); exit(); } -$option = mosGetParam( $_REQUEST, 'option', NULL ); +$option = strtolower( strval( mosGetParam( $_REQUEST, 'option', NULL ) ) ); // mainframe is an API workhorse, lots of 'core' interaction routines $mainframe = new mosMainFrame( $database, $option, '..', true ); if (isset( $_POST['submit'] )) { /** escape and trim to minimise injection of malicious sql */ - $usrname = $database->getEscaped( mosGetParam( $_POST, 'usrname', '' ) ); - $pass = $database->getEscaped( mosGetParam( $_POST, 'pass', '' ) ); + $usrname = $database->getEscaped( mosGetParam( $_POST, 'usrname', NULL ) ); + $pass = $database->getEscaped( mosGetParam( $_POST, 'pass', NULL ) ); - if (!$pass) { - echo "\n"; + if($pass == NULL) { + echo "\n"; + exit(); } else { $pass = md5( $pass ); } @@ -62,10 +63,12 @@ } $my = null; - $query = "SELECT *" - . "\n FROM #__users" - . "\n WHERE username = '$usrname'" - . "\n AND block = 0" + $query = "SELECT u.*, m.*" + . "\n FROM #__users AS u" + . "\n LEFT JOIN #__messages_cfg AS m ON u.id = m.user_id AND m.cfg_name = 'auto_purge'" + . "\n WHERE u.username = '$usrname'" + . "\n AND u.password = '$pass'" + . "\n AND u.block = 0" ; $database->setQuery( $query ); $database->loadObject( $my ); @@ -83,31 +86,126 @@ session_name( md5( $mosConfig_live_site ) ); session_start(); + // construct Session ID $logintime = time(); $session_id = md5( $my->id . $my->username . $my->usertype . $logintime ); + + // add Session ID entry to DB $query = "INSERT INTO #__session" . "\n SET time = '$logintime', session_id = '$session_id', userid = $my->id, usertype = '$my->usertype', username = '$my->username'" ; $database->setQuery( $query ); if (!$database->query()) { echo $database->stderr(); - } + } - $_SESSION['session_id'] = $session_id; - $_SESSION['session_user_id'] = $my->id; - $_SESSION['session_username'] = $my->username; - $_SESSION['session_usertype'] = $my->usertype; - $_SESSION['session_gid'] = $my->gid; - $_SESSION['session_logintime'] = $logintime; - $_SESSION['session_user_params']= $my->params; - $_SESSION['session_userstate'] = array(); + // check if site designated as a production site + // for a demo site allow multiple logins with same user account + if ( $_VERSION->SITE == 1 ) { + // delete other open admin sessions for same account + $query = "DELETE FROM #__session" + . "\n WHERE userid = $my->id" + . "\n AND username = '$my->username'" + . "\n AND usertype = '$my->usertype'" + . "\n AND session_id != '$session_id'" + // this ensures that frontend sessions are not purged + . "\n AND guest = 1" + . "\n AND gid = 0" + ; + $database->setQuery( $query ); + if (!$database->query()) { + echo $database->stderr(); + } + } + + $_SESSION['session_id'] = $session_id; + $_SESSION['session_user_id'] = $my->id; + $_SESSION['session_username'] = $my->username; + $_SESSION['session_usertype'] = $my->usertype; + $_SESSION['session_gid'] = $my->gid; + $_SESSION['session_logintime'] = $logintime; + $_SESSION['session_user_params'] = $my->params; + $_SESSION['session_userstate'] = array(); session_write_close(); + + $expired = 'index2.php'; + + // check if site designated as a production site + // for a demo site disallow expired page functionality + if ( $_VERSION->SITE == 1 && @$mosConfig_admin_expired === '1' ) { + $file = $mainframe->getPath( 'com_xml', 'com_users' ); + $params =& new mosParameters( $my->params, $file, 'component' ); + + $now = time(); + + // expired page functionality handling + $expired = $params->def( 'expired', '' ); + $expired_time = $params->def( 'expired_time', '' ); + + // if now expired link set or expired time is more than half the admin session life set, simply load normal admin homepage + $checktime = ( $mosConfig_session_life_admin ? $mosConfig_session_life_admin : 1800 ) / 2; + if (!$expired || ( ( $now - $expired_time ) > $checktime ) ) { + $expired = 'index2.php'; + } + // link must also be a Joomla link to stop malicious redirection + if ( strpos( $expired, 'index2.php?option=com_' ) !== 0 ) { + $expired = 'index2.php'; + } + + // clear any existing expired page data + $params->set( 'expired', '' ); + $params->set( 'expired_time', '' ); + + // param handling + if (is_array( $params->toArray() )) { + $txt = array(); + foreach ( $params->toArray() as $k=>$v) { + $txt[] = "$k=$v"; + } + $saveparams = implode( "\n", $txt ); + } + + // save cleared expired page info to user data + $query = "UPDATE #__users" + . "\n SET params = '$saveparams'" + . "\n WHERE id = $my->id" + . "\n AND username = '$my->username'" + . "\n AND usertype = '$my->usertype'" + ; + $database->setQuery( $query ); + $database->query(); + } + + // check if auto_purge value set + if ( $my->cfg_name == 'auto_purge' ) { + $purge = $my->cfg_value; + } else { + // if no value set, default is 7 days + $purge = 7; + } + // calculation of past date + $past = date( 'Y-m-d H:i:s', time() - $purge * 60 * 60 * 24 ); + + // if purge value is not 0, then allow purging of old messages + if ($purge != 0) { + // purge old messages at day set in message configuration + $query = "DELETE FROM #__messages" + . "\n WHERE date_time < '$past'" + . "\n AND user_id_to = $my->id" + ; + $database->setQuery( $query ); + if (!$database->query()) { + echo $database->stderr(); + } + } + /** cannot using mosredirect as this stuffs up the cookie in IIS */ - echo "\n"; + // redirects page to admin homepage by default or expired page + echo "\n"; exit(); } else { - mosErrorAlert("Incorrect Username, Password. Please try again", "document.location.href='index.php'"); + mosErrorAlert("Incorrect Username, Password. Please try again", "document.location.href='index.php?mosmsg=Incorrect Username, Password. Please try again'"); } } else { initGzip(); @@ -115,4 +213,4 @@ require_once( $path ); doGzip(); } -?> +?> \ No newline at end of file diff -urN joomla-1.0.7/administrator/index2.php joomla-1.0.10/administrator/index2.php --- joomla-1.0.7/administrator/index2.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/index2.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ initSessionAdmin( $option, $task ); // initialise some common request directives -$task = mosGetParam( $_REQUEST, 'task', '' ); -$act = strtolower( mosGetParam( $_REQUEST, 'act', '' ) ); -$section = mosGetParam( $_REQUEST, 'section', '' ); -$no_html = strtolower( mosGetParam( $_REQUEST, 'no_html', '' ) ); -$id = intval( mosGetParam( $_REQUEST, 'id' ) ); +$act = strtolower( mosGetParam( $_REQUEST, 'act', '' ) ); +$section = mosGetParam( $_REQUEST, 'section', '' ); +$no_html = intval( mosGetParam( $_REQUEST, 'no_html', 0 ) ); +$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); -if ($option == 'logout') { - require 'logout.php'; - exit(); -} +$cur_template = $mainframe->getTemplate(); -// restore some session variables -$my = new mosUser( $database ); -$my->id = mosGetParam( $_SESSION, 'session_user_id', '' ); -$my->username = mosGetParam( $_SESSION, 'session_username', '' ); -$my->usertype = mosGetParam( $_SESSION, 'session_usertype', '' ); -$my->gid = mosGetParam( $_SESSION, 'session_gid', '' ); -$my->params = mosGetParam( $_SESSION, 'session_user_params', '' ); -$session_id = mosGetParam( $_SESSION, 'session_id', '' ); -$logintime = mosGetParam( $_SESSION, 'session_logintime', '' ); - -// check against db record of session -if ( $session_id == md5( $my->id . $my->username . $my->usertype . $logintime ) ) { - $query = "SELECT *" - . "\n FROM #__session" - . "\n WHERE session_id = '$session_id'" - . "\n AND username = " . $database->Quote( $my->username ) - . "\n AND userid = " . intval( $my->id ) - ; - $database->setQuery( $query ); - if (!$result = $database->query()) { - echo $database->stderr(); - } - if ($database->getNumRows( $result ) != 1) { - echo "\n"; - exit(); - } -} else { - echo "\n"; - exit(); +// default admin homepage +if ($option == '') { + $option = 'com_admin'; } -// update session timestamp -$current_time = time(); -$query = "UPDATE #__session" -. "\n SET time = '$current_time'" -. "\n WHERE session_id = '$session_id'" -; -$database->setQuery( $query ); -$database->query(); - -// timeout old sessions -$past = time()-1800; -$query = "DELETE FROM #__session" -. "\n WHERE time < '$past'" -; -$database->setQuery( $query ); -$database->query(); - -$cur_template = $mainframe->getTemplate(); - // set for overlib check $mainframe->set( 'loadOverlib', false ); // precapture the output of the component require_once( $mosConfig_absolute_path . '/editor/editor.php' ); - ob_start(); if ($path = $mainframe->getPath( 'admin' )) { require_once ( $path ); @@ -132,5 +84,19 @@ mosMainBody_Admin(); } +// displays queries performed for page +if ($mosConfig_debug) { + echo $database->_ticker . ' queries executed'; + echo '
    ';
    +	foreach ($database->_log as $k=>$sql) {
    +		echo $k+1 . "\n" . $sql . '
    '; + } +} + doGzip(); + +// if task action is 'save' or 'apply' redo session check +if ( $task == 'save' || $task == 'apply' ) { + $mainframe->initSessionAdmin( $option, '' ); +} ?> \ No newline at end of file diff -urN joomla-1.0.7/administrator/index3.php joomla-1.0.10/administrator/index3.php --- joomla-1.0.7/administrator/index3.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/index3.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ initSessionAdmin( $option, $task ); // initialise some common request directives -$task = mosGetParam( $_REQUEST, 'task', '' ); $act = strtolower( mosGetParam( $_REQUEST, 'act', '' ) ); $section = mosGetParam( $_REQUEST, 'section', '' ); -$mosmsg = strip_tags( mosGetParam( $_REQUEST, 'mosmsg', '' ) ); -$no_html = strtolower( mosGetParam( $_REQUEST, 'no_html', '' ) ); - -if ($option == 'logout') { - require 'logout.php'; - exit(); -} - -// restore some session variables -$my = new mosUser( $database ); -$my->id = mosGetParam( $_SESSION, 'session_user_id', '' ); -$my->username = mosGetParam( $_SESSION, 'session_username', '' ); -$my->usertype = mosGetParam( $_SESSION, 'session_usertype', '' ); -$my->gid = mosGetParam( $_SESSION, 'session_gid', '' ); - -$session_id = mosGetParam( $_SESSION, 'session_id', '' ); -$logintime = mosGetParam( $_SESSION, 'session_logintime', '' ); - -// check against db record of session -if ( $session_id == md5( $my->id . $my->username . $my->usertype . $logintime ) ) { - $query = "SELECT *" - . "\n FROM #__session" - . "\n WHERE session_id = '$session_id'" - . "\n AND username = '" . $database->getEscaped( $my->username ) . "'" - . "\n AND userid = " . intval( $my->id ) - ; - $database->setQuery( $query ); - if (!$result = $database->query()) { - echo $database->stderr(); - } - if ($database->getNumRows( $result ) != 1) { - echo "\n"; - exit(); - } -} else { - echo "\n"; - exit(); -} - -// update session timestamp -$current_time = time(); -$query = "UPDATE #__session" -. "\n SET time = '$current_time'" -. "\n WHERE session_id = '$session_id'" -; -$database->setQuery( $query ); -$database->query(); - -// timeout old sessions -$past = time()-1800; -$query = "DELETE FROM #__session" -. "\n WHERE time < '$past'" -; -$database->setQuery( $query ); -$database->query(); +$mosmsg = strval( strip_tags( mosGetParam( $_REQUEST, 'mosmsg', '' ) ) ); +$no_html = mosGetParam( $_REQUEST, 'no_html', '' ); +$id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); // start the html output if ($no_html) { @@ -123,7 +74,6 @@ ?> - \ No newline at end of file diff -urN joomla-1.0.7/administrator/logout.php joomla-1.0.10/administrator/logout.php --- joomla-1.0.7/administrator/logout.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/logout.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ setQuery( $query ); - - if (!$database->query()) { - echo $database->stderr(); +// check to see if site is a production site +// allows multiple logins with same user for a demo site +if ( $_VERSION->SITE == 1 ) { + // update db user last visit record corresponding to currently logged in user + if ( isset( $_SESSION['session_user_id'] ) && $_SESSION['session_user_id'] != '' ) { + $currentDate = date( "Y-m-d\TH:i:s" ); + + $query = "UPDATE #__users" + . "\n SET lastvisitDate = '$currentDate'" + . "\n WHERE id = ". $_SESSION['session_user_id'] + ; + $database->setQuery( $query ); + + if (!$database->query()) { + echo $database->stderr(); + } } -} - -if ( isset( $_SESSION['session_id'] ) && $_SESSION['session_id'] != '' ) { - $query = "DELETE FROM #__session" - . "\n WHERE session_id = '". $_SESSION['session_id'] ."'" - ; - $database->setQuery( $query ); - if (!$database->query()) { - echo $database->stderr(); + + // delete db session record corresponding to currently logged in user + if ( isset( $_SESSION['session_id'] ) && $_SESSION['session_id'] != '' ) { + $query = "DELETE FROM #__session" + . "\n WHERE session_id = '". $_SESSION['session_id'] ."'" + ; + $database->setQuery( $query ); + + if (!$database->query()) { + echo $database->stderr(); + } } } @@ -43,6 +52,7 @@ $id = ''; $session_id = ''; +// destroy PHP session of currently logged in user session_unregister( 'session_id' ); session_unregister( 'session_user_id' ); session_unregister( 'session_username' ); @@ -64,5 +74,7 @@ if (session_is_registered( 'session_logintime' )) { session_destroy(); } + +// return to site homepage mosRedirect( '../index.php' ); ?> \ No newline at end of file diff -urN joomla-1.0.7/administrator/modules/custom.xml joomla-1.0.10/administrator/modules/custom.xml --- joomla-1.0.7/administrator/modules/custom.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/modules/custom.xml 2006-06-25 16:54:08.000000000 -0400 @@ -11,6 +11,11 @@ Custom Module + + + + + @@ -30,9 +35,6 @@ - - - - + diff -urN joomla-1.0.7/administrator/modules/mod_fullmenu.php joomla-1.0.10/administrator/modules/mod_fullmenu.php --- joomla-1.0.7/administrator/modules/mod_fullmenu.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/modules/mod_fullmenu.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ acl_check( 'administration', 'manage', 'users', $usertype, 'components', 'com_massmail' ); $canManageUsers = $acl->acl_check( 'administration', 'manage', 'users', $usertype, 'components', 'com_users' ); - $query = "SELECT a.id, a.title, a.name, COUNT( DISTINCT c.id ) AS numcat, COUNT( DISTINCT b.id ) AS numarc" + $query = "SELECT a.id, a.title, a.name" . "\n FROM #__sections AS a" - . "\n LEFT JOIN #__categories AS c ON c.section = a.id" - . "\n LEFT JOIN #__content AS b ON b.sectionid = a.id AND b.state = -1" . "\n WHERE a.scope = 'content'" . "\n GROUP BY a.id" . "\n ORDER BY a.ordering" ; $database->setQuery( $query ); $sections = $database->loadObjectList(); - $nonemptySections = 0; - if (count($sections) > 0) { - foreach ($sections as $section) { - if ($section->numcat > 0) { - $nonemptySections++; - } - } - } + $menuTypes = mosAdminMenus::menutypes(); ?>
    @@ -95,7 +86,6 @@ ['', 'Browser, OS, Domain', 'index2.php?option=com_statistics', null, 'Browser, OS, Domain'], - ['', 'Page Impressions', 'index2.php?option=com_statistics&task=pageimp', null, 'Page Impressions'], ['', 'Search Text', 'index2.php?option=com_statistics&task=searches', null, 'Search Text'] @@ -146,18 +136,10 @@ foreach ($sections as $section) { $txt = addslashes( $section->title ? $section->title : $section->name ); ?> ['','', null, null,'', -numcat) { -?> ['', ' Items', 'index2.php?option=com_content§ionid=id;?>',null,null], - ['', 'Add/Edit Categories', 'index2.php?option=com_categories§ion=id;?>',null, null], -numarc) { -?> ['', ' Archive', 'index2.php?option=com_content&task=showarchive§ionid=id;?>',null,null], - ], + ['', ' Items', 'index2.php?option=com_content§ionid=id;?>',null,null], + ['', ' Archives','index2.php?option=com_content&task=showarchive§ionid=id;?>',null,null], + ['', ' Categories', 'index2.php?option=com_categories§ion=id;?>',null, null], + ], ], @@ -173,6 +155,7 @@ _cmSplit, ['','Frontpage Manager','index2.php?option=com_frontpage',null,'Manage Frontpage Items'], ['','Archive Manager','index2.php?option=com_content&task=showarchive§ionid=0',null,'Manage Archive Items'], + ['', 'Page Impressions', 'index2.php?option=com_statistics&task=pageimp', null, 'Page Impressions'], ], usertype ); diff -urN joomla-1.0.7/administrator/modules/mod_mosmsg.php joomla-1.0.10/administrator/modules/mod_mosmsg.php --- joomla-1.0.7/administrator/modules/mod_mosmsg.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/modules/mod_mosmsg.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ 200 ) { + $mosmsg = substr( $mosmsg, 0, 200 ); + } ?>
    diff -urN joomla-1.0.7/administrator/templates/joomla_admin/cpanel.php joomla-1.0.10/administrator/templates/joomla_admin/cpanel.php --- joomla-1.0.7/administrator/templates/joomla_admin/cpanel.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/templates/joomla_admin/cpanel.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@
    -
    +
    diff -urN joomla-1.0.7/administrator/templates/joomla_admin/css/admin_login.css joomla-1.0.10/administrator/templates/joomla_admin/css/admin_login.css --- joomla-1.0.7/administrator/templates/joomla_admin/css/admin_login.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/templates/joomla_admin/css/admin_login.css 2006-06-25 16:54:08.000000000 -0400 @@ -1,5 +1,5 @@ /** -* @version $Id: admin_login.css 47 2005-09-15 02:55:27Z rhuk $ +* @version $Id: admin_login.css 3551 2006-05-18 20:23:01Z stingrey $ * @package Joomla * @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php @@ -132,3 +132,14 @@ .footer { } + +.message { + margin-top: 10px; + padding: 7px; + width: 400px; + border: 1px solid #B22222; + background: #F1F3F5; + color: #B22222; + font-weight: bold; + font-size: 13px; +} diff -urN joomla-1.0.7/administrator/templates/joomla_admin/index.php joomla-1.0.10/administrator/templates/joomla_admin/index.php --- joomla-1.0.7/administrator/templates/joomla_admin/index.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/administrator/templates/joomla_admin/index.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@
    +
    +
      - -  
    @@ -133,7 +131,6 @@ -
    + name; ?>
    - - - -
    - / id ? _E_EDIT : _E_ADD;?>  -     - - [Info] - -
    - - - - - - sectionid) { - ?> - - - - - - sectionid ) > 0) { - ?> - - - - - - - - - sectionid ) > 0) { - ?> - - - - - - - -
    -
    - -
    - -
    -
    - -
    -
    - -
    - -
    - : - - : -
    - introtext , 'introtext', '600', '400', '70', '15' ) ; - ?> -
    - : -
    - fulltext , 'fulltext', '600', '400', '70', '15' ) ; - ?> -
    - - - - startPane( 'content-pane' ); - $tabs->startTab( _E_IMAGES, 'images-page' ); - ?> - - - - - - - - - - - - - - - - - - - - - - -
    - :: -
    - - - - - - -
    - -
    - -
    - -
    - -
    - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - Caption: - - -
    - Caption Position: - - -
    - Caption Align: - - -
    - Caption Width: - - -
    - -
    -
    - No Image - - - No Image - -
    - endTab(); - $tabs->startTab( _E_PUBLISHING, 'publish-page' ); - ?> - - canPublish) { - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - -
    - - - -
    - - - -
    - - - -
    - - - - -
    - - - - -
    - - - frontpage ? 'checked="checked"' : ''; ?> /> -
    - endTab(); - $tabs->startTab( _E_METADATA, 'meta-page' ); - ?> - - - - - - - - - -
    - - - -
    - - - -
    - endTab(); - $tabs->endPane(); - ?> - -
    - - - - - - - - - - - - - setPageTitle( $mosConfig_sitename .' :: '. $title ); - $mainframe->addCustomHeadTag( '' ); - ?> - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - -
     
    - - - -
    - - - -
    - - - -
    - - - -
     
    - -    - -
    - - - -
    - setPageTitle( $mosConfig_sitename ); - $mainframe->addCustomHeadTag( '' ); - ?> -
    -
    -
    - - - - id; + } + + if ( $params->get( 'page_title' ) ) { + ?> +
    + name; ?> +
    + + + get('description') || $params->get('description_image') ) { + ?> + + + + + + + + + + +
    + get('description_image') && $title->image ) { + $link = $mosConfig_live_site .'/images/stories/'. $title->image; + ?> + <?php echo $title->image;?> + get('description') ) { + echo $title->description; + } + ?> +
    + +
    + +

    + canEdit || $access->canEditOwn ) && count( $other_categories ) > 0 ) { + $link = sefRelToAbs( 'index.php?option=com_content&task=new&sectionid='. $id .'&Itemid='. $Itemid ); + ?> + + <?php echo _CMN_NEW;?> +  ... +

    + +
    + 1 ) || ( count( $other_categories ) < 2 && count( $items ) < 1 ) ) ) { + if ( ( $params->get( 'type' ) == 'category' ) && $params->get( 'other_cat' ) ) { + HTML_content::showCategories( $params, $items, $gid, $other_categories, $catid, $id, $Itemid ); + } + if ( ( $params->get( 'type' ) == 'section' ) && $params->get( 'other_cat_section' ) ) { + HTML_content::showCategories( $params, $items, $gid, $other_categories, $catid, $id, $Itemid ); + } + } + ?> +
    + +
      + id ) { + ?> +
    • + access <= $gid ) { + $link = sefRelToAbs( 'index.php?option=com_content&task=category&sectionid='. $id .'&id='. $row->id .'&Itemid='. $Itemid ); + ?> + + name;?> + get( 'cat_items' ) ) { + ?> +  ( numitems; echo _CHECKED_IN_ITEMS;?> ) + get( 'cat_description' ) && $row->description ) { + ?> +
      + description; + } + } else { + echo $row->name; + ?> + + ( ) + +
    • + +
    + +
    + + get( 'filter' ) || $params->get( 'order_select' ) || $params->get( 'display' ) ) { + ?> + + + + get( 'headings' ) ) { + ?> + + get( 'date' ) ) { + ?> + + get( 'title' ) ) { + ?> + + get( 'author' ) ) { + ?> + + get( 'hits' ) ) { + ?> + + + + created = mosFormatDate ($row->created, $params->get( 'date_format' )); + + // calculate Itemid + HTML_content::_Itemid( $row ); + ?> + + get( 'date' ) ) { + ?> + + get( 'title' ) ) { + if( $row->access <= $gid ){ + $link = sefRelToAbs( 'index.php?option=com_content&task=view&id='. $row->id .'&Itemid='. $Itemid ); + ?> + + + + get( 'author' ) ) { + ?> + + get( 'hits' ) ) { + ?> + + + + get( 'navigation' ) ) { + ?> + + + + + + + + + + +
    + + + get( 'filter' ) ) { + ?> + + get( 'order_select' ) ) { + ?> + + get( 'display' ) ) { + ?> + + + +
    + + + + + + getLimitBox( $link ); + ?> +
    +
    + + + + + + + +
    + created; ?> + + + title; ?> + + + + title .' : '; + $link = sefRelToAbs( 'index.php?option=com_registration&task=register' ); + ?> + + + + + created_by_alias ? $row->created_by_alias : $row->author; ?> + + hits ? $row->hits : '-'; ?> +
     
    + writePagesLinks( $link ); + ?> +
    + writePagesCounter(); ?> +
    + + + + +
    + +
    + + + +
    + +
      + = $total ) { + // stops loop if total number of items is less than the number set to display as intro + leading + break; + } + + $_Itemid = $mainframe->getItemid( $rows[$i]->id, 0, 0 ); + + if ( $_Itemid && $_Itemid != 99999999 ) { + // where Itemid value is returned, do not add Itemid to url + $Itemid_link = '&Itemid='. $_Itemid; + } else { + // where Itemid value is NOT returned, do not add Itemid to url + $Itemid_link = ''; + } + + $link = sefRelToAbs( 'index.php?option=com_content&task=view&id='. $rows[$i]->id . $Itemid_link ) + ?> +
    • + + title; ?> +
    • + +
    + false, the print button links to a popup window. If true then the print button invokes the browser print method. + */ + function show( &$row, &$params, &$access, $page=0 ) { + global $mainframe, $hide_js; + global $mosConfig_live_site; + global $_MAMBOTS; + + $mainframe->appendMetaTag( 'description', $row->metadesc ); + $mainframe->appendMetaTag( 'keywords', $row->metakey ); + + // adds mospagebreak heading or title to Title + if ( isset($row->page_title) && $row->page_title ) { + $mainframe->setPageTitle( $row->title .' '. $row->page_title ); + } + + // calculate Itemid + HTML_content::_Itemid( $row ); + + // determines the link and `link text` of the readmore button & linked title + HTML_content::_linkInfo( $row, $params ); + + // link used by print button + $print_link = $mosConfig_live_site. '/index2.php?option=com_content&task=view&id=' . $row->id .'&pop=1&page='. $page . $row->Itemid_link; + + // process the new bots + $_MAMBOTS->loadBotGroup( 'content' ); + $results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, $page ), true ); + + if ( $params->get( 'item_title' ) || $params->get( 'pdf' ) || $params->get( 'print' ) || $params->get( 'email' ) ) { + ?> + + + + +
    + canEdit ) { + // edit icon when item title set to hide + ?> + + + + +
    + +
    + get( 'intro_only' ) ) { + $results = $_MAMBOTS->trigger( 'onAfterDisplayTitle', array( &$row, &$params, $page ) ); + echo trim( implode( "\n", $results ) ); + } + + $results = $_MAMBOTS->trigger( 'onBeforeDisplayContent', array( &$row, &$params, $page ) ); + echo trim( implode( "\n", $results ) ); + ?> + + + + + + + +
    + text ); + ?> +
    + +   + + trigger( 'onAfterDisplayContent', array( &$row, &$params, $page ) ); + echo trim( implode( "\n", $results ) ); + + // displays the next & previous buttons + HTML_content::Navigation ( $row, $params ); + + // displays close button in pop-up window + mosHTML::CloseButton ( $params, $hide_js ); + + // displays back button in pop-up window + mosHTML::BackButton ( $params, $hide_js ); + } + + /** + * calculate Itemid + */ + function _Itemid( &$row ) { + global $task, $Itemid, $mainframe; + + if ( $task != 'view' && $task != 'category' ) { + $row->_Itemid = $mainframe->getItemid( $row->id, 0, 0 ); + } else { + // when viewing a content item, it is not necessary to calculate the Itemid + $row->_Itemid = $Itemid; + } + + if ( $row->_Itemid && $row->_Itemid != 99999999 ) { + // where Itemid value is returned, do not add Itemid to url + $row->Itemid_link = '&Itemid='. $row->_Itemid; + } else { + // where Itemid value is NOT returned, do not add Itemid to url + $row->Itemid_link = ''; + } + } + + /** + * determines the link and `link text` of the readmore button & linked title + */ + function _linkInfo( &$row, &$params ) { + global $my; + + $row->link_on = ''; + $row->link_text = ''; + + if ($params->get( 'readmore' ) || $params->get( 'link_titles' )) { + if ( $params->get( 'intro_only' ) ) { + // checks if the item is a public or registered/special item + if ( $row->access <= $my->gid ) { + $row->link_on = sefRelToAbs( 'index.php?option=com_content&task=view&id=' . $row->id . $row->Itemid_link ); + + if ( isset($row->readmore) && @$row->readmore) { + // text for the readmore link + $row->link_text = _READ_MORE; + } + } else { + $row->link_on = sefRelToAbs( 'index.php?option=com_registration&task=register' ); + + if ( isset($row->readmore) && @$row->readmore ) { + // text for the readmore link if accessible only if registered + $row->link_text = _READ_MORE_REGISTER; + } + } + } + } + } + + /** + * Writes Title + */ + function Title( &$row, &$params, &$access ) { + if ( $params->get( 'item_title' ) ) { + if ( $params->get( 'link_titles' ) && $row->link_on != '' ) { + ?> + + + title;?> + + + + + title;?> + + + + + + + get( 'popup' ) ) { + return; + } + if ( $row->state < 0 ) { + return; + } + if ( !$access->canEdit && !( $access->canEditOwn && $row->created_by == $my->id ) ) { + return; + } + + mosCommonHTML::loadOverlib(); + + $link = 'index.php?option=com_content&task=edit&id='. $row->id . $row->Itemid_link .'&Returnid='. $row->_Itemid; + $image = mosAdminMenus::ImageCheck( 'edit.png', '/images/M_images/', NULL, NULL, _E_EDIT, _E_EDIT ); + + if ( $row->state == 0 ) { + $overlib = _CMN_UNPUBLISHED; + } else { + $overlib = _CMN_PUBLISHED; + } + $date = mosFormatDate( $row->created ); + $author = $row->created_by_alias ? $row->created_by_alias : $row->author; + + $overlib .= '
    '; + $overlib .= $row->groups; + $overlib .= '
    '; + $overlib .= $date; + $overlib .= '
    '; + $overlib .= $author; + ?> + + + get( 'pdf' ) && !$params->get( 'popup' ) && !$hide_js ) { + $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=640,height=480,directories=no,location=no'; + $link = $mosConfig_live_site. '/index2.php?option=com_content&do_pdf=1&id='. $row->id; + + if ( $params->get( 'icons' ) ) { + $image = mosAdminMenus::ImageCheck( 'pdf_button.png', '/images/M_images/', NULL, NULL, _CMN_PDF, _CMN_PDF ); + } else { + $image = _CMN_PDF .' '; + } + ?> + + + + + get( 'email' ) && !$params->get( 'popup' ) && !$hide_js ) { + $status = 'status=no,toolbar=no,scrollbars=yes,titlebar=no,menubar=no,resizable=yes,width=400,height=250,directories=no,location=no'; + + if ($task == 'view') { + $_Itemid = '&itemid='. $Itemid; + } else { + $_Itemid = ''; + } + + $link = $mosConfig_live_site .'/index2.php?option=com_content&task=emailform&id='. $row->id . $_Itemid; + + if ( $params->get( 'icons' ) ) { + $image = mosAdminMenus::ImageCheck( 'emailButton.png', '/images/M_images/', NULL, NULL, _CMN_EMAIL, _CMN_EMAIL ); + } else { + $image = ' '. _CMN_EMAIL; + } + ?> + + + + + get( 'section' ) || $params->get( 'category' ) ) { + ?> + + + get( 'section' ) || $params->get( 'category' ) ) { + ?> + + + get( 'section' ) ) { + ?> + + section; + // writes dash between section & Category Name when both are active + if ( $params->get( 'category' ) ) { + echo ' - '; + } + ?> + + get( 'category' ) ) { + ?> + + category; + ?> + + get( 'author' ) ) && ( $row->author != '' ) ) { + ?> + + + + created_by_alias ? $row->created_by_alias : $row->author ); ?> + +    + + + created ) != 0 ) { + $create_date = mosFormatDate( $row->created ); + } + + if ( $params->get( 'createdate' ) ) { + ?> + + + + + + get( 'url' ) && $row->urls ) { + ?> + + + + urls; ?> + + + toc) ) { + echo $row->toc; + } + } + + /** + * Writes Modified Date + */ + function ModifiedDate( &$row, &$params ) { + $mod_date = null; + + if ( intval( $row->modified ) != 0) { + $mod_date = mosFormatDate( $row->modified ); + } + + if ( ( $mod_date != '' ) && $params->get( 'modifydate' ) ) { + ?> + + + ( ) + + + get( 'readmore' ) ) { + if ( $params->get( 'intro_only' ) && $row->link_text ) { + ?> + + + + link_text;?> + + + get( 'item_navigation' ) ) { + if ( $row->prev ) { + $row->prev = sefRelToAbs( $link_part . $row->prev . $row->Itemid_link ); + } else { + $row->prev = 0; + } + + if ( $row->next ) { + $row->next = sefRelToAbs( $link_part . $row->next . $row->Itemid_link ); + } else { + $row->next = 0; + } + } + + if ( $params->get( 'item_navigation' ) && ( $task == 'view' ) && !$params->get( 'popup' ) && ( $row->prev || $row->next ) ) { + ?> + + + prev ) { + ?> + + prev && $row->next ) { + ?> + + next ) { + ?> + + + +
    + + +   + + + + +
    + $row is passed with the id + * property set to 0. + * @param mosContent The category object + * @param string The html for the groups select list + */ + function editContent( &$row, $section, &$lists, &$images, &$access, $myid, $sectionid, $task, $Itemid ) { + global $mosConfig_live_site, $mainframe; + + mosMakeHtmlSafe( $row ); + + require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/HTML_toolbar.php' ); + + // used for spoof hardening + $validate = josSpoofValue(); + + $Returnid = intval( mosGetParam( $_REQUEST, 'Returnid', $Itemid ) ); + $tabs = new mosTabs(0, 1); + + $mainframe->addCustomHeadTag( '' ); + ?> + + + + + + + + + "._E_EXPIRES." "; + $docinfo .= $row->publish_down."
    "; + $docinfo .= ""._E_VERSION." "; + $docinfo .= $row->version."
    "; + $docinfo .= ""._E_CREATED." "; + $docinfo .= $row->created."
    "; + $docinfo .= ""._E_LAST_MOD." "; + $docinfo .= $row->modified."
    "; + $docinfo .= ""._E_HITS." "; + $docinfo .= $row->hits."
    "; + ?> +
    + + + + + +
    + / id ? _E_EDIT : _E_ADD;?>  +     + + [Info] + +
    + + + + + + sectionid) { + ?> + + + + + + sectionid ) > 0) { + ?> + + + + + + + + + sectionid ) > 0) { + ?> + + + + + + + +
    +
    + +
    + +
    +
    + +
    +
    + +
    + +
    + : + + : +
    + introtext , 'introtext', '600', '400', '70', '15' ) ; + ?> +
    + : +
    + fulltext , 'fulltext', '600', '400', '70', '15' ) ; + ?> +
    + + + + startPane( 'content-pane' ); + $tabs->startTab( _E_IMAGES, 'images-page' ); + ?> + + + + + + + + + + + + + + + + + + + + + + +
    + :: +
    + + + + + + +
    + +
    + +
    + +
    + +
    + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + : + + +
    + : + + +
    + : + + +
    + : + + +
    + + +
    +
    + <?php echo _E_NO_IMAGE; ?> + + + <?php echo _E_NO_IMAGE; ?> + +
    + endTab(); + $tabs->startTab( _E_PUBLISHING, 'publish-page' ); + ?> + + canPublish) { + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + +
    + + + + +
    + + + + +
    + + + frontpage ? 'checked="checked"' : ''; ?> /> +
    + endTab(); + $tabs->startTab( _E_METADATA, 'meta-page' ); + ?> + + + + + + + + + +
    + + + +
    + + + +
    + endTab(); + $tabs->endPane(); + ?> + +
    + + + + + + + + + + + + +
    + setPageTitle( $title ); + $mainframe->addCustomHeadTag( '' ); + ?> + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
     
    + + + +
    + + + +
    + + + +
    + + + +
     
    + +    + +
    + + + + +
    + setPageTitle( $mosConfig_sitename ); + $mainframe->addCustomHeadTag( '' ); + ?> +
    +
    +
    + + + + \ No newline at end of file diff -urN joomla-1.0.7/components/com_content/content.php joomla-1.0.10/components/com_content/content.php --- joomla-1.0.7/components/com_content/content.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_content/content.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ call( 'frontpage', $gid, $access, $pop, $now, $limit, $limitstart ); + $cache->call( 'frontpage', $gid, $access, $pop, 0, $limit, $limitstart ); return; } -switch ( strtolower( $task ) ) { +switch ( $task ) { case 'findkey': - findKeyItem( $gid, $access, $pop, $option, $now ); + findKeyItem( $gid, $access, $pop, $option, 0 ); break; case 'view': - showItem( $id, $gid, $access, $pop, $option, $now ); + showItem( $id, $gid, $access, $pop, $option, 0 ); break; case 'section': - $cache->call( 'showSection', $id, $gid, $access, $now ); + $cache->call( 'showSection', $id, $gid, $access, 0 ); break; case 'category': - $cache->call( 'showCategory', $id, $gid, $access, $sectionid, $limit, $order, $limitstart, $now ); + $selected = strval( mosGetParam( $_REQUEST, 'order', '' ) ); + $filter = strval( mosGetParam( $_REQUEST, 'filter', '' ) ); + + $cache->call( 'showCategory', $id, $gid, $access, $sectionid, $limit, NULL, $limitstart, 0, $selected, $filter ); break; case 'blogsection': - $cache->call('showBlogSection', $id, $gid, $access, $pop, $now, $limit, $limitstart ); + // Itemid is a dummy value to cater for caching + $cache->call('showBlogSection', $id, $gid, $access, $pop, $Itemid, $limit, $limitstart ); break; case 'blogcategorymulti': case 'blogcategory': - $cache->call( 'showBlogCategory', $id, $gid, $access, $pop, $now, $limit, $limitstart ); + // Itemid is a dummy value to cater for caching + $cache->call( 'showBlogCategory', $id, $gid, $access, $pop, $Itemid, $limit, $limitstart ); break; case 'archivesection': - showArchiveSection( $id, $gid, $access, $pop, $option ); + // Itemid is a dummy value to cater for caching + $cache->call( 'showArchiveSection', $id, $gid, $access, $pop, $option, $year, $month, $Itemid ); break; case 'archivecategory': - showArchiveCategory( $id, $gid, $access, $pop, $option, $now ); + // Itemid is a dummy value to cater for caching + $cache->call( 'showArchiveCategory', $id, $gid, $access, $pop, $option, $year, $month, $module, $Itemid ); break; case 'edit': @@ -107,7 +114,6 @@ break; default: - //$cache->call('showBlogSection', 0, $gid, $access, $pop, $now ); header("HTTP/1.0 404 Not Found"); echo _NOT_EXIST; break; @@ -123,7 +129,8 @@ */ function findKeyItem( $gid, $access, $pop, $option, $now ) { global $database; - $keyref = mosGetParam( $_REQUEST, 'keyref', '' ); + + $keyref = strval( mosGetParam( $_REQUEST, 'keyref', '' ) ); $keyref = $database->getEscaped( $keyref ); $query = "SELECT id" @@ -132,49 +139,51 @@ ; $database->setQuery( $query ); $id = $database->loadResult(); + if ($id > 0) { - showItem( $id, $gid, $access, $pop, $option, $now ); + showItem( $id, $gid, $access, $pop, $option, 0 ); } else { - echo 'Key not found'; + echo _KEY_NOT_FOUND; } } function frontpage( $gid, &$access, $pop, $now ) { - global $database, $mainframe, $my, $Itemid; + global $database, $mainframe; - $nullDate = $database->getNullDate(); - $noauth = !$mainframe->getCfg( 'shownoauth' ); + $now = _CURRENT_SERVER_TIME; + $nullDate = $database->getNullDate(); + $noauth = !$mainframe->getCfg( 'shownoauth' ); // Parameters - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); - $orderby_sec = $params->def( 'orderby_sec', '' ); - $orderby_pri = $params->def( 'orderby_pri', '' ); // Ordering control - $order_sec = _orderby_sec( $orderby_sec ); - $order_pri = _orderby_pri( $orderby_pri ); - + $orderby_sec = $params->def( 'orderby_sec', '' ); + $orderby_pri = $params->def( 'orderby_pri', '' ); + $order_sec = _orderby_sec( $orderby_sec ); + $order_pri = _orderby_pri( $orderby_pri ); + + // voting control + $voting = $params->def( 'rating', '' ); + $voting = votingQuery($voting); + + $where = _where( 1, $access, $noauth, $gid, 0, $now, NULL, NULL, $params ); + $where = ( count( $where ) ? "\n WHERE ". implode( "\n AND ", $where ) : '' ); + // query records -// $query = "SELECT a.*, ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" $query = "SELECT a.id, a.title, a.title_alias, a.introtext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by," . "\n a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access, a.hits," - . "\n CHAR_LENGTH( a.fulltext ) AS readmore," - . "\n ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . "\n CHAR_LENGTH( a.fulltext ) AS readmore, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . $voting['select'] . "\n FROM #__content AS a" . "\n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n INNER JOIN #__sections AS s ON s.id = a.sectionid" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" - . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" - . "\n WHERE a.state = 1" - . ( $noauth ? "\n AND a.access <= $my->gid" : '' ) - . "\n AND ( publish_up = '$nullDate' OR publish_up <= '$now' )" - . "\n AND ( publish_down = '$nullDate' OR publish_down >= '$now' )" - . "\n AND s.published = 1" - . "\n AND cc.published = 1" + . $voting['join'] + . $where . "\n ORDER BY $order_pri $order_sec" ; $database->setQuery( $query ); @@ -190,14 +199,32 @@ function showSection( $id, $gid, &$access, $now ) { global $database, $mainframe, $Itemid; + $section = new mosSection( $database ); + $section->load( $id ); + + /* + Check if section is published + */ + if(!$section->published) { + mosNotAuth(); + return; + } + /* + * check whether section access level allows access + */ + if( $section->access > $gid ) { + mosNotAuth(); + return; + } + + $now = _CURRENT_SERVER_TIME; $nullDate = $database->getNullDate(); $noauth = !$mainframe->getCfg( 'shownoauth' ); // Paramters $params = new stdClass(); if ( $Itemid ) { - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); } else { $menu = ''; @@ -206,28 +233,39 @@ } $orderby = $params->get( 'orderby', '' ); - $params->set( 'type', 'section' ); - - $params->def( 'page_title', 1 ); - $params->def( 'pageclass_sfx', '' ); - $params->def( 'other_cat_section', 1 ); - $params->def( 'empty_cat_section', 0 ); - $params->def( 'other_cat', 1 ); - $params->def( 'empty_cat', 0 ); - $params->def( 'cat_items', 1 ); - $params->def( 'cat_description', 1 ); - $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); - $params->def( 'pageclass_sfx', '' ); + $params->set( 'type', 'section' ); + $params->def( 'page_title', 1 ); + $params->def( 'pageclass_sfx', '' ); + $params->def( 'description_sec', 1 ); + $params->def( 'description_sec_image', 1 ); + $params->def( 'other_cat_section', 1 ); + $params->def( 'empty_cat_section', 0 ); + $params->def( 'other_cat', 1 ); + $params->def( 'empty_cat', 0 ); + $params->def( 'cat_items', 1 ); + $params->def( 'cat_description', 1 ); + $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); + $params->def( 'pageclass_sfx', '' ); + // param controls whether unpublished items visible to publishers and above + $params->def( 'unpublished', 1 ); + // Ordering control $orderby = _orderby_sec( $orderby ); - $section = new mosSection( $database ); - $section->load( $id ); - + // Description & Description Image control + $params->def( 'description', $params->get( 'description_sec' ) ); + $params->def( 'description_image', $params->get( 'description_sec_image' ) ); + if ( $access->canEdit ) { $xwhere = ''; - $xwhere2 = "\n AND b.state >= 0"; + if ( $params->get( 'unpublished' ) ) { + // shows unpublished items for publishers and above + $xwhere2 = "\n AND b.state >= 0"; + } else { + // unpublished items NOT shown for publishers and above + $xwhere2 = "\n AND b.state = 1"; + } } else { $xwhere = "\n AND a.published = 1"; $xwhere2 = "\n AND b.state = 1" @@ -251,19 +289,19 @@ } } - $access = ''; + $access_check = ''; if ($noauth) { - $access = "\n AND a.access <= $gid"; + $access_check = "\n AND a.access <= $gid"; } - // Main Query + // Query of categories within section $query = "SELECT a.*, COUNT( b.id ) AS numitems" . "\n FROM #__categories AS a" . "\n LEFT JOIN #__content AS b ON b.catid = a.id" . $xwhere2 . "\n WHERE a.section = '$section->id'" . $xwhere - . $access + . $access_check . "\n GROUP BY a.id" . $empty . $empty_sec @@ -271,6 +309,9 @@ ; $database->setQuery( $query ); $categories = $database->loadObjectList(); + + // remove slashes + $section->name = stripslashes($section->name); // Dynamic Page Title $mainframe->SetPageTitle( $menu->name ); @@ -288,79 +329,126 @@ * @param int The number of items to dislpay * @param int The offset for pagination */ -function showCategory( $id, $gid, &$access, $sectionid, $limit, $selected, $limitstart, $now ) { +function showCategory( $id, $gid, &$access, $sectionid, $limit, $selected, $limitstart, $now, $selected, $filter ) { global $database, $mainframe, $Itemid, $mosConfig_list_limit; + + $category = new mosCategory( $database ); + $category->load( $id ); + + /* + Check if category is published + */ + if(!$category->published) { + mosNotAuth(); + return; + } + /* + * check whether category access level allows access + */ + if( $category->access > $gid ) { + mosNotAuth(); + return; + } - $nullDate = $database->getNullDate(); - $noauth = !$mainframe->getCfg( 'shownoauth' ); + $section = new mosSection( $database ); + $section->load( $category->section ); + + /* + Check if category is published + */ + if(!$section->published) { + mosNotAuth(); + return; + } + /* + * check whether section access level allows access + */ + if( $section->access > $gid ) { + mosNotAuth(); + return; + } + + $now = _CURRENT_SERVER_TIME; + $nullDate = $database->getNullDate(); + $noauth = !$mainframe->getCfg( 'shownoauth' ); // Paramters $params = new stdClass(); if ( $Itemid ) { - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); } else { $menu = ''; $params = new mosParameters( '' ); } + $lists['order_value'] = ''; if ( $selected ) { - $orderby = $selected; + $orderby = $selected; + $lists['order_value'] = $selected; } else { - $orderby = $params->get( 'orderby', 'rdate' ); - $selected = $orderby; + $orderby = $params->get( 'orderby', 'rdate' ); + $selected = $orderby; } $params->set( 'type', 'category' ); - $params->def( 'page_title', 1 ); - $params->def( 'title', 1 ); - $params->def( 'hits', $mainframe->getCfg( 'hits' ) ); - $params->def( 'author', !$mainframe->getCfg( 'hideAuthor' ) ); - $params->def( 'date', !$mainframe->getCfg( 'hideCreateDate' ) ); - $params->def( 'date_format', _DATE_FORMAT_LC ); - $params->def( 'navigation', 2 ); - $params->def( 'display', 1 ); - $params->def( 'display_num', $mosConfig_list_limit ); - $params->def( 'other_cat', 1 ); - $params->def( 'empty_cat', 0 ); - $params->def( 'cat_items', 1 ); - $params->def( 'cat_description', 0 ); - $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); - $params->def( 'pageclass_sfx', '' ); - $params->def( 'headings', 1 ); - $params->def( 'order_select', 1 ); - $params->def( 'filter', 1 ); - $params->def( 'filter_type', 'title' ); + $params->def( 'description_cat', 1 ); + $params->def( 'description_cat_image', 1 ); + $params->def( 'page_title', 1 ); + $params->def( 'title', 1 ); + $params->def( 'hits', $mainframe->getCfg( 'hits' ) ); + $params->def( 'author', !$mainframe->getCfg( 'hideAuthor' ) ); + $params->def( 'date', !$mainframe->getCfg( 'hideCreateDate' ) ); + $params->def( 'date_format', _DATE_FORMAT_LC ); + $params->def( 'navigation', 2 ); + $params->def( 'display', 1 ); + $params->def( 'display_num', $mosConfig_list_limit ); + $params->def( 'other_cat', 1 ); + $params->def( 'empty_cat', 0 ); + $params->def( 'cat_items', 1 ); + $params->def( 'cat_description', 0 ); + $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); + $params->def( 'pageclass_sfx', '' ); + $params->def( 'headings', 1 ); + $params->def( 'order_select', 1 ); + $params->def( 'filter', 1 ); + $params->def( 'filter_type', 'title' ); + // param controls whether unpublished items visible to publishers and above + $params->def( 'unpublished', 1 ); // Ordering control $orderby = _orderby_sec( $orderby ); - $category = new mosCategory( $database ); - $category->load( $id ); - + // Description & Description Image control + $params->def( 'description', $params->get( 'description_cat' ) ); + $params->def( 'description_image', $params->get( 'description_cat_image' ) ); + if ( $sectionid == 0 ) { $sectionid = $category->section; } if ( $access->canEdit ) { $xwhere = ''; - $xwhere2 = "\n AND b.state >= 0"; + if ( $params->get( 'unpublished' ) ) { + // shows unpublished items for publishers and above + $xwhere2 = "\n AND b.state >= 0"; + } else { + // unpublished items NOT shown for publishers and above + $xwhere2 = "\n AND b.state = 1"; + } } else { $xwhere = "\n AND c.published = 1"; $xwhere2 = "\n AND b.state = 1" - . "\n AND ( publish_up = '$nullDate' OR publish_up <= '$now' )" - . "\n AND ( publish_down = '$nullDate' OR publish_down >= '$now' )" + . "\n AND ( b.publish_up = '$nullDate' OR b.publish_up <= '$now' )" + . "\n AND ( b.publish_down = '$nullDate' OR b.publish_down >= '$now' )" ; } $pagetitle = ''; if ( $Itemid ) { - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); $pagetitle = $menu->name; - } // if + } // show/hide empty categories $empty = ''; @@ -385,30 +473,36 @@ // get the total number of published items in the category // filter functionality - $filter = mosGetParam( $_POST, 'filter', '' ); - $filter = strtolower( $filter ); - $and = ''; - if ( $filter ) { - if ( $params->get( 'filter' ) ) { + $and = null; + if ( $params->get( 'filter' ) ) { + if ( $filter ) { + // clean filter variable + $filter = strtolower( $filter ); + switch ( $params->get( 'filter_type' ) ) { case 'title': $and = "\n AND LOWER( a.title ) LIKE '%$filter%'"; break; - + case 'author': $and = "\n AND ( ( LOWER( u.name ) LIKE '%$filter%' ) OR ( LOWER( a.created_by_alias ) LIKE '%$filter%' ) )"; break; - + case 'hits': $and = "\n AND a.hits LIKE '%$filter%'"; break; } } - } if ( $access->canEdit ) { - $xwhere = "\n AND a.state >= 0"; + if ( $params->get( 'unpublished' ) ) { + // shows unpublished items for publishers and above + $xwhere = "\n AND a.state >= 0"; + } else { + // unpublished items NOT shown for publishers and above + $xwhere = "\n AND a.state = 1"; + } } else { $xwhere = "\n AND a.state = 1" . "\n AND ( publish_up = '$nullDate' OR publish_up <= '$now' )" @@ -430,8 +524,11 @@ $database->setQuery( $query ); $counter = $database->loadObjectList(); $total = $counter[0]->numitems; + $limit = $limit ? $limit : $params->get( 'display_num' ) ; - if ( $total <= $limit ) $limitstart = 0; + if ( $total <= $limit ) { + $limitstart = 0; + } require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php' ); $pageNav = new mosPageNav( $total, $limitstart, $limit ); @@ -447,9 +544,8 @@ . "\n AND $category->access <= $gid" . $and . "\n ORDER BY $orderby" - . "\n LIMIT $limitstart, $limit" ; - $database->setQuery( $query ); + $database->setQuery( $query, $limitstart, $limit ); $items = $database->loadObjectList(); $check = 0; @@ -480,9 +576,12 @@ $params->set( 'order_select', 0 ); } - $lists['task'] = 'category'; - $lists['filter'] = $filter; + $lists['task'] = 'category'; + $lists['filter'] = $filter; + // remove slashes + $category->name = stripslashes($category->name); + // Dynamic Page Title $mainframe->SetPageTitle( $pagetitle ); @@ -493,13 +592,16 @@ function showBlogSection( $id=0, $gid, &$access, $pop, $now=NULL ) { global $database, $mainframe, $Itemid; + // needed for check whether section is published + $check = ( $id ? $id : 0 ); + + $now = _CURRENT_SERVER_TIME; $noauth = !$mainframe->getCfg( 'shownoauth' ); // Parameters $params = new stdClass(); if ( $Itemid ) { - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); } else { $menu = ""; @@ -511,7 +613,8 @@ $id = $params->def( 'sectionid', 0 ); } - $where = _where( 1, $access, $noauth, $gid, $id, $now ); + $where = _where( 1, $access, $noauth, $gid, $id, $now, NULL, NULL, $params ); + $where = ( count( $where ) ? "\n WHERE ". implode( "\n AND ", $where ) : '' ); // Ordering control $orderby_sec = $params->def( 'orderby_sec', 'rdate' ); @@ -519,22 +622,22 @@ $order_sec = _orderby_sec( $orderby_sec ); $order_pri = _orderby_pri( $orderby_pri ); + // voting control + $voting = $params->def( 'rating', '' ); + $voting = votingQuery($voting); + // Main data query - //$query = "SELECT a.*, ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, cc.name AS category, g.name AS groups" $query = "SELECT a.id, a.title, a.title_alias, a.introtext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by," . "\n a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access," - . "\n CHAR_LENGTH( a.fulltext ) AS readmore," - . "\n ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . "\n CHAR_LENGTH( a.fulltext ) AS readmore, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . $voting['select'] . "\n FROM #__content AS a" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" - . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__sections AS s ON a.sectionid = s.id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" - . ( count( $where ) ? "\n WHERE ".implode( "\n AND ", $where ) : '' ) - . "\n AND s.access <= $gid" - . "\n AND s.published = 1" - . "\n AND cc.published = 1" + . $voting['join'] + . $where . "\n ORDER BY $order_pri $order_sec" ; $database->setQuery( $query ); @@ -545,19 +648,43 @@ $mainframe->setPageTitle( $menu->name ); } + // check whether section is published + if (!count($rows) && $check) { + $secCheck = new mosSection( $database ); + $secCheck->load( $check ); + + /* + * check whether section is published + */ + if (!$secCheck->published) { + mosNotAuth(); + return; + } + /* + * check whether section access level allows access + */ + if ($secCheck->access > $gid) { + mosNotAuth(); + return; + } + } + BlogOutput( $rows, $params, $gid, $access, $pop, $menu ); } function showBlogCategory( $id=0, $gid, &$access, $pop, $now ) { global $database, $mainframe, $Itemid; + $now = _CURRENT_SERVER_TIME; $noauth = !$mainframe->getCfg( 'shownoauth' ); + // needed for check whether section & category is published + $check = ( $id ? $id : 0 ); + // Paramters $params = new stdClass(); if ( $Itemid ) { - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); } else { $menu = ''; @@ -569,55 +696,92 @@ $id = $params->def( 'categoryid', 0 ); } - $where = _where( 2, $access, $noauth, $gid, $id, $now ); + $where = _where( 2, $access, $noauth, $gid, $id, $now, NULL, NULL, $params ); + $where = ( count( $where ) ? "\n WHERE ". implode( "\n AND ", $where ) : '' ); // Ordering control $orderby_sec = $params->def( 'orderby_sec', 'rdate' ); $orderby_pri = $params->def( 'orderby_pri', '' ); $order_sec = _orderby_sec( $orderby_sec ); $order_pri = _orderby_pri( $orderby_pri ); - + + // voting control + $voting = $params->def( 'rating', '' ); + $voting = votingQuery($voting); + // Main data query - //$query = "SELECT a.*, ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, g.name AS groups, cc.name AS category" $query = "SELECT a.id, a.title, a.title_alias, a.introtext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by," . "\n a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access," - . "\n CHAR_LENGTH( a.fulltext ) AS readmore," - . "\n ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . "\n CHAR_LENGTH( a.fulltext ) AS readmore, s.published AS sec_pub, cc.published AS sec_pub, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . $voting['select'] . "\n FROM #__content AS a" . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" - . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__sections AS s ON a.sectionid = s.id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" - . ( count( $where ) ? "\n WHERE ".implode( "\n AND ", $where ) : '' ) - . "\n AND s.access <= $gid" - . "\n AND s.published = 1" - . "\n AND cc.published = 1" + . $voting['join'] + . $where . "\n ORDER BY $order_pri $order_sec" ; $database->setQuery( $query ); $rows = $database->loadObjectList(); + // check whether section & category is published + if (!count($rows) && $check) { + $catCheck = new mosCategory( $database ); + $catCheck->load( $check ); + + /* + * check whether category is published + */ + if (!$catCheck->published) { + mosNotAuth(); + return; + } + /* + * check whether category access level allows access + */ + if( $catCheck->access > $gid ) { + mosNotAuth(); + return; + } + + $secCheck = new mosSection( $database ); + $secCheck->load( $catCheck->section ); + + /* + * check whether section is published + */ + if (!$secCheck->published) { + mosNotAuth(); + return; + } + /* + * check whether category access level allows access + */ + if( $secCheck->access > $gid ) { + mosNotAuth(); + return; + } + } + // Dynamic Page Title $mainframe->SetPageTitle( $menu->name ); BlogOutput( $rows, $params, $gid, $access, $pop, $menu ); } -function showArchiveSection( $id=NULL, $gid, &$access, $pop, $option ) { +function showArchiveSection( $id=NULL, $gid, &$access, $pop, $option, $year, $month ) { global $database, $mainframe; global $Itemid; + $secID = ( $id ? $id : 0 ); + $noauth = !$mainframe->getCfg( 'shownoauth' ); - // Paramters - $year = mosGetParam( $_REQUEST, 'year', date( 'Y' ) ); - $month = mosGetParam( $_REQUEST, 'month', date( 'm' ) ); - $params = new stdClass(); if ( $Itemid ) { - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); } else { $menu = ""; @@ -636,7 +800,8 @@ // used in query $where = _where( -1, $access, $noauth, $gid, $id, NULL, $year, $month ); - + $where = ( count( $where ) ? "\n WHERE ". implode( "\n AND ", $where ) : '' ); + // checks to see if 'All Sections' options used if ( $id == 0 ) { $check = ''; @@ -652,28 +817,49 @@ $database->setQuery( $query ); $items = $database->loadObjectList(); $archives = count( $items ); - + + // voting control + $voting = $params->def( 'rating', '' ); + $voting = votingQuery($voting); + // Main Query - //$query = "SELECT a.*, ROUND(v.rating_sum/v.rating_count) AS rating, v.rating_count, u.name AS author, u.usertype, cc.name AS category, g.name AS groups" $query = "SELECT a.id, a.title, a.title_alias, a.introtext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by," . "\n a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access," - . "\n CHAR_LENGTH( a.fulltext ) AS readmore," - . "\n ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . "\n CHAR_LENGTH( a.fulltext ) AS readmore, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . $voting['select'] . "\n FROM #__content AS a" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" - . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__sections AS s ON a.sectionid = s.id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" - . ( count( $where ) ? "\n WHERE ". implode( "\n AND ", $where ) : '') - . "\n AND s.access <= $gid" - . "\n AND s.published = 1" - . "\n AND cc.published = 1" + . $voting['join'] + . $where . "\n ORDER BY $order_pri $order_sec" ; $database->setQuery( $query ); $rows = $database->loadObjectList(); + // check whether section is published + if (!count($rows) && $secID != 0) { + $secCheck = new mosSection( $database ); + $secCheck->load( $secID ); + + /* + * check whether section is published + */ + if (!$secCheck->published) { + mosNotAuth(); + return; + } + /* + * check whether section access level allows access + */ + if ($secCheck->access > $gid) { + mosNotAuth(); + return; + } + } + // initiate form $link = 'index.php?option=com_content&task=archivesection&id='. $id .'&Itemid='. $Itemid; echo '
    '; @@ -696,16 +882,16 @@ } -function showArchiveCategory( $id=0, $gid, &$access, $pop, $option, $now ) { +function showArchiveCategory( $id=0, $gid, &$access, $pop, $option, $year, $month, $module ) { global $database, $mainframe; global $Itemid; - // Parameters + $now = _CURRENT_SERVER_TIME; $noauth = !$mainframe->getCfg( 'shownoauth' ); - $year = mosGetParam( $_REQUEST, 'year', date( 'Y' ) ); - $month = mosGetParam( $_REQUEST, 'month', date( 'm' ) ); - $module = mosGetParam( $_REQUEST, 'module', '' ); - + + // needed for check whether section & category is published + $catID = ( $id ? $id : 0 ); + // used by archive module if ( $module ) { $check = ''; @@ -714,8 +900,7 @@ } if ( $Itemid ) { - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); } else { $menu = ''; @@ -726,41 +911,82 @@ $params->set( 'month', $month ); // Ordering control - $orderby_sec = $params->def( 'orderby', 'rdate' ); - $order_sec = _orderby_sec( $orderby_sec ); + $orderby_sec = $params->def( 'orderby', 'rdate' ); + $order_sec = _orderby_sec( $orderby_sec ); // used in query $where = _where( -2, $access, $noauth, $gid, $id, NULL, $year, $month ); + $where = ( count( $where ) ? "\n WHERE ". implode( "\n AND ", $where ) : '' ); // query to determine if there are any archived entries for the category - $query = "SELECT a.id" + $query = "SELECT a.id" . "\n FROM #__content as a" . "\n WHERE a.state = -1" . $check ; $database->setQuery( $query ); - $items = $database->loadObjectList(); - $archives = count( $items ); - - //$query = "SELECT a.*, ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, g.name AS groups" + $items = $database->loadObjectList(); + $archives = count( $items ); + + // voting control + $voting = $params->def( 'rating', '' ); + $voting = votingQuery($voting); + + // main query $query = "SELECT a.id, a.title, a.title_alias, a.introtext, a.sectionid, a.state, a.catid, a.created, a.created_by, a.created_by_alias, a.modified, a.modified_by," . "\n a.checked_out, a.checked_out_time, a.publish_up, a.publish_down, a.images, a.urls, a.ordering, a.metakey, a.metadesc, a.access," - . "\n CHAR_LENGTH( a.fulltext ) AS readmore," - . "\n ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . "\n CHAR_LENGTH( a.fulltext ) AS readmore, u.name AS author, u.usertype, s.name AS section, cc.name AS category, g.name AS groups" + . $voting['select'] . "\n FROM #__content AS a" . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" - . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__sections AS s ON a.sectionid = s.id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" - . ( count( $where ) ? "\n WHERE ". implode( "\n AND ", $where ) : '' ) - . "\n AND s.access <= $gid" - . "\n AND s.published = 1" - . "\n AND cc.published = 1" + . $voting['join'] + . $where . "\n ORDER BY $order_sec" ; $database->setQuery( $query ); $rows = $database->loadObjectList(); + + // check whether section & category is published + if (!count($rows) && $catID != 0) { + $catCheck = new mosCategory( $database ); + $catCheck->load( $catID ); + + /* + * check whether category is published + */ + if (!$catCheck->published) { + mosNotAuth(); + return; + } + /* + * check whether category access level allows access + */ + if( $catCheck->access > $gid ) { + mosNotAuth(); + return; + } + + $secCheck = new mosSection( $database ); + $secCheck->load( $catCheck->section ); + + /* + * check whether section is published + */ + if (!$secCheck->published) { + mosNotAuth(); + return; + } + /* + * check whether category access level allows access + */ + if( $secCheck->access > $gid ) { + mosNotAuth(); + return; + } + } // initiate form $link = 'index.php?option=com_content&task=archivecategory&id='. $id .'&Itemid='. $Itemid; @@ -771,13 +997,14 @@ if ( !$archives ) { // if no archives for category, hides search and outputs empty message - echo '
    '. _CATEGORY_ARCHIVE_EMPTY .'
    '; + echo '
    '; + echo '
    '. _CATEGORY_ARCHIVE_EMPTY .'
    '; } else { // if coming from the Archive Module, the Archive Dropdown selector is not shown if ( $id ) { - BlogOutput( $rows, $params, $gid, $access, $pop, $menu, 1 ); + BlogOutput( $rows, $params, $gid, $access, $pop, $menu, 1, 1 ); } else { - BlogOutput( $rows, $params, $gid, $access, $pop, $menu, 0 ); + BlogOutput( $rows, $params, $gid, $access, $pop, $menu, 0, 1 ); } } @@ -789,7 +1016,7 @@ } -function BlogOutput ( &$rows, &$params, $gid, &$access, $pop, &$menu, $archive=NULL ) { +function BlogOutput ( &$rows, &$params, $gid, &$access, $pop, &$menu, $archive=NULL, $archive_page=NULL ) { global $mainframe, $Itemid, $task, $id, $option, $database, $mosConfig_live_site; // parameters @@ -813,25 +1040,20 @@ // needed for back button for page $back = $params->get( 'back_button', $mainframe->getCfg( 'back_button' ) ); // needed to disable back button for item - $params->set( 'back_button', 0 ); - $params->def( 'pageclass_sfx', '' ); - $params->set( 'intro_only', 1 ); + $params->set( 'back_button', 0 ); + $params->def( 'pageclass_sfx', '' ); + $params->set( 'intro_only', 1 ); $total = count( $rows ); // pagination support $limitstart = intval( mosGetParam( $_REQUEST, 'limitstart', 0 ) ); - $limit = $intro + $leading + $links; + $limit = $intro + $leading + $links; if ( $total <= $limit ) { $limitstart = 0; } $i = $limitstart; - // needed to reduce queries used by getItemid - $ItemidCount['bs'] = $mainframe->getBlogSectionCount(); - $ItemidCount['bc'] = $mainframe->getBlogCategoryCount(); - $ItemidCount['gbs'] = $mainframe->getGlobalBlogSectionCount(); - // used to display section/catagory description text and images // currently not supported in Archives if ( $menu && $menu->componentid && ( $descrip || $descrip_image ) ) { @@ -903,7 +1125,7 @@ break; } echo '
    '; - show( $rows[$i], $params, $gid, $access, $pop, $option, $ItemidCount ); + show( $rows[$i], $params, $gid, $access, $pop ); echo '
    '; $i++; } @@ -930,7 +1152,7 @@ // outputs either intro or only a link if ( $z < $intro ) { - show( $rows[$i], $params, $gid, $access, $pop, $option, $ItemidCount ); + show( $rows[$i], $params, $gid, $access, $pop ); } else { echo ''; echo ''; @@ -939,20 +1161,7 @@ echo ''; -// if ( !( ( $z + 1 ) % $columns ) || $columns == 1 ) { -// echo ''; -// } -// -// $i++; -// } -// -// // this is required to output a final closing tag when the number of items does not fully -// // fill the last row of output - a blank column is left -// if ( $intro % $columns ) { -// echo ''; -// } - - $i++; + $i++; // this is required to output a closing tag if one of the 3 conditions are met // 1. No of intro story output = number of columns @@ -978,7 +1187,7 @@ echo ''; echo ''; echo '
    '; - HTML_content::showLinks( $rows, $links, $total, $i, 1, $ItemidCount ); + HTML_content::showLinks( $rows, $links, $total, $i, 1 ); echo '
    '; echo ''; echo ''; @@ -989,25 +1198,47 @@ if ( ( $pagination == 2 ) && ( $total <= $limit ) ) { // not visible when they is no 'other' pages to display } else { + require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php' ); // get the total number of records $limitstart = $limitstart ? $limitstart : 0; - require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php' ); - $pageNav = new mosPageNav( $total, $limitstart, $limit ); + $pageNav = new mosPageNav( $total, $limitstart, $limit ); + + if ( $Itemid && $Itemid != 99999999 ) { + // where Itemid value is returned, do not add Itemid to url + $Itemid_link = '&Itemid='. $Itemid; + } else { + // where Itemid value is NOT returned, do not add Itemid to url + $Itemid_link = ''; + } + if ( $option == 'com_frontpage' ) { - $link = 'index.php?option=com_frontpage&Itemid='. $Itemid; - } else if ( $archive ) { - $year = $params->get( 'year' ); - $month = $params->get( 'month' ); - $link = 'index.php?option=com_content&task='. $task .'&id='. $id .'&Itemid='. $Itemid.'&year='. $year .'&month='. $month; + $link = 'index.php?option=com_frontpage'. $Itemid_link; + } else if ( $archive_page ) { + $year = $params->get( 'year' ); + $month = $params->get( 'month' ); + + if (!$archive) { + // used when access via archive module + $id = '&id=0'; + $module = '&module=1'; + } else { + // used when access via menu item + $id = '&id='. $id; + $module = ''; + } + + $link = 'index.php?option=com_content&task='. $task . $id . $Itemid_link .'&year='. $year .'&month='. $month . $module; } else { - $link = 'index.php?option=com_content&task='. $task .'&id='. $id .'&Itemid='. $Itemid; + $link = 'index.php?option=com_content&task='. $task .'&id='. $id . $Itemid_link; } + echo ''; echo ''; echo $pageNav->writePagesLinks( $link ); echo '

    '; echo ''; echo ''; + if ( $pagination_results ) { echo ''; echo ''; @@ -1031,30 +1262,35 @@ // Back Button $params->set( 'back_button', $back ); + mosHTML::BackButton ( $params ); } -function showItem( $uid, $gid, &$access, $pop, $option, $now ) { +function showItem( $uid, $gid, &$access, $pop, $option='com_content', $now ) { global $database, $mainframe, $Itemid; global $mosConfig_MetaTitle, $mosConfig_MetaAuthor; - $nullDate = $database->getNullDate(); + $now = _CURRENT_SERVER_TIME; + $nullDate = $database->getNullDate(); + if ( $access->canEdit ) { $xwhere = ''; } else { $xwhere = " AND ( a.state = 1 OR a.state = -1 )" - . "\n AND ( publish_up = '$nullDate' OR publish_up <= '$now' )" - . "\n AND ( publish_down = '$nullDate' OR publish_down >= '$now' )" + . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" + . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" ; } - $query = "SELECT a.*, ROUND(v.rating_sum/v.rating_count) AS rating, v.rating_count, u.name AS author, u.usertype, cc.name AS category, s.name AS section, g.name AS groups, s.published AS sec_pub, cc.published AS cat_pub" + // main query + $query = "SELECT a.*, u.name AS author, u.usertype, cc.name AS category, s.name AS section, g.name AS groups," + . "\n s.published AS sec_pub, cc.published AS cat_pub, s.access AS sec_access, cc.access AS cat_access," + . "\n s.id AS sec_id, cc.id as cat_id" . "\n FROM #__content AS a" . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" . "\n LEFT JOIN #__sections AS s ON s.id = cc.section AND s.scope = 'content'" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" - . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" . "\n LEFT JOIN #__groups AS g ON a.access = g.id" . "\n WHERE a.id = $uid" . $xwhere @@ -1064,16 +1300,34 @@ $row = NULL; if ( $database->loadObject( $row ) ) { + /* + * check whether category is published + */ if ( !$row->cat_pub && $row->catid ) { - // check whether category is published mosNotAuth(); return; } + /* + * check whether section is published + */ if ( !$row->sec_pub && $row->sectionid ) { - // check whether section is published mosNotAuth(); return; } + /* + * check whether category access level allows access + */ + if ( ($row->cat_access > $gid) && $row->catid ) { + mosNotAuth(); + return; + } + /* + * check whether section access level allows access + */ + if ( ($row->sec_access > $gid) && $row->sectionid ) { + mosNotAuth(); + return; + } $params = new mosParameters( $row->attribs ); $params->set( 'intro_only', 0 ); @@ -1087,8 +1341,7 @@ // loads the links for Next & Previous Button if ( $params->get( 'item_navigation' ) ) { // Paramters for menu item as determined by controlling Itemid - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $mparams = new mosParameters( $menu->params ); // the following is needed as different menu items types utilise a different param to control ordering @@ -1146,7 +1399,7 @@ $mainframe->addMetaTag( 'author' , $row->author ); } - show( $row, $params, $gid, $access, $pop, $option ); + show( $row, $params, $gid, $access, $pop ); } else { mosNotAuth(); return; @@ -1154,8 +1407,8 @@ } -function show( $row, $params, $gid, &$access, $pop, $option, $ItemidCount=NULL ) { - global $database, $mainframe, $Itemid; +function show( $row, $params, $gid, &$access, $pop, $option='com_content', $ItemidCount=NULL ) { + global $database, $mainframe; global $cache; $noauth = !$mainframe->getCfg( 'shownoauth' ); @@ -1205,51 +1458,122 @@ $params->def( 'item_title', 1 ); $params->def( 'url', 1 ); - // loads the link for Section name - if ( $params->get( 'section_link' ) ) { - $query = "SELECT a.id" - . "\n FROM #__menu AS a" - . "\n WHERE a.componentid = ". $row->sectionid."" + // if a popup item (e.g. print page) set popup param to correct value + if ( $pop ) { + $params->set( 'popup', 1 ); + } + + // check if voting/rating enabled + if ( $params->get( 'rating' ) ) { + // voting query + $query = "SELECT ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count" + . "\n FROM #__content AS a" + . "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id" + . "\n WHERE a.id = $row->id" ; $database->setQuery( $query ); - $_Itemid = $database->loadResult(); - - if ( $_Itemid ) { - $_Itemid = '&Itemid='. $_Itemid; - } + $database->loadObject($voting); - $link = sefRelToAbs( 'index.php?option=com_content&task=section&id='. $row->sectionid . $_Itemid ); - $row->section = ''. $row->section .''; + // add to $row info + $row->rating = $voting->rating; + $row->rating_count = $voting->rating_count; } + + if ( $params->get( 'section_link' ) || $params->get( 'category_link' ) ) { + // loads the link for Section name + if ( $params->get( 'section_link' ) || $params->get( 'category_link' ) ) { + // pull values from mainframe + $secLinkID = $mainframe->get( 'secID_'. $row->sectionid, -1 ); + $secLinkURL = $mainframe->get( 'secURL_'. $row->sectionid ); + + // check if values have already been placed into mainframe memory + if ( $secLinkID == -1 ) { + $query = "SELECT id, link" + . "\n FROM #__menu" + . "\n WHERE published = 1" + . "\n AND type IN ( 'content_section', 'content_blog_section' )" + . "\n AND componentid = $row->sectionid" + . "\n ORDER BY type DESC, ordering" + ; + $database->setQuery( $query ); + //$secLinkID = $database->loadResult(); + $result = $database->loadRow(); + + $secLinkID = $result[0]; + $secLinkURL = $result[1]; + + if ($secLinkID == null) { + $secLinkID = 0; + // save 0 query result to mainframe + $mainframe->set( 'secID_'. $row->sectionid, 0 ); + } else { + // save query result to mainframe + $mainframe->set( 'secID_'. $row->sectionid, $secLinkID ); + $mainframe->set( 'secURL_'. $row->sectionid, $secLinkURL ); + } + } - // loads the link for Category name - if ( $params->get( 'category_link' ) ) { - $query = "SELECT a.id" - . "\n FROM #__menu AS a" - . "\n WHERE a.componentid = $row->catid" - ; - $database->setQuery( $query ); - $_Itemid = $database->loadResult(); - - if ( $_Itemid ) { - $_Itemid = '&Itemid='. $_Itemid; + $_Itemid = ''; + // use Itemid for section found in query + if ($secLinkID != -1 && $secLinkID) { + $_Itemid = '&Itemid='. $secLinkID; + } + if ($secLinkURL) { + $link = sefRelToAbs( $secLinkURL . $_Itemid ); + } else { + $link = sefRelToAbs( 'index.php?option=com_content&task=section&id='. $row->sectionid . $_Itemid ); + } + $row->section = ''. $row->section .''; } + + // loads the link for Category name + if ( $params->get( 'category_link' ) && $row->catid ) { + // pull values from mainframe + $catLinkID = $mainframe->get( 'catID_'. $row->catid, -1 ); + $catLinkURL = $mainframe->get( 'catURL_'. $row->catid ); + + // check if values have already been placed into mainframe memory + if ( $catLinkID == -1 ) { + $query = "SELECT id, link" + . "\n FROM #__menu" + . "\n WHERE published = 1" + . "\n AND type IN ( 'content_category', 'content_blog_category' )" + . "\n AND componentid = $row->catid" + . "\n ORDER BY type DESC, ordering" + ; + $database->setQuery( $query ); + //$catLinkID = $database->loadResult(); + $result = $database->loadRow(); + + $catLinkID = $result[0]; + $catLinkURL = $result[1]; - $link = sefRelToAbs( 'index.php?option=com_content&task=category&sectionid='. $row->sectionid .'&id='. $row->catid . $_Itemid ); - $row->category = ''. $row->category .''; - } + if ($catLinkID == null) { + $catLinkID = 0; + // save 0 query result to mainframe + $mainframe->set( 'catID_'. $row->catid, 0 ); + } else { + // save query result to mainframe + $mainframe->set( 'catID_'. $row->catid, $catLinkID ); + $mainframe->set( 'catURL_'. $row->catid, $catLinkURL ); + } + } - // loads current template for the pop-up window - $template = ''; - if ( $pop ) { - $params->set( 'popup', 1 ); - $query = "SELECT template" - . "\n FROM #__templates_menu" - . "\n WHERE client_id = 0" - . "\n AND menuid = 0" - ; - $database->setQuery( $query ); - $template = $database->loadResult(); + $_Itemid = ''; + // use Itemid for category found in query + if ($catLinkID != -1 && $catLinkID) { + $_Itemid = '&Itemid='. $catLinkID; + } else if ($secLinkID != -1 && $secLinkID) { + // use Itemid for section found in query + $_Itemid = '&Itemid='. $secLinkID; + } + if ($catLinkURL) { + $link = sefRelToAbs( $catLinkURL . $_Itemid ); + } else { + $link = sefRelToAbs( 'index.php?option=com_content&task=category&sectionid='. $row->sectionid .'&id='. $row->catid . $_Itemid ); + } + $row->category = ''. $row->category .''; + } } // show/hides the intro text @@ -1269,12 +1593,16 @@ $obj->hit( $row->id ); } - $cache->call( 'HTML_content::show', $row, $params, $access, $page, $option, $ItemidCount ); + // needed for caching purposes to stop different cachefiles being created for same item + // does not affect anything else as hits data not outputted + $row->hits = 0; + + $cache->call( 'HTML_content::show', $row, $params, $access, $page ); } function editItem( $uid, $gid, &$access, $sectionid=0, $task, $Itemid ){ - global $database, $my; + global $database, $my, $mainframe; global $mosConfig_absolute_path, $mosConfig_live_site; $nullDate = $database->getNullDate(); @@ -1299,6 +1627,22 @@ mosNotAuth(); return; } + + if ( $Itemid == 0 || $Itemid == 99999999 ) { + // security check to see if link exists in a menu + $link = 'index.php?option=com_content&task=new§ionid='. $sectionid; + $query = "SELECT id" + . "\n FROM #__menu" + . "\n WHERE link LIKE '%$link%'" + . "\n AND published = 1" + ; + $database->setQuery( $query ); + $exists = $database->loadResult(); + if ( !$exists ) { + mosNotAuth(); + return; + } + } } if ( $uid ) { @@ -1320,28 +1664,44 @@ if ( $uid ) { $row->checkout( $my->id ); - if (trim( $row->publish_down ) == '0000-00-00 00:00:00') { - $row->publish_down = 'Never'; - } + if (trim( $row->images )) { $row->images = explode( "\n", $row->images ); } else { $row->images = array(); } - $query = "SELECT name from #__users" + + $row->created = mosFormatDate( $row->created, _CURRENT_SERVER_TIME_FORMAT ); + $row->modified = $row->modified == $nullDate ? '' : mosFormatDate( $row->modified, _CURRENT_SERVER_TIME_FORMAT ); + $row->publish_up = mosFormatDate( $row->publish_up, _CURRENT_SERVER_TIME_FORMAT ); + + if (trim( $row->publish_down ) == $nullDate || trim( $row->publish_down ) == '' || trim( $row->publish_down ) == '-' ) { + $row->publish_down = 'Never'; + } + $row->publish_down = mosFormatDate( $row->publish_down, _CURRENT_SERVER_TIME_FORMAT ); + + $query = "SELECT name" + . "\n FROM #__users" . "\n WHERE id = $row->created_by" ; $database->setQuery( $query ); $row->creator = $database->loadResult(); + + // test to reduce unneeded query + if ( $row->created_by == $row->modified_by ) { + $row->modifier = $row->creator; + } else { + $query = "SELECT name" + . "\n FROM #__users" + . "\n WHERE id = '$row->modified_by'" + ; + $database->setQuery( $query ); + $row->modifier = $database->loadResult(); + } - $query = "SELECT name from #__users" - . "\n WHERE id = $row->modified_by" - ; - $database->setQuery( $query ); - $row->modifier = $database->loadResult(); - - $query = "SELECT content_id from #__content_frontpage" - ."\n WHERE content_id = $row->id" + $query = "SELECT content_id" + . "\n FROM #__content_frontpage" + . "\n WHERE content_id = $row->id" ; $database->setQuery( $query ); $row->frontpage = $database->loadResult(); @@ -1358,18 +1718,62 @@ $row->frontpage = 0; } - + // pull param column from category info + $query = "SELECT params" + . "\n FROM #__categories" + . "\n WHERE id = $row->catid" + ; + $database->setQuery( $query ); + $categoryParam = $database->loadResult(); + + $paramsCat = new mosParameters( $categoryParam, $mainframe->getPath( 'com_xml', 'com_categories' ), 'component' ); + $selected_folders = $paramsCat->get( 'imagefolders', '' ); + + if ( !$selected_folders ) { + $selected_folders = '*2*'; + } + + // check if images utilizes settings from section + if ( strpos( $selected_folders, '*2*' ) !== false ) { + unset( $selected_folders ); + // load param column from section info + $query = "SELECT params" + . "\n FROM #__sections" + . "\n WHERE id = $row->sectionid" + ; + $database->setQuery( $query ); + $sectionParam = $database->loadResult(); + + $paramsSec = new mosParameters( $sectionParam, $mainframe->getPath( 'com_xml', 'com_sections' ), 'component' ); + $selected_folders = $paramsSec->get( 'imagefolders', '' ); + } + + if ( trim( $selected_folders ) ) { + $temps = explode( ',', $selected_folders ); + foreach( $temps as $temp ) { + $folders[] = mosHTML::makeOption( $temp, $temp ); + } + } else { + $folders[] = mosHTML::makeOption( '*1*' ); + } + // calls function to read image from directory $pathA = $mosConfig_absolute_path .'/images/stories'; $pathL = $mosConfig_live_site .'/images/stories'; $images = array(); - $folders = array(); - $folders[] = mosHTML::makeOption( '/' ); - mosAdminMenus::ReadImages( $pathA, '/', $folders, $images ); + + if ( $folders[0]->value == '*1*' ) { + $folders = array(); + $folders[] = mosHTML::makeOption( '/' ); + mosAdminMenus::ReadImages( $pathA, '/', $folders, $images ); + } else { + mosAdminMenus::ReadImagesX( $folders, $images ); + } + // list of folders in images/stories/ $lists['folders'] = mosAdminMenus::GetImageFolders( $folders, $pathL ); // list of images in specfic folder in images/stories/ - $lists['imagefiles'] = mosAdminMenus::GetImages( $images, $pathL ); + $lists['imagefiles'] = mosAdminMenus::GetImages( $images, $pathL, $folders ); // list of saved images $lists['imagelist'] = mosAdminMenus::GetSavedImages( $row, $pathL ); @@ -1410,14 +1814,19 @@ */ function saveContent( &$access, $task ) { global $database, $mainframe, $my; - global $mosConfig_absolute_path, $Itemid; + global $mosConfig_absolute_path, $mosConfig_offset, $Itemid; + // simple spoof check security + josSpoofCheck(); + $nullDate = $database->getNullDate(); + $row = new mosContent( $database ); if ( !$row->bind( $_POST ) ) { echo "\n"; exit(); } + $isNew = $row->id < 1; if ( $isNew ) { // new record @@ -1425,21 +1834,34 @@ mosNotAuth(); return; } - $row->created = date( 'Y-m-d H:i:s' ); - $row->created_by = $my->id; + + $row->created = date( 'Y-m-d H:i:s' ); + $row->created_by = $my->id; } else { // existing record if ( !( $access->canEdit || ( $access->canEditOwn && $row->created_by == $my->id ) ) ) { mosNotAuth(); return; } + $row->modified = date( 'Y-m-d H:i:s' ); $row->modified_by = $my->id; } - if ( trim( $row->publish_down ) == 'Never' ) { + + if (strlen(trim( $row->publish_up )) <= 10) { + $row->publish_up .= ' 00:00:00'; + } + $row->publish_up = mosFormatDate( $row->publish_up, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset ); + + if (trim( $row->publish_down ) == 'Never' || trim( $row->publish_down ) == '') { $row->publish_down = $nullDate; + } else { + if (strlen(trim( $row->publish_down )) <= 10) { + $row->publish_down .= ' 00:00:00'; + } + $row->publish_down = mosFormatDate( $row->publish_down, _CURRENT_SERVER_TIME_FORMAT, -$mosConfig_offset ); } - + // code cleaner for xhtml transitional compliance $row->introtext = str_replace( '
    ', '
    ', $row->introtext ); $row->fulltext = str_replace( '
    ', '
    ', $row->fulltext ); @@ -1489,7 +1911,7 @@ require_once( $mainframe->getPath( 'class', 'com_frontpage' ) ); $fp = new mosFrontPage( $database ); - if ( mosGetParam( $_REQUEST, 'frontpage', 0 ) ) { + if ( intval( mosGetParam( $_REQUEST, 'frontpage', 0 ) ) ) { // toggles go to first place if (!$fp->load( $row->id )) { @@ -1550,13 +1972,14 @@ } $msg = $isNew ? _THANK_SUB : _E_ITEM_SAVED; + $msg = $my->usertype == 'Publisher' ? _THANK_SUB_PUB: $msg; switch ( $task ) { case 'apply': $link = $_SERVER['HTTP_REFERER']; break; case 'apply_new': - $Itemid = mosGetParam( $_POST, 'Returnid', $Itemid ); + $Itemid = intval( mosGetParam( $_POST, 'Returnid', $Itemid ) ); $link = 'index.php?option=com_content&task=edit&id='. $row->id.'&Itemid='. $Itemid; break; @@ -1565,9 +1988,13 @@ default: $Itemid = mosGetParam( $_POST, 'Returnid', '' ); if ( $Itemid ) { - $link = 'index.php?option=com_content&task=view&id='. $row->id.'&Itemid='. $Itemid; + if ( $access->canEdit ) { + $link = 'index.php?option=com_content&task=view&id='. $row->id.'&Itemid='. $Itemid; + } else { + $link = 'index.php'; + } } else { - $link = mosGetParam( $_POST, 'referer', '' ); + $link = strval( mosGetParam( $_POST, 'referer', '' ) ); } break; } @@ -1589,9 +2016,9 @@ $row->checkin(); } - $Itemid = mosGetParam( $_POST, 'Returnid', '0' ); + $Itemid = intval( mosGetParam( $_POST, 'Returnid', '0' ) ); - $referer = mosGetParam( $_POST, 'referer', '' ); + $referer = strval( mosGetParam( $_POST, 'referer', '' ) ); $parts = parse_url( $referer ); parse_str( $parts['query'], $query ); @@ -1600,7 +2027,7 @@ $referer = 'index.php?option=com_content&task=view&id='. $row->id.'&Itemid='. $Itemid; } - if ( $referer && !( $task == 'new' ) ) { + if ( $referer && $row->id ) { mosRedirect( $referer ); } else { mosRedirect( 'index.php' ); @@ -1616,6 +2043,8 @@ $row = new mosContent( $database ); $row->load( $uid ); + + $itemid = intval( mosGetParam( $_GET, 'itemid', 0 ) ); if ( $row->id === null || $row->access > $my->gid ) { mosNotAuth(); @@ -1628,7 +2057,8 @@ ; $database->setQuery( $query ); $template = $database->loadResult(); - HTML_content::emailForm( $row->id, $row->title, $template ); + + HTML_content::emailForm( $row->id, $row->title, $template, $itemid ); } } @@ -1641,60 +2071,26 @@ global $database, $mainframe; global $mosConfig_live_site, $mosConfig_sitename; - $validate = mosGetParam( $_POST, mosHash( 'validate' ), 0 ); - if (!$validate) { - // probably a spoofing attack - echo _NOT_AUTH; - return; - } - - // First, make sure the form was posted from a browser. - // For basic web-forms, we don't care about anything - // other than requests from a browser: - if (!isset( $_SERVER['HTTP_USER_AGENT'] )) { - header( "HTTP/1.0 403 Forbidden" ); - die( _NOT_AUTH ); - exit; - } - - // Make sure the form was indeed POST'ed: - // (requires your html form to use: action="post") - if (!$_SERVER['REQUEST_METHOD'] == 'POST' ) { - header("HTTP/1.0 403 Forbidden"); - die( _NOT_AUTH ); - exit; - } - - // Attempt to defend against header injections: - $badStrings = array( - 'Content-Type:', - 'MIME-Version:', - 'Content-Transfer-Encoding:', - 'bcc:', - 'cc:' - ); - - // Loop through each POST'ed value and test if it contains - // one of the $badStrings: - foreach ($_POST as $k => $v){ - foreach ($badStrings as $v2) { - if (strpos( $v, $v2 ) !== false) { - header( "HTTP/1.0 403 Forbidden" ); - die( _NOT_AUTH ); - } - } - } - - // Made it past spammer test, free up some memory - // and continue rest of script: - unset($k, $v, $v2, $badStrings); - - $_Itemid = $mainframe->getItemid( $uid, 0, 0 ); - $email = mosGetParam( $_POST, 'email', '' ); - $yourname = mosGetParam( $_POST, 'yourname', '' ); - $youremail = mosGetParam( $_POST, 'youremail', '' ); + // simple spoof check security + josSpoofCheck(1); + + $itemid = intval( mosGetParam( $_POST, 'itemid', 0 ) ); + + // check for session cookie + // Session Cookie `name` + $sessionCookieName = mosMainFrame::sessionCookieName(); + // Get Session Cookie `value` + $sessioncookie = mosGetParam( $_COOKIE, $sessionCookieName, null ); + + if ( !(strlen($sessioncookie) == 32 || $sessioncookie == '-') ) { + mosErrorAlert( _NOT_AUTH ); + } + + $email = strval( mosGetParam( $_POST, 'email', '' ) ); + $yourname = strval( mosGetParam( $_POST, 'yourname', '' ) ); + $youremail = strval( mosGetParam( $_POST, 'youremail', '' ) ); $subject_default = _EMAIL_INFO .' ' . $yourname; - $subject = mosGetParam( $_POST, 'subject', $subject_default ); + $subject = strval( mosGetParam( $_POST, 'subject', $subject_default ) ); if ($uid < 1 || !$email || !$youremail || ( is_email( $email ) == false ) || (is_email( $youremail ) == false)) { mosErrorAlert( _EMAIL_ERR_NOINFO ); @@ -1708,8 +2104,16 @@ $database->setQuery( $query ); $template = $database->loadResult(); + // determine Itemid for Item + if ($itemid) { + $_itemid = '&Itemid='. $itemid; + } else { + $itemid = $mainframe->getItemid( $uid, 0, 0 ); + $_itemid = '&Itemid='. $itemid; + } + // link sent in email - $link = sefRelToAbs( $mosConfig_live_site .'/index.php?option=com_content&task=view&id='. $uid .'&Itemid='. $_Itemid ); + $link = sefRelToAbs( $mosConfig_live_site .'/index.php?option=com_content&task=view&id='. $uid . $_itemid ); // message text $msg = sprintf( _EMAIL_MSG, $mosConfig_sitename, $yourname, $youremail, $link ); @@ -1732,14 +2136,12 @@ function recordVote() { global $database; - $user_rating = mosGetParam( $_REQUEST, 'user_rating', 0 ); - $url = mosGetParam( $_REQUEST, 'url', '' ); - $cid = mosGetParam( $_REQUEST, 'cid', 0 ); - $cid = intval( $cid ); - $user_rating = intval( $user_rating ); + $user_rating = intval( mosGetParam( $_REQUEST, 'user_rating', 0 ) ); + $url = mosGetParam( $_REQUEST, 'url', '' ); + $cid = intval( mosGetParam( $_REQUEST, 'cid', 0 ) ); if (($user_rating >= 1) and ($user_rating <= 5)) { - $currip = getenv( 'REMOTE_ADDR' ); + $currip = ( phpversion() <= '4.2.1' ? @getenv( 'REMOTE_ADDR' ) : $_SERVER['REMOTE_ADDR'] ); $query = "SELECT *" . "\n FROM #__content_rating" @@ -1811,11 +2213,11 @@ break; case 'hits': - $orderby = 'a.hits'; + $orderby = 'a.hits DESC'; break; case 'rhits': - $orderby = 'a.hits DESC'; + $orderby = 'a.hits'; break; case 'order': @@ -1845,22 +2247,41 @@ /* * @param int 0 = Archives, 1 = Section, 2 = Category */ -function _where( $type=1, &$access, &$noauth, $gid, $id, $now=NULL, $year=NULL, $month=NULL ) { - global $database; - - $nullDate = $database->getNullDate(); - $where = array(); +function _where( $type=1, &$access, &$noauth, $gid, $id, $now=NULL, $year=NULL, $month=NULL, $params=NULL ) { + global $database, $mainframe; + + $noauth = !$mainframe->getCfg( 'shownoauth' ); + $nullDate = $database->getNullDate(); + $now = _CURRENT_SERVER_TIME; + $where = array(); + $unpublished = 0; + + if ( isset($params) ) { + // param controls whether unpublished items visible to publishers and above + $unpublished = $params->def( 'unpublished', 0 ); + } // normal - if ( $type > 0) { - $where[] = "a.state = '1'"; - if ( !$access->canEdit ) { - $where[] = "( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"; - $where[] = "( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"; - } - if ( $noauth ) { - $where[] = "a.access <= $gid"; - } + if ( $type > 0) { + if ( isset($params) && $unpublished ) { + // shows unpublished items for publishers and above + if ( $access->canEdit ) { + $where[] = "a.state >= 0"; + } else { + $where[] = "a.state = 1"; + $where[] = "( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"; + $where[] = "( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"; + } + } else { + // unpublished items NOT shown for publishers and above + $where[] = "a.state = 1"; + //if ( !$access->canEdit ) { + $where[] = "( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )"; + $where[] = "( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )"; + //} + } + + // add query checks for category or section ids if ( $id > 0 ) { if ( $type == 1 ) { $where[] = "a.sectionid IN ( $id ) "; @@ -1872,16 +2293,13 @@ // archive if ( $type < 0 ) { - $where[] = "a.state='-1'"; + $where[] = "a.state = -1"; if ( $year ) { $where[] = "YEAR( a.created ) = '$year'"; } if ( $month ) { $where[] = "MONTH( a.created ) = '$month'"; } - if ( $noauth ) { - $where[] = "a.access <= $gid"; - } if ( $id > 0 ) { if ( $type == -1 ) { $where[] = "a.sectionid = $id"; @@ -1890,7 +2308,34 @@ } } } - + + $where[] = "s.published = 1"; + $where[] = "cc.published = 1"; + if ( $noauth ) { + $where[] = "a.access <= $gid"; + $where[] = "s.access <= $gid"; + $where[] = "cc.access <= $gid"; + } + return $where; } + +function votingQuery( $active=NULL ) { + global $mainframe; + + $voting = ( $active ? $active : $mainframe->getCfg( 'vote' ) ); + + if ( $voting ) { + // calculate voting count + $select = "\n , ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count"; + $join = "\n LEFT JOIN #__content_rating AS v ON a.id = v.content_id"; + } else { + $select = ''; + $join = ''; + } + + $results = array( 'select' => $select, 'join' => $join ); + + return $results; +} ?> \ No newline at end of file diff -urN joomla-1.0.7/components/com_login/login.html.php joomla-1.0.10/components/com_login/login.html.php --- joomla-1.0.7/components/com_login/login.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_login/login.html.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ get('login'); ?> @@ -123,6 +126,7 @@ +
    " /> - \ No newline at end of file diff -urN joomla-1.0.7/components/com_login/login.php joomla-1.0.10/components/com_login/login.php --- joomla-1.0.7/components/com_login/login.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_login/login.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ getPath( 'front_html' ) ); -global $database, $my; -global $mosConfig_live_site; +global $database, $my, $mainframe; +global $mosConfig_live_site, $mosConfig_frontend_login, $mosConfig_db; -$return = mosGetParam( $_SERVER, 'REQUEST_URI', null ); -$return = ampReplace( $return ); +if ( $mosConfig_frontend_login != NULL && ($mosConfig_frontend_login === 0 || $mosConfig_frontend_login === '0')) { + header( "HTTP/1.0 403 Forbidden" ); + echo _NOT_AUTH; + return; +} -$menu = new mosMenu( $database ); -$menu->load( $Itemid ); +$menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); $params->def( 'page_title', 1 ); diff -urN joomla-1.0.7/components/com_messages/messages.class.php joomla-1.0.10/components/com_messages/messages.class.php --- joomla-1.0.7/components/com_messages/messages.class.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_messages/messages.class.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ mosDBTable( '#__messages', 'message_id', $db ); } + /** + * Validation and filtering + */ + function check() { + // filter malicious code + $this->filter( ); + + return true; + } + function send( $from_id=null, $to_id=null, $subject=null, $message=null ) { global $database; diff -urN joomla-1.0.7/components/com_newsfeeds/newsfeeds.html.php joomla-1.0.10/components/com_newsfeeds/newsfeeds.html.php --- joomla-1.0.7/components/com_newsfeeds/newsfeeds.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_newsfeeds/newsfeeds.html.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ - get( 'name' ) ) { ?> - + name; ?> @@ -160,7 +159,6 @@ - useCacheLite( true, $LitePath, $cacheDir, $newsfeed->cache_time ); - $rssDoc->loadRSS( $newsfeed->link ); + // full RSS parser used to access image information + $rssDoc = new xml_domit_rss_document(); + $rssDoc->useCacheLite( true, $LitePath, $cacheDir, $newsfeed->cache_time ); + $success = $rssDoc->loadRSS( $newsfeed->link ); + + if ( $success ) { $totalChannels = $rssDoc->getChannelCount(); - + for ( $i = 0; $i < $totalChannels; $i++ ) { $currChannel =& $rssDoc->getChannel($i); $elements = $currChannel->getElementList(); $descrip = 0; $iUrl = 0; + foreach ( $elements as $element ) { //image handling if ( $element == 'image' ) { @@ -267,21 +266,24 @@ } } } + $feed_title = $currChannel->getTitle(); + $feed_title = mosCommonHTML::newsfeedEncoding( $rssDoc, $feed_title ); ?> get( 'feed_descr' ) ) { + $feed_descrip = $currChannel->getDescription(); + $feed_descrip = mosCommonHTML::newsfeedEncoding( $rssDoc, $feed_descrip ); ?> @@ -312,39 +314,44 @@ getItem($j); + + $item_title = $currItem->getTitle(); + $item_title = mosCommonHTML::newsfeedEncoding( $rssDoc, $item_title ); ?>
  • getLink()) { ?> - - getTitle(); ?> + + getEnclosure()) { $enclosure = $currItem->getEnclosure(); $eUrl = $enclosure->getUrl(); ?> - - getTitle(); ?> + + getEnclosure()) && ($currItem->getLink())) { $enclosure = $currItem->getEnclosure(); $eUrl = $enclosure->getUrl(); ?> - - getTitle(); ?> + +
    - Link: - + Link: + + get( 'item_descr' ) ) { - $text = html_entity_decode( $currItem->getDescription() ); - $text = str_replace(''', "'", $text); + $text = $currItem->getDescription(); + $text = mosCommonHTML::newsfeedEncoding( $rssDoc, $text ); + $num = $params->get( 'word_count' ); // word limit check diff -urN joomla-1.0.7/components/com_newsfeeds/newsfeeds.php joomla-1.0.10/components/com_newsfeeds/newsfeeds.php --- joomla-1.0.7/components/com_newsfeeds/newsfeeds.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_newsfeeds/newsfeeds.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ loadObjectList(); // current category info - $query = "SELECT name, description, image, image_position" + $query = "SELECT id, name, description, image, image_position" . "\n FROM #__categories" . "\n WHERE id = $catid" . "\n AND published = 1" @@ -74,31 +74,38 @@ ; $database->setQuery( $query ); $database->loadObject( $currentcat ); + + /* + Check if the category is published or if access level allows access + */ + if (!$currentcat->name) { + mosNotAuth(); + return; + } } // Parameters - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); - $params->def( 'page_title', 1 ); - $params->def( 'header', $menu->name ); - $params->def( 'pageclass_sfx', '' ); - $params->def( 'headings', 1 ); - $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); - $params->def( 'description_text', '' ); - $params->def( 'image', -1 ); - $params->def( 'image_align', 'right' ); - $params->def( 'other_cat_section', 1 ); + $params->def( 'page_title', 1 ); + $params->def( 'header', $menu->name ); + $params->def( 'pageclass_sfx', '' ); + $params->def( 'headings', 1 ); + $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); + $params->def( 'description_text', '' ); + $params->def( 'image', -1 ); + $params->def( 'image_align', 'right' ); + $params->def( 'other_cat_section', 1 ); // Category List Display control - $params->def( 'other_cat', 1 ); - $params->def( 'cat_description', 1 ); - $params->def( 'cat_items', 1 ); + $params->def( 'other_cat', 1 ); + $params->def( 'cat_description', 1 ); + $params->def( 'cat_items', 1 ); // Table Display control - $params->def( 'headings', 1 ); - $params->def( 'name', 1 ); - $params->def( 'articles', '1' ); - $params->def( 'link', '1' ); + $params->def( 'headings', 1 ); + $params->def( 'name', 1 ); + $params->def( 'articles', 1 ); + $params->def( 'link', 0 ); if ( $catid ) { $params->set( 'type', 'category' ); @@ -147,27 +154,65 @@ } -function showFeed( $option, $feedid ) { - global $database, $mainframe, $mosConfig_absolute_path, $Itemid; +function showFeed( $feedid ) { + global $database, $mainframe, $mosConfig_absolute_path, $mosConfig_cachepath, $Itemid, $my; + + // check if cache directory is writeable + $cacheDir = $mosConfig_cachepath .'/'; + if ( !is_writable( $cacheDir ) ) { + echo 'Cache Directory Unwriteable'; + return; + } + + require_once( $mainframe->getPath( 'class' ) ); + + $newsfeed = new mosNewsFeed($database); + $newsfeed->load($feedid); + + /* + * Check if newsfeed is published + */ + if(!$newsfeed->published) { + mosNotAuth(); + return; + } + + $category = new mosCategory($database); + $category->load($newsfeed->catid); + + /* + * Check if newsfeed category is published + */ + if(!$category->published) { + mosNotAuth(); + return; + } + /* + * check whether category access level allows access + */ + if ( $category->access > $my->gid ) { + mosNotAuth(); + return; + } // full RSS parser used to access image information require_once( $mosConfig_absolute_path . '/includes/domit/xml_domit_rss.php'); - $cacheDir = $mosConfig_absolute_path . '/cache/'; $LitePath = $mosConfig_absolute_path . '/includes/Cache/Lite.php'; // Adds parameter handling - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); - $params->def( 'page_title', 1 ); - $params->def( 'header', $menu->name ); - $params->def( 'pageclass_sfx', '' ); - $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); + $params->def( 'page_title', 1 ); + $params->def( 'header', $menu->name ); + $params->def( 'pageclass_sfx', '' ); + $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); // Feed Display control - $params->def( 'feed_image', 1 ); - $params->def( 'feed_descr', 1 ); - $params->def( 'item_descr', 1 ); - $params->def( 'word_count', 0 ); + $params->def( 'feed_image', 1 ); + $params->def( 'feed_descr', 1 ); + $params->def( 'item_descr', 1 ); + $params->def( 'word_count', 0 ); + // Encoding + $params->def( 'utf8', 1 ); if ( !$params->get( 'page_title' ) ) { $params->set( 'header', '' ); @@ -178,18 +223,8 @@ $and = "\n AND id = $feedid"; } - $query = "SELECT name, link, numarticles, cache_time" - . "\n FROM #__newsfeeds" - . "\n WHERE published = 1" - . "\n AND checked_out = 0" - . $and - . "\n ORDER BY ordering" - ; - $database->setQuery( $query ); - $newsfeeds = $database->loadObjectList(); - $mainframe->SetPageTitle($menu->name); - HTML_newsfeed::showNewsfeeds( $newsfeeds, $LitePath, $cacheDir, $params ); + HTML_newsfeed::showNewsfeeds( $newsfeed, $LitePath, $cacheDir, $params ); } ?> \ No newline at end of file diff -urN joomla-1.0.7/components/com_poll/poll.html.php joomla-1.0.10/components/com_poll/poll.html.php --- joomla-1.0.7/components/com_poll/poll.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_poll/poll.html.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ text); $data_arr["hits"][$j]=$vote->hits; + $data_arr["voters"][$j]=$vote->voters; $j++; } ?> @@ -80,14 +82,6 @@
  • - - - -
    - - getTitle())); ?> - + +
    - getDescription())); ?> +

    - -
    @@ -119,10 +113,9 @@ $maxval = $hits; } } - $sumval = array_sum( $data_arr["hits"] ); ?>
    - +
    @@ -133,6 +126,7 @@ for ($i=0, $n=count($data_arr["text"]); $i < $n; $i++) { $text = &$data_arr["text"][$i]; $hits = &$data_arr["hits"][$i]; + $sumval = &$data_arr['voters'][$i]; if ($maxval > 0 && $sumval > 0) { $width = ceil( $hits*$polls_graphwidth/$maxval ); $percent = round( 100*$hits/$sumval, 1 ); diff -urN joomla-1.0.7/components/com_poll/poll.php joomla-1.0.10/components/com_poll/poll.php --- joomla-1.0.7/components/com_poll/poll.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_poll/poll.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ "._NO_SELECTION.""; echo ''; @@ -94,7 +91,8 @@ $database->query(); - $now = date( 'Y-m-d G:i:s' ); + $now = _CURRENT_SERVER_TIME; + $query = "INSERT INTO #__poll_date" . "\n SET date = '$now', vote_id = $voteid, poll_id = $poll->id" ; @@ -118,16 +116,26 @@ $poll = new mosPoll( $database ); $poll->load( $uid ); - if (empty($poll->title)) { - $poll->id = ''; - $poll->title = _SELECT_POLL; + // if id value is passed and poll not published then exit + if ($poll->id != '' && !$poll->published) { + mosNotAuth(); + return; } $first_vote = ''; $last_vote = ''; $votes = ''; - if (isset($poll->id) && $poll->id != '') { + /* + Check if there is a poll corresponding to id + and if poll is published + */ + if (isset($poll->id) && $poll->id != '' && $poll->published == 1) { + if (empty($poll->title)) { + $poll->id = ''; + $poll->title = _SELECT_POLL; + } + $query = "SELECT MIN( date ) AS mindate, MAX( date ) AS maxdate" . "\n FROM #__poll_date" . "\n WHERE poll_id = $poll->id" @@ -140,18 +148,19 @@ $last_vote = mosFormatDate( $dates[0]->maxdate, _DATE_FORMAT_LC2 ); } - $query = "SELECT a.id, a.text, count( DISTINCT b.id ) AS hits, count( DISTINCT b.id )/COUNT( DISTINCT a.id )*100.0 AS percent" + $query = "SELECT a.id, a.text, a.hits, b.voters" . "\n FROM #__poll_data AS a" - . "\n LEFT JOIN #__poll_date AS b ON b.vote_id = a.id" + . "\n INNER JOIN #__polls AS b ON b.id = a.pollid" . "\n WHERE a.pollid = $poll->id" . "\n AND a.text != ''" - . "\n GROUP BY a.id" - . "\n ORDER BY a.id" + . "\n AND b.published = 1" ; + $database->setQuery( $query ); $votes = $database->loadObjectList(); } + // list of polls for dropdown selection $query = "SELECT id, title" . "\n FROM #__polls" . "\n WHERE published = 1" @@ -159,9 +168,15 @@ ; $database->setQuery( $query ); $polls = $database->loadObjectList(); - - reset( $polls ); - $link = sefRelToAbs( 'index.php?option=com_poll&task=results&id=\' + this.options[selectedIndex].value + \'&Itemid='. $Itemid .'\' + \'' ); + + // Itemid for dropdown + $_Itemid = ''; + if ( $Itemid && $Itemid != 99999999 ) { + $_Itemid = '&Itemid='. $Itemid; + } + + // dropdown output + $link = sefRelToAbs( 'index.php?option=com_poll&task=results&id=\' + this.options[selectedIndex].value + \''. $_Itemid .'\' + \'' ); $pollist = ''; // Adds parameter handling - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); $params->def( 'page_title', 1 ); diff -urN joomla-1.0.7/components/com_registration/registration.html.php joomla-1.0.10/components/com_registration/registration.html.php --- joomla-1.0.7/components/com_registration/registration.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_registration/registration.html.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@
    @@ -52,19 +54,24 @@
    - - +
    + + + + \n"; + echo "\n"; exit(); } $pwd = $row->password; $row->password = md5( $row->password ); - $row->registerDate = date('Y-m-d H:i:s'); + $row->registerDate = date( 'Y-m-d H:i:s' ); if (!$row->store()) { - echo "\n"; + echo "\n"; exit(); } $row->checkin(); @@ -152,18 +165,21 @@ $subject = sprintf (_SEND_SUB, $name, $mosConfig_sitename); $subject = html_entity_decode($subject, ENT_QUOTES); - if ($mosConfig_useractivation=="1"){ + + if ($mosConfig_useractivation == 1){ $message = sprintf (_USEND_MSG_ACTIVATE, $name, $mosConfig_sitename, $mosConfig_live_site."/index.php?option=com_registration&task=activate&activation=".$row->activation, $mosConfig_live_site, $username, $pwd); } else { $message = sprintf (_USEND_MSG, $name, $mosConfig_sitename, $mosConfig_live_site); } $message = html_entity_decode($message, ENT_QUOTES); - // Send email to user - if ($mosConfig_mailfrom != "" && $mosConfig_fromname != "") { - $adminName2 = $mosConfig_fromname; - $adminEmail2 = $mosConfig_mailfrom; + + // check if Global Config `mailfrom` and `fromname` values exist + if ($mosConfig_mailfrom != '' && $mosConfig_fromname != '') { + $adminName2 = $mosConfig_fromname; + $adminEmail2 = $mosConfig_mailfrom; } else { + // use email address and name of first superadmin for use in email sent to user $query = "SELECT name, email" . "\n FROM #__users" . "\n WHERE LOWER( usertype ) = 'superadministrator'" @@ -172,10 +188,12 @@ $database->setQuery( $query ); $rows = $database->loadObjectList(); $row2 = $rows[0]; + $adminName2 = $row2->name; $adminEmail2 = $row2->email; } + // Send email to user mosMail($adminEmail2, $adminName2, $email, $subject, $message); // Send notification to all administrators @@ -184,24 +202,21 @@ $subject2 = html_entity_decode($subject2, ENT_QUOTES); $message2 = html_entity_decode($message2, ENT_QUOTES); - // get superadministrators id - $admins = $acl->get_group_objects( 25, 'ARO' ); - - foreach ( $admins['users'] AS $id ) { - $query = "SELECT email, sendEmail" - . "\n FROM #__users" - ."\n WHERE id = $id" - ; - $database->setQuery( $query ); - $rows = $database->loadObjectList(); - - $row = $rows[0]; - - if ($row->sendEmail) { - mosMail($adminEmail2, $adminName2, $row->email, $subject2, $message2); - } + // get email addresses of all admins and superadmins set to recieve system emails + $query = "SELECT email, sendEmail" + . "\n FROM #__users" + . "\n WHERE ( gid = 24 OR gid = 25 )" + . "\n AND sendEmail = 1" + . "\n AND block = 0" + ; + $database->setQuery( $query ); + $admins = $database->loadObjectList(); + + foreach ( $admins as $admin ) { + // send email to admin & super admin set to recieve system emails + mosMail($adminEmail2, $adminName2, $admin->email, $subject2, $message2); } - + if ( $mosConfig_useractivation == 1 ){ echo _REG_COMPLETE_ACTIVATE; } else { @@ -210,9 +225,15 @@ } function activate( $option ) { - global $database; + global $database, $my; global $mosConfig_useractivation, $mosConfig_allowUserRegistration; + if($my->id) { + // They're already logged in, so redirect them to the home page + mosRedirect( 'index.php' ); + } + + if ($mosConfig_allowUserRegistration == '0' || $mosConfig_useractivation == '0') { mosNotAuth(); return; @@ -258,4 +279,4 @@ } return $rBool; } -?> \ No newline at end of file +?> diff -urN joomla-1.0.7/components/com_rss/rss.php joomla-1.0.10/components/com_rss/rss.php --- joomla-1.0.7/components/com_rss/rss.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_rss/rss.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ getNullDate(); // pull id of syndication component $query = "SELECT a.id" . "\n FROM #__components AS a" - . "\n WHERE a.option = 'com_syndicate'" + . "\n WHERE ( a.admin_menu_link = 'option=com_syndicate' OR a.admin_menu_link = 'option=com_syndicate&hidemainmenu=1' )" + . "\n AND a.option = 'com_syndicate'" ; $database->setQuery( $query ); $id = $database->loadResult(); @@ -52,51 +53,119 @@ $component->load( $id ); $params = new mosParameters( $component->params ); - $now = date( 'Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60 ); + // test if security check is enbled + $check = $params->def( 'check', 1 ); + if($check) { + // test if rssfeed module is published + // if not disable access + $query = "SELECT m.id" + . "\n FROM #__modules AS m" + . "\n WHERE m.module = 'mod_rssfeed'" + . "\n AND m.published = 1" + ; + $database->setQuery( $query ); + $check = $database->loadResultArray(); + if(empty($check)) { + mosNotAuth(); + return; + } + } + + $now = _CURRENT_SERVER_TIME; $iso = split( '=', _ISO ); // parameter intilization - $info[ 'date' ] = date( 'r' ); - $info[ 'year' ] = date( 'Y' ); - $info[ 'encoding' ] = $iso[1]; - $info[ 'link' ] = htmlspecialchars( $mosConfig_live_site ); - $info[ 'cache' ] = $params->def( 'cache', 1 ); - $info[ 'cache_time' ] = $params->def( 'cache_time', 3600 ); - $info[ 'count' ] = $params->def( 'count', 5 ); - $info[ 'orderby' ] = $params->def( 'orderby', '' ); - $info[ 'title' ] = $params->def( 'title', 'Joomla! powered Site' ); - $info[ 'description' ] = $params->def( 'description', 'Joomla! site syndication' ); - $info[ 'image_file' ] = $params->def( 'image_file', 'joomla_rss.png' ); + $info[ 'date' ] = date( 'r' ); + $info[ 'year' ] = date( 'Y' ); + $info[ 'encoding' ] = $iso[1]; + $info[ 'link' ] = htmlspecialchars( $mosConfig_live_site ); + $info[ 'cache' ] = $params->def( 'cache', 1 ); + $info[ 'cache_time' ] = $params->def( 'cache_time', 3600 ); + $info[ 'count' ] = $params->def( 'count', 5 ); + $info[ 'orderby' ] = $params->def( 'orderby', '' ); + $info[ 'title' ] = $params->def( 'title', 'Joomla! powered Site' ); + $info[ 'description' ] = $params->def( 'description', 'Joomla! site syndication' ); + $info[ 'image_file' ] = $params->def( 'image_file', 'joomla_rss.png' ); if ( $info[ 'image_file' ] == -1 ) { - $info[ 'image' ] = NULL; + $info[ 'image' ] = NULL; } else{ - $info[ 'image' ] = $mosConfig_live_site .'/images/M_images/'. $info[ 'image_file' ]; + $info[ 'image' ] = $mosConfig_live_site .'/images/M_images/'. $info[ 'image_file' ]; } - $info[ 'image_alt' ] = $params->def( 'image_alt', 'Powered by Joomla!' ); - $info[ 'limit_text' ] = $params->def( 'limit_text', 1 ); - $info[ 'text_length' ] = $params->def( 'text_length', 20 ); + $info[ 'image_alt' ] = $params->def( 'image_alt', 'Powered by Joomla!' ); + $info[ 'limit_text' ] = $params->def( 'limit_text', 0 ); + $info[ 'text_length' ] = $params->def( 'text_length', 20 ); // get feed type from url - $info[ 'feed' ] = mosGetParam( $_GET, 'feed', 'RSS2.0' ); + $info[ 'feed' ] = strval( mosGetParam( $_GET, 'feed', 'RSS2.0' ) ); // live bookmarks $info[ 'live_bookmark' ] = $params->def( 'live_bookmark', '' ); $info[ 'bookmark_file' ] = $params->def( 'bookmark_file', '' ); - // content to syndicate -// $info[ 'content' ] = $params->def( 'content', -1 ); // set filename for live bookmarks feed if ( !$showFeed & $info[ 'live_bookmark' ] ) { if ( $info[ 'bookmark_file' ] ) { // custom bookmark filename - $info[ 'file' ] = $mosConfig_absolute_path .'/cache/'. $info[ 'bookmark_file' ]; + $filename = $info[ 'bookmark_file' ]; } else { // standard bookmark filename - $info[ 'file' ] = $mosConfig_absolute_path .'/cache/'. $info[ 'live_bookmark' ]; + $filename = $info[ 'live_bookmark' ]; } } else { // set filename for rss feeds $info[ 'file' ] = strtolower( str_replace( '.', '', $info[ 'feed' ] ) ); - $info[ 'file' ] = $mosConfig_absolute_path .'/cache/'. $info[ 'file' ] .'.xml'; + + // security check to limit arbitrary file creation. + // and to allow disabling/enabling of selected feed types + switch ( $info[ 'file' ] ) { + case 'rss091': + if ( !$params->get( 'rss091', 1 ) ) { + echo _NOT_AUTH; + return; + } + break; + + case 'rss10': + if ( !$params->get( 'rss10', 1 ) ) { + echo _NOT_AUTH; + return; + } + break; + + case 'rss20': + if ( !$params->get( 'rss20', 1 ) ) { + echo _NOT_AUTH; + return; + } + break; + + case 'atom03': + if ( !$params->get( 'atom03', 1 ) ) { + echo _NOT_AUTH; + return; + } + break; + + case 'opml': + if ( !$params->get( 'opml', 1 ) ) { + echo _NOT_AUTH; + return; + } + break; + + + default: + echo _NOT_AUTH; + return; + break; + } + } + $filename = $info[ 'file' ] .'.xml'; + + // security check to stop server path disclosure + if ( strstr( $filename, '/' ) ) { + echo _NOT_AUTH; + return; } + $info[ 'file' ] = $mosConfig_cachepath .'/'. $filename; // load feed creator class $rss = new UniversalFeedCreator(); @@ -159,26 +228,24 @@ break; } - $join = "\n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id"; - $and = ''; - // query of frontpage content items - //$query = "SELECT a.*, u.name AS author, u.usertype, UNIX_TIMESTAMP( a.created ) AS created_ts" $query = "SELECT a.*, u.name AS author, u.usertype, UNIX_TIMESTAMP( a.created ) AS created_ts, cat.title AS cat_title, sec.title AS section_title" . "\n FROM #__content AS a" - . $join + . "\n INNER JOIN #__content_frontpage AS f ON f.content_id = a.id" . "\n LEFT JOIN #__users AS u ON u.id = a.created_by" . "\n LEFT JOIN #__categories AS cat ON cat.id = a.catid" . "\n LEFT JOIN #__sections AS sec ON sec.id = a.sectionid" . "\n WHERE a.state = 1" - . $and + . "\n AND cat.published = 1" + . "\n AND sec.published = 1" . "\n AND a.access = 0" - . "\n AND ( publish_up = '$nullDate' OR publish_up <= '$now' )" - . "\n AND ( publish_down = '$nullDate' OR publish_down >= '$now' )" + . "\n AND cat.access = 0" + . "\n AND sec.access = 0" + . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" + . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" . "\n ORDER BY $orderby" - . ( $info[ 'count' ] ? "\n LIMIT ". $info[ 'count' ] : '' ) ; - $database->setQuery( $query ); + $database->setQuery( $query, 0, $info[ 'count' ] ); $rows = $database->loadObjectList(); foreach ( $rows as $row ) { @@ -188,10 +255,15 @@ // url link to article // & used instead of & as this is converted by feed creator - $item_link = 'index.php?option=com_content&task=view&id='. $row->id .'&Itemid='. $mainframe->getItemid( $row->id ); + $_Itemid = ''; + $itemid = $mainframe->getItemid( $row->id ); + if ($itemid) { + $_Itemid = '&Itemid='. $itemid; + } + + $item_link = 'index.php?option=com_content&task=view&id='. $row->id . $_Itemid; $item_link = sefRelToAbs( $item_link ); - // removes all formating from the intro text for the description text $item_description = $row->introtext; $item_description = mosHTML::cleanText( $item_description ); diff -urN joomla-1.0.7/components/com_search/search.html.php joomla-1.0.10/components/com_search/search.html.php --- joomla-1.0.7/components/com_search/search.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_search/search.html.php 2006-06-25 16:54:08.000000000 -0400 @@ -1,6 +1,6 @@ '; eval ('echo "'._CONCLUSION.'";'); - - $image = mosAdminMenus::ImageCheck( 'google.png', '/images/M_images/', NULL, NULL, 'Google', 'Google', 1 ); + ?> - - - + + @@ -121,8 +120,8 @@ writePagesCounter(); - $searchphrase = trim( strtolower( mosGetParam( $_REQUEST, 'searchphrase', 'any' ) ) ); - $ordering = trim( strtolower( mosGetParam( $_REQUEST, 'ordering', 'newest' ) ) ); + $searchphrase = strtolower( strval( mosGetParam( $_REQUEST, 'searchphrase', 'any' ) ) ); + $ordering = strtolower( strval( mosGetParam( $_REQUEST, 'ordering', 'newest' ) ) ); $link = $mosConfig_live_site ."/index.php?option=$option&Itemid=$Itemid&searchword=$searchword&searchphrase=$searchphrase&ordering=$ordering"; echo $pageNav->getLimitBox( $link ); @@ -204,29 +203,20 @@
    - writePagesLinks( $link ); - ?> + writePagesLinks( $link ); ?>
    - - - - - getPath( 'front_html' ) ); +// page title +$mainframe->setPageTitle( _SEARCH_TITLE ); + switch ( $task ) { default: viewSearch(); @@ -47,9 +50,8 @@ $gid = $my->gid; // Adds parameter handling - if( $Itemid > 0 ) { - $menu = new mosMenu( $database ); - $menu->load( $Itemid ); + if( $Itemid > 0 && $Itemid != 99999999 ) { + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); $params->def( 'page_title', 1 ); $params->def( 'pageclass_sfx', '' ); @@ -66,7 +68,7 @@ // html output search_html::openhtml( $params ); - $searchword = mosGetParam( $_REQUEST, 'searchword', '' ); + $searchword = strval( mosGetParam( $_REQUEST, 'searchword', '' ) ); $searchword = $database->getEscaped( trim( $searchword ) ); // limit searchword to 20 characters @@ -90,27 +92,27 @@ $orders[] = mosHTML::makeOption( 'popular', _SEARCH_POPULAR ); $orders[] = mosHTML::makeOption( 'alpha', _SEARCH_ALPHABETICAL ); $orders[] = mosHTML::makeOption( 'category', _SEARCH_CATEGORY ); - $ordering = mosGetParam( $_REQUEST, 'ordering', 'newest'); + $ordering = strtolower( strval( mosGetParam( $_REQUEST, 'ordering', 'newest') ) ); $lists = array(); $lists['ordering'] = mosHTML::selectList( $orders, 'ordering', 'id="search_ordering" class="inputbox"', 'value', 'text', $ordering ); - $searchphrase = mosGetParam( $_REQUEST, 'searchphrase', 'any' ); + $searchphrase = strtolower( strval( mosGetParam( $_REQUEST, 'searchphrase', 'any' ) ) ); $searchphrases = array(); $phrase = new stdClass(); - $phrase->value = 'any'; - $phrase->text = _SEARCH_ANYWORDS; - $searchphrases[] = $phrase; + $phrase->value = 'any'; + $phrase->text = _SEARCH_ANYWORDS; + $searchphrases[] = $phrase; $phrase = new stdClass(); - $phrase->value = 'all'; - $phrase->text = _SEARCH_ALLWORDS; - $searchphrases[] = $phrase; + $phrase->value = 'all'; + $phrase->text = _SEARCH_ALLWORDS; + $searchphrases[] = $phrase; $phrase = new stdClass(); - $phrase->value = 'exact'; - $phrase->text = _SEARCH_PHRASE; - $searchphrases[] = $phrase; + $phrase->value = 'exact'; + $phrase->text = _SEARCH_PHRASE; + $searchphrases[] = $phrase; $lists['searchphrase']= mosHTML::radioList( $searchphrases, 'searchphrase', '', $searchphrase ); @@ -142,8 +144,8 @@ search_html::searchintro( $searchword_clean, $params ); mosLogSearch( $searchword ); - $phrase = mosGetParam( $_REQUEST, 'searchphrase', '' ); - $ordering = mosGetParam( $_REQUEST, 'ordering', '' ); + $phrase = strval( mosGetParam( $_REQUEST, 'searchphrase', '' ) ); + $ordering = strval( mosGetParam( $_REQUEST, 'ordering', '' ) ); $_MAMBOTS->loadBotGroup( 'search' ); $results = $_MAMBOTS->trigger( 'onSearch', array( $searchword, $phrase, $ordering ) ); @@ -157,29 +159,36 @@ $totalRows = count( $rows ); for ($i=0; $i < $totalRows; $i++) { - $row = &$rows[$i]->text; + $text = &$rows[$i]->text; + if ($phrase == 'exact') { - $searchwords = array($searchword); - $needle = $searchword; + $searchwords = array($searchword); + $needle = $searchword; } else { - $searchwords = explode(' ', $searchword); - $needle = $searchwords[0]; + $searchwords = explode(' ', $searchword); + $needle = $searchwords[0]; } - - $row = mosPrepareSearchContent( $row, 200, $needle ); + + $text = mosPrepareSearchContent( $text, 200, $needle ); foreach ($searchwords as $hlword) { - $row = preg_replace( '/' . preg_quote( $hlword, '/' ) . '/i', '\0', $row ); + $text = preg_replace( '/' . preg_quote( $hlword, '/' ) . '/i', '\0', $text ); } - - if (!eregi( '^http', $rows[$i]->href )) { - // determines Itemid for Content items - if ( strstr( $rows[$i]->href, 'view' ) ) { - // tests to see if itemid has already been included - this occurs for typed content items - if ( !strstr( $rows[$i]->href, 'Itemid' ) ) { - $temp = explode( 'id=', $rows[$i]->href ); - @$rows[$i]->href = $rows[$i]->href. '&Itemid='. $mainframe->getItemid($temp[1]); + + if ( strpos( $rows[$i]->href, 'http' ) == false ) { + $url = parse_url( $rows[$i]->href ); + parse_str( @$url['query'], $link ); + + // determines Itemid for Content items where itemid has not been included + if ( isset($rows[$i]->type) && @$link['task'] == 'view' && isset($link['id']) && !isset($link['Itemid']) ) { + $itemid = ''; + $_itemid = $mainframe->getItemid( $link['id'], 0 ); + + if ($_itemid) { + $itemid = '&Itemid='. $_itemid; } + + $rows[$i]->href = $rows[$i]->href . $itemid; } } } @@ -187,8 +196,12 @@ $mainframe->setPageTitle( _SEARCH_TITLE ); $total = $totalRows; - $limit = mosGetParam( $_GET, 'limit', $mosConfig_list_limit ); - $limitstart = mosGetParam( $_GET, 'limitstart', 0 ); + $limit = intval( mosGetParam( $_GET, 'limit', $mosConfig_list_limit ) ); + $limitstart = intval( mosGetParam( $_GET, 'limitstart', 0 ) ); + + // prepares searchword for proper display in url + $searchword_clean = urlencode(stripslashes($searchword_clean)); + if ( $n ) { // html output require_once( $GLOBALS['mosConfig_absolute_path'] . '/includes/pageNavigation.php' ); @@ -201,7 +214,7 @@ } // html output - search_html::conclusion( $totalRows, $searchword_clean, $pageNav ); + search_html::conclusion( $searchword_clean, $pageNav ); } // displays back button @@ -235,4 +248,4 @@ } } } -?> +?> \ No newline at end of file diff -urN joomla-1.0.7/components/com_user/user.html.php joomla-1.0.10/components/com_user/user.html.php --- joomla-1.0.7/components/com_user/user.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_user/user.html.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ \n"; exit(); } + mosMakeHtmlSafe($row); - if(isset($_POST["password"]) && $_POST["password"] != "") { - if(isset($_POST["verifyPass"]) && ($_POST["verifyPass"] == $_POST["password"])) { - $row->password = md5($_POST["password"]); + if (isset($_POST['password']) && $_POST['password'] != '') { + if (isset($_POST['verifyPass']) && ($_POST['verifyPass'] == $_POST['password'])) { + $row->password = md5( $row->password ); } else { echo "\n"; exit(); } } else { // Restore 'original password' - $row->password = $row->orig_password; + $row->password = $orig_password; } + if ($mosConfig_frontend_userparams == '1' || $mosConfig_frontend_userparams == 1 || $mosConfig_frontend_userparams == NULL) { // save params - $params = mosGetParam( $_POST, 'params', '' ); - if (is_array( $params )) { - $txt = array(); - foreach ( $params as $k=>$v) { - $txt[] = "$k=$v"; + $params = mosGetParam( $_POST, 'params', '' ); + if (is_array( $params )) { + $txt = array(); + foreach ( $params as $k=>$v) { + $txt[] = "$k=$v"; + } + $row->params = implode( "\n", $txt ); } - $row->params = implode( "\n", $txt ); } if (!$row->check()) { @@ -165,15 +198,26 @@ exit(); } - unset($row->orig_password); // prevent DB error!! - if (!$row->store()) { echo "\n"; exit(); } + + // check if username has been changed + if ( $orig_username != $row->username ) { + // change username value in session table + $query = "UPDATE #__session" + . "\n SET username = '$row->username'" + . "\n WHERE username = '$orig_username'" + . "\n AND userid = $my->id" + . "\n AND gid = $my->gid" + . "\n AND guest = 0" + ; + $database->setQuery( $query ); + $database->query(); + } - $link = $_SERVER['HTTP_REFERER']; - mosRedirect( $link, _USER_DETAILS_SAVE ); + mosRedirect( 'index.php', _USER_DETAILS_SAVE ); } function CheckIn( $userid, $access, $option ){ @@ -186,6 +230,20 @@ return; } + // security check to see if link exists in a menu + $link = 'index.php?option=com_user&task=CheckIn'; + $query = "SELECT id" + . "\n FROM #__menu" + . "\n WHERE link LIKE '%$link%'" + . "\n AND published = 1" + ; + $database->setQuery( $query ); + $exists = $database->loadResult(); + if ( !$exists ) { + mosNotAuth(); + return; + } + $lt = mysql_list_tables($mosConfig_db); $k = 0; echo ""; diff -urN joomla-1.0.7/components/com_weblinks/weblinks.class.php joomla-1.0.10/components/com_weblinks/weblinks.class.php --- joomla-1.0.7/components/com_weblinks/weblinks.class.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_weblinks/weblinks.class.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ url ) || ( eregi( 'https://',$this->url ) ) || ( eregi( 'ftp://',$this->url ) ) ) ) { $this->url = 'http://'.$this->url; } + + // SQL injection protection + $this->catid = intval($this->catid); + $this->title = $this->_db->getEscaped( $this->title ); /** check for existing name */ $query = "SELECT id" diff -urN joomla-1.0.7/components/com_weblinks/weblinks.html.php joomla-1.0.10/components/com_weblinks/weblinks.html.php --- joomla-1.0.7/components/com_weblinks/weblinks.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_weblinks/weblinks.html.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ \n"; @@ -272,8 +318,8 @@ $row->date = date( 'Y-m-d H:i:s' ); // until full edit capabilities are given for weblinks - limit saving to new weblinks only - $row->id = 0; - + $row->id = 0; + if (!$row->check()) { echo "\n"; exit(); diff -urN joomla-1.0.7/components/com_wrapper/wrapper.php joomla-1.0.10/components/com_wrapper/wrapper.php --- joomla-1.0.7/components/com_wrapper/wrapper.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/components/com_wrapper/wrapper.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ load( $Itemid ); + $menu = $mainframe->get( 'menu' ); $params = new mosParameters( $menu->params ); $params->def( 'back_button', $mainframe->getCfg( 'back_button' ) ); $params->def( 'scrolling', 'auto' ); @@ -32,7 +31,7 @@ $params->def( 'pageclass_sfx', '' ); $params->def( 'header', $menu->name ); $params->def( 'height', '500' ); - $params->def( 'height_auto', '1' ); + $params->def( 'height_auto', '0' ); $params->def( 'width', '100%' ); $params->def( 'add', '1' ); $url = $params->def( 'url', '' ); diff -urN joomla-1.0.7/configuration.php-dist joomla-1.0.10/configuration.php-dist --- joomla-1.0.7/configuration.php-dist 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/configuration.php-dist 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ Please check back again soon.'; -$mosConfig_lifetime = '900'; // Session time +$mosConfig_lifetime = '900'; // Frontend Session time +$mosConfig_session_life_admin = '1800'; // Admin Session Time $mosConfig_MetaDesc = 'Joomla - the dynamic portal engine and content management system'; $mosConfig_MetaKeys = 'joomla'; $mosConfig_MetaTitle = '1'; @@ -91,5 +94,8 @@ $mosConfig_helpurl = 'http://help.joomla.org'; $mosConfig_mbf_content='0'; $mosConfig_editor = 'tinymce'; -setlocale (LC_TIME, $mosConfig_locale); // Country locale +$mosConfig_admin_expired = '1'; +$mosConfig_frontend_login = '1'; +$mosConfig_frontend_userparams = '1'; +setlocale (LC_ALL, $mosConfig_locale); // Country locale ?> \ No newline at end of file diff -urN joomla-1.0.7/editor/editor.php joomla-1.0.10/editor/editor.php --- joomla-1.0.7/editor/editor.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/editor/editor.php 2006-06-25 16:54:09.000000000 -0400 @@ -1,6 +1,6 @@ loadBot( 'editors', $editor, 1 ); - $_MAMBOTS->loadBotGroup( 'editors-xtd' ); function initEditor() { global $mainframe, $_MAMBOTS; @@ -60,6 +59,12 @@ function editorArea( $name, $content, $hiddenField, $width, $height, $col, $row ) { global $mainframe, $_MAMBOTS, $my; + // ensure editor-xtd bots are loaded only once + if (!defined( '_JOS_EDITORXTD_INCLUDED' )) { + define( '_JOS_EDITORXTD_INCLUDED', 1 ); + $_MAMBOTS->loadBotGroup( 'editors-xtd' ); + } + $mainframe->set( 'loadEditor', true ); $results = $_MAMBOTS->trigger( 'onEditorArea', array( $name, $content, $hiddenField, $width, $height, $col, $row ) ); @@ -69,6 +74,6 @@ } } } - define( '_MOS_EDITOR_INCLUDED', 1 ); + define( '_JOS_EDITOR_INCLUDED', 1 ); } ?> \ No newline at end of file diff -urN joomla-1.0.7/htaccess.txt joomla-1.0.10/htaccess.txt --- joomla-1.0.7/htaccess.txt 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/htaccess.txt 2006-06-25 16:54:09.000000000 -0400 @@ -1,37 +1,91 @@ ## -# @version $Id: htaccess.txt 1570 2005-12-29 05:53:33Z eddieajau $ +# @version $Id: htaccess.txt 4085 2006-06-21 16:03:54Z stingrey $ # @package Joomla # @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. # @license http://www.gnu.org/copyleft/gpl.html GNU/GPL # Joomla! is Free Software ## -Options +FollowSymLinks +##################################################### +# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE # -# mod_rewrite in use +# The line just below this section: 'Options FollowSymLinks' may cause problems +# with some server configurations. It is required for use of mod_rewrite, but may already +# be set by your server administrator in a way that dissallows changing it in +# your .htaccess file. If using it causes your server to error out, comment it out (add # to +# beginning of line), reload your site in your browser and test your sef url's. If they work, +# it has been set by your server administrator and you do not need it set here. +# +# Only use one of the two SEF sections that follow. Lines that can be uncommented +# (and thus used) have only one #. Lines with two #'s should not be uncommented +# In the section that you don't use, all lines should start with # +# +# For Standard SEF, use the standard SEF section. You can comment out +# all of the RewriteCond lines and reduce your server's load if you +# don't have directories in your root named 'component' or 'content' +# +# If you are using a 3rd Party SEF or the Core SEF solution +# uncomment all of the lines in the '3rd Party or Core SEF' section +# +##################################################### + +##### SOLVING PROBLEMS WITH COMPONENT URL's that don't work ##### +# SPECIAL NOTE FOR SMF USERS WHEN SMF IS INTEGRATED AND BRIDGED +# OR ANY SITUATION WHERE A COMPONENT's URL's AREN't WORKING # +# In both the 'Standard SEF', and '3rd Party or Core SEF' sections the line: +# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## +# May need to be uncommented. If you are running your Joomla/Mambo from +# a subdirectory the name of the subdirectory will need to be inserted into this +# line. For example, if your Joomla/Mambo is in a subdirectory called '/test/', +# change this: +# RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## +# to this: +# RewriteCond %{REQUEST_URI} ^(/test/component/option,com) [NC,OR] ##optional - see notes## +# +##################################################### + + +## Can be commented out if causes errors, see notes above. +Options FollowSymLinks + +# +# mod_rewrite in use RewriteEngine On -## -## NOTE! -## When using multiple Joomla sites or other web applications in sub-folders, -## you must explicitly turn the RewriteEngine off or use the settings -## recommended for the application -## -# Uncomment following line if your webserver's URL +# Uncomment following line if your webserver's URL # is not directly related to physical file paths. -# Update YourJoomlaDirectory (just / for root) +# Update Your Joomla/MamboDirectory (just / for root) -# RewriteBase /YourJoomlaDirectory +# RewriteBase / -# -# Rules -# -RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$ +########## Begin - Joomla! core SEF Section +############# Use this section if using ONLY Joomla! core SEF +## ALL (RewriteCond) lines in this section are only required if you actually +## have directories named 'content' or 'component' on your server +## If you do not have directories with these names, comment them out. +# RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^(.*) index.php +#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## +RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC] +RewriteRule ^(content/|component/) index.php +# +########## End - Joomla! core SEF Section + + + +########## Begin - 3rd Party SEF Section +############# Use this section if you are using a 3rd party (Non Joomla! core) SEF extension - e.g. OpenSEF, 404_SEF, 404SEFx, SEF Advance, etc +# +#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR] ##optional - see notes## +#RewriteCond %{REQUEST_URI} (/|\.htm|\.php|\.html|/[^.]*)$ [NC] +#RewriteCond %{REQUEST_FILENAME} !-f +#RewriteCond %{REQUEST_FILENAME} !-d +#RewriteRule (.*) index.php +# +########## End - 3rd Party SEF Section \ No newline at end of file diff -urN joomla-1.0.7/includes/Cache/Lite.php joomla-1.0.10/includes/Cache/Lite.php --- joomla-1.0.7/includes/Cache/Lite.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/Cache/Lite.php 2006-06-25 16:54:18.000000000 -0400 @@ -22,7 +22,7 @@ * * @package Cache_Lite * @category Caching -* @version $Id: Lite.php 47 2005-09-15 02:55:27Z rhuk $ +* @version $Id: Lite.php 3313 2006-04-26 19:43:05Z stingrey $ * @author Fabien MARTY */ @@ -465,10 +465,13 @@ * @param int $code error code * @access public */ - function raiseError($msg, $code) - { - include_once('PEAR.php'); - PEAR::raiseError($msg, $code, $this->_pearErrorMode); + function raiseError($msg, $code) { + $path = dirname( __FILE__ ) . DIRECTORY_SEPARATOR .'includes'. DIRECTORY_SEPARATOR .'PEAR'. DIRECTORY_SEPARATOR .'PEAR.php'; + + if ( file_exists( $path ) ) { + include_once( $path ); + PEAR::raiseError($msg, $code, $this->_pearErrorMode); + } } // --- Private methods --- diff -urN joomla-1.0.7/includes/HTML_toolbar.php joomla-1.0.10/includes/HTML_toolbar.php --- joomla-1.0.7/includes/HTML_toolbar.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/HTML_toolbar.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ \n"; + $content_buffer .= "\n"; + $content_buffer .= "
    - <?php echo $alt;?> + <?php echo $alt;?> @@ -94,7 +94,7 @@ * @param string An override for the alt text */ function publish( $task='publish', $alt=_CMN_PUBLISHED ) { - $image = mosAdminMenus::ImageCheck( 'publish_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'publish_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -109,7 +109,7 @@ * @param string An override for the alt text */ function publishList( $task='publish', $alt=_CMN_PUBLISHED ) { - $image = mosAdminMenus::ImageCheck( 'publish_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'publish_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -124,7 +124,7 @@ * @param string An override for the alt text */ function unpublish( $task='unpublish', $alt=_CMN_UNPUBLISHED ) { - $image = mosAdminMenus::ImageCheck( 'unpublish_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'unpublish_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -139,7 +139,7 @@ * @param string An override for the alt text */ function unpublishList( $task='unpublish', $alt=_CMN_UNPUBLISHED ) { - $image = mosAdminMenus::ImageCheck( 'unpublish_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'unpublish_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -154,7 +154,7 @@ * @param string An override for the alt text */ function archiveList( $task='archive', $alt=_CMN_ARCHIVE ) { - $image = mosAdminMenus::ImageCheck( 'archive_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'archive_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -169,7 +169,7 @@ * @param string An override for the alt text */ function unarchiveList( $task='unarchive', $alt=_CMN_UNARCHIVE ) { - $image = mosAdminMenus::ImageCheck( 'unarchive_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'unarchive_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -184,7 +184,7 @@ * @param string An override for the alt text */ function editList( $task='edit', $alt=_E_EDIT ) { - $image = mosAdminMenus::ImageCheck( 'edit_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'edit_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -199,7 +199,7 @@ * @param string An override for the alt text */ function editHtml( $task='edit_source', $alt=_CMN_EDIT_HTML ) { - $image = mosAdminMenus::ImageCheck( 'edit_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'edit_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -214,7 +214,7 @@ * @param string An override for the alt text */ function editCss( $task='edit_css', $alt=_CMN_EDIT_CSS ) { - $image = mosAdminMenus::ImageCheck( 'css_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'css_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -230,7 +230,7 @@ * @param string An override for the alt text */ function deleteList( $msg='', $task='remove', $alt=_CMN_DELETE ) { - $image = mosAdminMenus::ImageCheck( 'delete_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'delete_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -267,7 +267,7 @@ * @param string An override for the alt text */ function save( $task='save', $alt=_CMN_SAVE ) { - $image = mosAdminMenus::ImageCheck( 'save_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'save_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -281,8 +281,8 @@ * @param string An override for the task * @param string An override for the alt text */ - function apply( $task='apply', $alt='Apply' ) { - $image = mosAdminMenus::ImageCheck( 'apply_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + function apply( $task='apply', $alt=_CMN_APPLY ) { + $image = mosAdminMenus::ImageCheck( 'apply_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> @@ -323,7 +323,7 @@ * @param string An override for the alt text */ function cancel( $task='cancel', $alt=_CMN_CANCEL ) { - $image = mosAdminMenus::ImageCheck( 'cancel_f2.png', '/images/', NULL, NULL, $alt, $task, 1 ); + $image = mosAdminMenus::ImageCheck( 'cancel_f2.png', '/images/', NULL, NULL, $alt, $task, 1, 'middle', $alt ); ?> diff -urN joomla-1.0.7/includes/database.mysql5.php joomla-1.0.10/includes/database.mysql5.php --- joomla-1.0.7/includes/database.mysql5.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/database.mysql5.php 2006-06-25 16:54:18.000000000 -0400 @@ -89,6 +89,8 @@ $this->_table_prefix = $table_prefix; $this->_ticker = 0; $this->_log = array(); + + $this->setSQLMode(); } /** * @param int @@ -738,7 +740,7 @@ * @private * @since 1.0.6 */ - function setSchema( $array=null ) { + function _setSchema( $array=null ) { if (is_array( $array )) { $this->_schema = $array; } else { @@ -752,7 +754,7 @@ * @private * @since 1.0.6 */ - function &_getSchema() { + function _getSchema() { if ($this->_schema == null) { $this->_setSchema(); } @@ -854,15 +856,32 @@ */ function load( $oid=null ) { $k = $this->_tbl_key; + if ($oid !== null) { $this->$k = $oid; } + $oid = $this->$k; + if ($oid === null) { return false; } + //Note: Prior to PHP 4.2.0, Uninitialized class variables will not be reported by get_class_vars(). + $class_vars = get_class_vars(get_class($this)); + foreach ($class_vars as $name => $value) { + if (($name != $k) and ($name != "_db") and ($name != "_tbl") and ($name != "_tbl_key")) { + $this->$name = $value; + } + } + $this->reset(); - $this->_db->setQuery( "SELECT * FROM $this->_tbl WHERE $this->_tbl_key='$oid'" ); + + $query = "SELECT *" + . "\n FROM $this->_tbl" + . "\n WHERE $this->_tbl_key = '$oid'" + ; + $this->_db->setQuery( $query ); + return $this->_db->loadObject( $this ); } @@ -1178,12 +1197,17 @@ $this->_error = "WARNING: ".strtolower(get_class( $this ))." does not support checkin."; return false; } - $k = $this->_tbl_key; + + $k = $this->_tbl_key; + $nullDate = $this->_db->getNullDate(); + if ($oid !== null) { $this->$k = intval( $oid ); } - $time = date( 'H:i:s' ); - $nullDate = $this->_db->getNullDate(); + if ($this->$k == NULL) { + return false; + } + $query = "UPDATE $this->_tbl" . "\n SET checked_out = 0, checked_out_time = '$nullDate'" . "\n WHERE $this->_tbl_key = ". $this->$k diff -urN joomla-1.0.7/includes/database.mysqli.php joomla-1.0.10/includes/database.mysqli.php --- joomla-1.0.7/includes/database.mysqli.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/database.mysqli.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ _tbl_key; + if ($oid !== null) { $this->$k = $oid; } + $oid = $this->$k; + if ($oid === null) { return false; } + //Note: Prior to PHP 4.2.0, Uninitialized class variables will not be reported by get_class_vars(). + $class_vars = get_class_vars(get_class($this)); + foreach ($class_vars as $name => $value) { + if (($name != $k) and ($name != "_db") and ($name != "_tbl") and ($name != "_tbl_key")) { + $this->$name = $value; + } + } + $this->reset(); - $this->_db->setQuery( "SELECT * FROM $this->_tbl WHERE $this->_tbl_key='$oid'" ); + + $query = "SELECT *" + . "\n FROM $this->_tbl" + . "\n WHERE $this->_tbl_key = '$oid'" + ; + $this->_db->setQuery( $query ); + return $this->_db->loadObject( $this ); } @@ -1092,12 +1109,17 @@ $this->_error = "WARNING: ".strtolower(get_class( $this ))." does not support checkin."; return false; } - $k = $this->_tbl_key; + + $k = $this->_tbl_key; + $nullDate = $this->_db->getNullDate(); + if ($oid !== null) { $this->$k = intval( $oid ); } - $time = date( 'H:i:s' ); - $nullDate = $this->_db->getNullDate(); + if ($this->$k == NULL) { + return false; + } + $query = "UPDATE $this->_tbl" . "\n SET checked_out = 0, checked_out_time = '$nullDate'" . "\n WHERE $this->_tbl_key = ". $this->$k diff -urN joomla-1.0.7/includes/database.php joomla-1.0.10/includes/database.php --- joomla-1.0.7/includes/database.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/database.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ _tbl_key; + if ($oid !== null) { $this->$k = $oid; } + $oid = $this->$k; + if ($oid === null) { return false; } + //Note: Prior to PHP 4.2.0, Uninitialized class variables will not be reported by get_class_vars(). + /* + $class_vars = $this->getPublicProperties(); + foreach ($class_vars as $name => $value) { + if ($name != $k) { + $this->$name = $value; + } + } + */ + $class_vars = get_class_vars(get_class($this)); + foreach ($class_vars as $name => $value) { + if (($name != $k) and ($name != "_db") and ($name != "_tbl") and ($name != "_tbl_key")) { + $this->$name = $value; + } + } + $this->reset(); - $this->_db->setQuery( "SELECT * FROM $this->_tbl WHERE $this->_tbl_key='$oid'" ); + + $query = "SELECT *" + . "\n FROM $this->_tbl" + . "\n WHERE $this->_tbl_key = '$oid'" + ; + $this->_db->setQuery( $query ); + return $this->_db->loadObject( $this ); } @@ -1105,12 +1130,17 @@ $this->_error = "WARNING: ".strtolower(get_class( $this ))." does not support checkin."; return false; } - $k = $this->_tbl_key; + + $k = $this->_tbl_key; + $nullDate = $this->_db->getNullDate(); + if ($oid !== null) { $this->$k = intval( $oid ); } - $time = date( 'H:i:s' ); - $nullDate = $this->_db->getNullDate(); + if ($this->$k == NULL) { + return false; + } + $query = "UPDATE $this->_tbl" . "\n SET checked_out = 0, checked_out_time = '$nullDate'" . "\n WHERE $this->_tbl_key = ". $this->$k diff -urN joomla-1.0.7/includes/domit/xml_domit_lite_parser.php joomla-1.0.10/includes/domit/xml_domit_lite_parser.php --- joomla-1.0.7/includes/domit/xml_domit_lite_parser.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/domit/xml_domit_lite_parser.php 2006-06-25 16:54:17.000000000 -0400 @@ -911,7 +911,7 @@ */ function &createElement($tagName) { $node = new DOMIT_Lite_Element($tagName); - $node->ownerDocument =& $this; + $node->ownerDocument = $this; return $node; } //createElement @@ -923,7 +923,7 @@ */ function &createTextNode($data) { $node = new DOMIT_Lite_TextNode($data); - $node->ownerDocument =& $this; + $node->ownerDocument = $this; return $node; } //createTextNode @@ -935,7 +935,7 @@ */ function &createCDATASection($data) { $node = new DOMIT_Lite_CDATASection($data); - $node->ownerDocument =& $this; + $node->ownerDocument = $this; return $node; } //createCDATASection @@ -1394,7 +1394,7 @@ require_once(DOMIT_INCLUDE_PATH . 'xml_domit_getelementsbypath.php'); $gebp = new DOMIT_GetElementsByPath(); - $myResponse =& $gebp->parsePattern($this, $pattern, $nodeIndex); + $myResponse = $gebp->parsePattern($this, $pattern, $nodeIndex); return $myResponse; } //getElementsByPath @@ -1718,12 +1718,26 @@ $this->preserveCDATA = $preserveCDATA; + /* //create instance of expat parser (should be included in php distro) if (version_compare(phpversion(), '5.0', '<=')) { $parser = xml_parser_create(''); + } else { + // special handling for encoding support + if (defined( '_ISO' )) { + $iso = explode( '=', _ISO ); + $parser = xml_parser_create($iso[1]); + } else { + $parser = xml_parser_create(); + } } - else { - $parser = xml_parser_create(); + */ + + //create instance of expat parser (should be included in php distro) + if (version_compare(phpversion(), '5.0', '<=')) { + $parser = xml_parser_create(''); + } else { + $parser = xml_parser_create('iso-8859-1'); } //set handlers for SAX events diff -urN joomla-1.0.7/includes/domit/xml_domit_parser.php joomla-1.0.10/includes/domit/xml_domit_parser.php --- joomla-1.0.7/includes/domit/xml_domit_parser.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/domit/xml_domit_parser.php 2006-06-25 16:54:15.000000000 -0400 @@ -3539,7 +3539,7 @@ } break; case 'commentElement($this, substr($data, 4, (strlen($data) - 7))); + $currentNode = $this->commentElement($this, substr($data, 4, (strlen($data) - 7))); break; case 'parseItem = 'doctype'; diff -urN joomla-1.0.7/includes/feedcreator.class.php joomla-1.0.10/includes/feedcreator.class.php --- joomla-1.0.7/includes/feedcreator.class.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/feedcreator.class.php 2006-06-25 16:54:18.000000000 -0400 @@ -27,12 +27,18 @@ Changelog: +v1.7.2 Joomla! 1.0.8 +12-Feb-2005 Rey Gigataras + - Fixed artf3438 : RSS Feed Created it not base on the same encoding of the content + v1.7.2 Joomla! 1.0 15-Sep-2005 Rey Gigataras ^ Added publish date to syndicated feeds output [credit: gharding] ^ Added RSS Enclosure support to feedcreator [credit: Joseph L. LeBlanc] ^ Added Google Sitemap support to feedcreator +********************************* + v1.7.2 10-11-04 license changed to LGPL @@ -161,12 +167,15 @@ * A little setup * **************************************************************************/ +// no direct access +defined( '_VALID_MOS' ) or die( 'Restricted access' ); + + // your local timezone, set to "" to disable or for GMT define("TIME_ZONE","+01:00"); - /** * Version string. **/ @@ -408,7 +417,7 @@ $vars = get_object_vars($this); foreach ($vars as $key => $value) { // prevent overwriting of properties "contentType", "encoding"; do not copy "_feed" itself - if (!in_array($key, array("_feed", "contentType", "encoding"))) { + if (!in_array($key, array("_feed", "contentType"))) { $this->_feed->{$key} = $this->{$key}; } } diff -urN joomla-1.0.7/includes/footer.php joomla-1.0.10/includes/footer.php --- joomla-1.0.7/includes/footer.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/footer.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@
    - (C) + ©
    diff -urN joomla-1.0.7/includes/frontend.html.php joomla-1.0.10/includes/frontend.html.php --- joomla-1.0.7/includes/frontend.html.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/frontend.html.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ get( 'moduleclass_sfx' ); $rssurl = $params->get( 'rssurl' ); @@ -29,6 +31,19 @@ modules_html::modoutput_feed( $module, $params, $moduleclass_sfx ); } + if ($module->content != '') { + // mambot handling for custom modules + // load content bots + $_MAMBOTS->loadBotGroup( 'content' ); + + $row = $module; + $row->text = $module->content; + + $results = $_MAMBOTS->trigger( 'onPrepareContent', array( &$row, &$params, 0 ), true ); + + $module->content = $row->text; + } + switch ( $style ) { case -3: // allows for rounded corners @@ -106,8 +121,15 @@ // feed output function modoutput_feed( &$module, &$params, $moduleclass_sfx ) { - global $mosConfig_absolute_path, $rssfeed_content; + global $mosConfig_absolute_path, $mosConfig_cachepath; + // check if cache directory is writeable + $cacheDir = $mosConfig_cachepath .'/'; + if ( !is_writable( $cacheDir ) ) { + $module->content = 'Cache Directory Unwriteable'; + return; + } + $rssurl = $params->get( 'rssurl' ); $rssitems = $params->get( 'rssitems', 5 ); $rssdesc = $params->get( 'rssdesc', 1 ); @@ -115,134 +137,148 @@ $rssitemdesc = $params->get( 'rssitemdesc', 1 ); $words = $params->def( 'word_count', 0 ); $rsstitle = $params->get( 'rsstitle', 1 ); + $rsscache = $params->get( 'rsscache', 3600 ); $contentBuffer = ''; - $cacheDir = $mosConfig_absolute_path .'/cache/'; + $LitePath = $mosConfig_absolute_path .'/includes/Cache/Lite.php'; require_once( $mosConfig_absolute_path .'/includes/domit/xml_domit_rss.php' ); + $rssDoc = new xml_domit_rss_document(); - $rssDoc->useCacheLite(true, $LitePath, $cacheDir, 3600); - $rssDoc->loadRSS( $rssurl ); - $totalChannels = $rssDoc->getChannelCount(); - - for ( $i = 0; $i < $totalChannels; $i++ ) { - $currChannel =& $rssDoc->getChannel($i); - $elements = $currChannel->getElementList(); - $iUrl = 0; - foreach ( $elements as $element ) { - //image handling - if ( $element == 'image' ) { - $image =& $currChannel->getElement( DOMIT_RSS_ELEMENT_IMAGE ); - $iUrl = $image->getUrl(); - $iTitle = $image->getTitle(); - } - } + $rssDoc->useCacheLite(true, $LitePath, $cacheDir, $rsscache); + $success = $rssDoc->loadRSS( $rssurl ); - // feed title - $content_buffer = '' . "\n"; - - if ( $currChannel->getTitle() && $rsstitle ) { - - $content_buffer .= "\n"; - $content_buffer .= " \n"; - $content_buffer .= "\n"; - - } - - // feed description - if ( $rssdesc ) { + if ( $success ) { + $content_buffer = ''; + $totalChannels = $rssDoc->getChannelCount(); + + for ( $i = 0; $i < $totalChannels; $i++ ) { + $currChannel =& $rssDoc->getChannel($i); + $elements = $currChannel->getElementList(); + $iUrl = 0; + foreach ( $elements as $element ) { + //image handling + if ( $element == 'image' ) { + $image =& $currChannel->getElement( DOMIT_RSS_ELEMENT_IMAGE ); + $iUrl = $image->getUrl(); + $iTitle = $image->getTitle(); + } + } + + // feed title + $content_buffer = '
    \n"; - $content_buffer .= " \n"; - $content_buffer .= " getLink() ) . "\" target=\"_blank\">\n"; - $content_buffer .= $currChannel->getTitle() . "\n"; - $content_buffer .= " \n"; - $content_buffer .= "
    ' . "\n"; + + if ( $currChannel->getTitle() && $rsstitle ) { + $feed_title = $currChannel->getTitle(); + $feed_title = mosCommonHTML::newsfeedEncoding( $rssDoc, $feed_title ); + + $content_buffer .= "\n"; + $content_buffer .= " \n"; + $content_buffer .= "\n"; + + } + + // feed description + if ( $rssdesc ) { + $feed_descrip = $currChannel->getDescription(); + $feed_descrip = mosCommonHTML::newsfeedEncoding( $rssDoc, $feed_descrip ); + + $content_buffer .= "\n"; + $content_buffer .= " \n"; + $content_buffer .= "\n"; + } + + // feed image + if ( $rssimage && $iUrl ) { + $content_buffer .= "\n"; + $content_buffer .= " \n"; + $content_buffer .= "\n"; + } + + $actualItems = $currChannel->getItemCount(); + $setItems = $rssitems; + + if ($setItems > $actualItems) { + $totalItems = $actualItems; + } else { + $totalItems = $setItems; + } + + $content_buffer .= "\n"; $content_buffer .= " \n"; - $content_buffer .= "\n"; - } - - // feed image - if ( $rssimage && $iUrl ) { - $content_buffer .= "\n"; - $content_buffer .= " \n"; - $content_buffer .= "\n"; - } - - $actualItems = $currChannel->getItemCount(); - $setItems = $rssitems; - - if ($setItems > $actualItems) { - $totalItems = $actualItems; - } else { - $totalItems = $setItems; - } - - - $content_buffer .= "\n"; - $content_buffer .= " \n"; - $content_buffer .= "\n"; - $content_buffer .= "
    \n"; + $content_buffer .= " \n"; + $content_buffer .= " getLink() ) . "\" target=\"_blank\">\n"; + $content_buffer .= $feed_title . "\n"; + $content_buffer .= " \n"; + $content_buffer .= "
    \n"; + $content_buffer .= $feed_descrip; + $content_buffer .= "
    \n"; + $content_buffer .= " \""\n"; + $content_buffer .= "
    \n"; - $content_buffer .= $currChannel->getDescription(); - $content_buffer .= "
    \n"; - $content_buffer .= " \""\n"; - $content_buffer .= "
    \n"; - $content_buffer .= "
      \n"; - - for ($j = 0; $j < $totalItems; $j++) { - $currItem =& $currChannel->getItem($j); - // item title - - // START fix for RSS enclosure tag url not showing - $content_buffer .= "
    • \n"; - $content_buffer .= " \n"; - if ($currItem->getLink()) { - $content_buffer .= " getLink() ) . "\" target=\"_blank\">\n"; - $content_buffer .= " " . str_replace(''', "'", html_entity_decode( $currItem->getTitle() ) ) . "\n"; - } else if ($currItem->getEnclosure()) { - $enclosure = $currItem->getEnclosure(); - $eUrl = $enclosure->getUrl(); - $content_buffer .= " \n"; - $content_buffer .= " " . str_replace(''', "'", html_entity_decode( $currItem->getTitle() ) ) . "\n"; - } else if (($currItem->getEnclosure()) && ($currItem->getLink())) { - $enclosure = $currItem->getEnclosure(); - $eUrl = $enclosure->getUrl(); - $content_buffer .= " getLink() ) . "\" target=\"_blank\">\n"; - $content_buffer .= " " . str_replace(''', "'", html_entity_decode( $currItem->getTitle() ) ) . "
      \n"; - $content_buffer .= " Download\n"; - } - $content_buffer .= "
      \n"; - // END fix for RSS enclosure tag url not showing - - // item description - if ( $rssitemdesc ) { + $content_buffer .= "
        \n"; + + for ($j = 0; $j < $totalItems; $j++) { + $currItem =& $currChannel->getItem($j); + // item title + + $item_title = $currItem->getTitle(); + $item_title = mosCommonHTML::newsfeedEncoding( $rssDoc, $item_title ); + + // START fix for RSS enclosure tag url not showing + $content_buffer .= "
      • \n"; + $content_buffer .= " \n"; + if ($currItem->getLink()) { + $content_buffer .= " getLink() ) . "\" target=\"_blank\">\n"; + $content_buffer .= " " . $item_title . "\n"; + } else if ($currItem->getEnclosure()) { + $enclosure = $currItem->getEnclosure(); + $eUrl = $enclosure->getUrl(); + $content_buffer .= " \n"; + $content_buffer .= " " . $item_title . "\n"; + } else if (($currItem->getEnclosure()) && ($currItem->getLink())) { + $enclosure = $currItem->getEnclosure(); + $eUrl = $enclosure->getUrl(); + $content_buffer .= " getLink() ) . "\" target=\"_blank\">\n"; + $content_buffer .= " " . $item_title . "
        \n"; + $content_buffer .= " Download\n"; + } + $content_buffer .= "
        \n"; + // END fix for RSS enclosure tag url not showing + // item description - $text = html_entity_decode( $currItem->getDescription() ); - $text = str_replace(''', "'", $text); - - // word limit check - if ( $words ) { - $texts = explode( ' ', $text ); - $count = count( $texts ); - if ( $count > $words ) { - $text = ''; - for( $i=0; $i < $words; $i++ ) { - $text .= ' '. $texts[$i]; + if ( $rssitemdesc ) { + // item description + $text = $currItem->getDescription(); + $text = mosCommonHTML::newsfeedEncoding( $rssDoc, $text ); + + // word limit check + if ( $words ) { + $texts = explode( ' ', $text ); + $count = count( $texts ); + if ( $count > $words ) { + $text = ''; + for( $i=0; $i < $words; $i++ ) { + $text .= ' '. $texts[$i]; + } + $text .= '...'; } - $text .= '...'; } + + $content_buffer .= "
        \n"; + $content_buffer .= " " . $text; + $content_buffer .= "
        \n"; + } - - $content_buffer .= "
        \n"; - $content_buffer .= " " . $text; - $content_buffer .= "
        \n"; - - } - $content_buffer .= "
      • \n"; - } - $content_buffer .= "
      \n"; - $content_buffer .= "
    \n"; + $content_buffer .= "\n"; + } + $content_buffer .= " \n"; + $content_buffer .= "
    \n"; + } + $module->content = $content_buffer; } - $module->content = $content_buffer; } /* @@ -268,7 +304,7 @@ content; + modules_html::CustomContent( $module, $params); } else { include( $mosConfig_absolute_path . '/modules/' . $module->module . '.php' ); @@ -291,7 +327,7 @@ global $mainframe, $database, $my; if ( $type ) { - echo $module->content; + modules_html::CustomContent( $module, $params); } else { include( $mosConfig_absolute_path . '/modules/' . $module->module . '.php' ); @@ -320,7 +356,7 @@ } if ( $type ) { - echo $module->content; + modules_html::CustomContent( $module, $params); } else { include( $mosConfig_absolute_path . '/modules/' . $module->module . '.php' ); @@ -350,7 +386,7 @@ } if ( $type ) { - echo $module->content; + modules_html::CustomContent( $module, $params); } else { include( $mosConfig_absolute_path . '/modules/' . $module->module . '.php' ); @@ -365,5 +401,25 @@
    text = $module->content; + + $results = $_MAMBOTS->trigger( 'onBeforeDisplayContent', array( &$row, &$params, 0 ) ); + echo trim( implode( "\n", $results ) ); + + $module->content = $row->text; + + // output custom module contents + echo $module->content; + + $results = $_MAMBOTS->trigger( 'onAfterDisplayContent', array( &$row, &$params, 0 ) ); + echo trim( implode( "\n", $results ) ); + + $module->content = $row->text; + } } ?> \ No newline at end of file diff -urN joomla-1.0.7/includes/frontend.php joomla-1.0.10/includes/frontend.php --- joomla-1.0.7/includes/frontend.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/frontend.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ 150 ) { + $mosmsg = substr( $mosmsg, 0, 150 ); + } + + // mosmsg outputed within html + if ($mosmsg && !$popMessages && $browserCheck && $sessionCheck) { echo "\n
    $mosmsg
    "; } echo $GLOBALS['_MOS_OPTION']['buffer']; - if ($mosmsg && $popMessages) { + // mosmsg outputed in JS Popup + if ($mosmsg && $popMessages && $browserCheck && $sessionCheck) { echo "\n"; } } @@ -38,8 +59,10 @@ * Utility functions and classes */ function mosLoadComponent( $name ) { - // set up some global variables for use by the frontend component - global $mainframe, $database; + // set up some global variables for use by frontend components + global $mainframe, $database, $my, $acl; + global $task, $Itemid, $id, $option, $gid; + include( $mainframe->getCfg( 'absolute_path' )."/components/com_$name/$name.php" ); } /** @@ -50,17 +73,23 @@ global $database, $my, $Itemid; if (!isset( $GLOBALS['_MOS_MODULES'] )) { + $check_Itemid = ''; + if ($Itemid) { + $check_Itemid = "OR mm.menuid = $Itemid"; + } + $query = "SELECT id, title, module, position, content, showtitle, params" . "\n FROM #__modules AS m" . "\n INNER JOIN #__modules_menu AS mm ON mm.moduleid = m.id" . "\n WHERE m.published = 1" - . "\n AND m.access <= '". $my->gid ."'" + . "\n AND m.access <= $my->gid" . "\n AND m.client_id != 1" - . "\n AND ( mm.menuid = '". $Itemid ."' OR mm.menuid = 0 )" + . "\n AND ( mm.menuid = 0 $check_Itemid )" . "\n ORDER BY ordering"; $database->setQuery( $query ); $modules = $database->loadObjectList(); + foreach ($modules as $module) { $GLOBALS['_MOS_MODULES'][$module->position][] = $module; } @@ -73,7 +102,7 @@ function mosCountModules( $position='left' ) { global $database, $my, $Itemid; - $tp = mosGetParam( $_GET, 'tp', 0 ); + $tp = intval( mosGetParam( $_GET, 'tp', 0 ) ); if ($tp) { return 1; } @@ -92,7 +121,7 @@ function mosLoadModules( $position='left', $style=0 ) { global $mosConfig_gzip, $mosConfig_absolute_path, $database, $my, $Itemid, $mosConfig_caching; - $tp = mosGetParam( $_GET, 'tp', 0 ); + $tp = intval( mosGetParam( $_GET, 'tp', 0 ) ); if ($tp) { echo '
    '; echo $position; @@ -127,21 +156,26 @@ echo $prepend; - if ((substr("$module->module",0,4))=="mod_") { + if ((substr("$module->module",0,4))=='mod_') { + // normal modules if ($params->get('cache') == 1 && $mosConfig_caching == 1) { - $cache->call('modules_html::module2', $module, $params, $Itemid, $style ); + // module caching + $cache->call('modules_html::module2', $module, $params, $Itemid, $style, $my->gid ); } else { modules_html::module2( $module, $params, $Itemid, $style, $count ); } } else { + // custom or new modules if ($params->get('cache') == 1 && $mosConfig_caching == 1) { - $cache->call('modules_html::module', $module, $params, $Itemid, $style ); + // module caching + $cache->call('modules_html::module', $module, $params, $Itemid, $style, 0, $my->gid ); } else { modules_html::module( $module, $params, $Itemid, $style ); } } echo $postpend; + $count++; } if ($style == 1) { @@ -152,11 +186,9 @@ * Assembles head tags */ function mosShowHead() { - global $database, $option, $my, $mainframe, $_VERSION; + global $database, $option, $my, $mainframe, $_VERSION, $task, $id; global $mosConfig_MetaDesc, $mosConfig_MetaKeys, $mosConfig_live_site, $mosConfig_sef, $mosConfig_absolute_path, $mosConfig_sitename, $mosConfig_favicon; - $task = mosGetParam( $_REQUEST, 'task', '' ); - if ($my->id || $mainframe->get( 'joomlaJavascript' )) { ?> @@ -165,31 +197,61 @@ $mainframe->appendMetaTag( 'description', $mosConfig_MetaDesc ); $mainframe->appendMetaTag( 'keywords', $mosConfig_MetaKeys ); - $mainframe->addMetaTag( 'Generator', $_VERSION->PRODUCT . " - " . $_VERSION->COPYRIGHT); + $mainframe->addMetaTag( 'Generator', $_VERSION->PRODUCT . ' - ' . $_VERSION->COPYRIGHT); $mainframe->addMetaTag( 'robots', 'index, follow' ); - echo $mainframe->getHead(); - + // cache activation + // echo $mainframe->getHead(); + $cache =& mosCache::getCache('com_content'); + echo $cache->call('mainframe->getHead', $_SERVER['QUERY_STRING'], $id); + if ( isset($mosConfig_sef) && $mosConfig_sef ) { echo "\r\n"; } - // support for Firefox Live Bookmarks ability for site syndication - $query = "SELECT a.id" + $row = new mosComponent( $database ); + $query = "SELECT a.*" . "\n FROM #__components AS a" - . "\n WHERE a.name = 'Syndicate'" + . "\n WHERE ( a.admin_menu_link = 'option=com_syndicate' OR a.admin_menu_link = 'option=com_syndicate&hidemainmenu=1' )" + . "\n AND a.option = 'com_syndicate'" ; $database->setQuery( $query ); - $id = $database->loadResult(); - - // load the row from the db table - $row = new mosComponent( $database ); - $row->load( $id ); - + $database->loadObject( $row ); + // get params definitions - $params = new mosParameters( $row->params, $mainframe->getPath( 'com_xml', $row->option ), 'component' ); + $syndicateParams = new mosParameters( $row->params, $mainframe->getPath( 'com_xml', $row->option ), 'component' ); + + // needed to reduce query + $GLOBALS['syndicateParams'] = $syndicateParams; - $live_bookmark = $params->get( 'live_bookmark', 0 ); + $live_bookmark = $syndicateParams->get( 'live_bookmark', 0 ); + + // and to allow disabling/enabling of selected feed types + switch ( $live_bookmark ) { + case 'RSS0.91': + if ( !$syndicateParams->get( 'rss091', 1 ) ) { + $live_bookmark = 0; + } + break; + + case 'RSS1.0': + if ( !$syndicateParams->get( 'rss10', 1 ) ) { + $live_bookmark = 0; + } + break; + + case 'RSS2.0': + if ( !$syndicateParams->get( 'rss20', 1 ) ) { + $live_bookmark = 0; + } + break; + + case 'ATOM0.3': + if ( !$syndicateParams->get( 'atom03', 1 ) ) { + $live_bookmark = 0; + } + break; + } // support for Live Bookmarks ability for site syndication if ($live_bookmark) { @@ -200,8 +262,25 @@ // xhtml check $link_file = ampReplace( $link_file ); + // security chcek + $check = $syndicateParams->def( 'check', 1 ); + if($check) { + // test if rssfeed module is published + // if not disable access + $query = "SELECT m.id" + . "\n FROM #__modules AS m" + . "\n WHERE m.module = 'mod_rssfeed'" + . "\n AND m.published = 1" + ; + $database->setQuery( $query ); + $check = $database->loadResultArray(); + if(empty($check)) { + $show = 0; + } + } // outputs link tag for page if ($show) { + // test if security check is enbled ?> _cache = new Cache_Lite_Function( $options ); + } + + /** + * Calls a cacheable function or method (or not if there is already a cache for it) + * + * This overwritten method addes automatically special arguments to the call + * Those arguments are e.g. the language if multilingual support is activated + * + * @return mixed result of the function/method + * @access public + */ + function call() { + $arguments = func_get_args(); + + // Add language to all arguments, if not already added and multilingual support is activated + if( key_exists( 'mosConfig_multilingual_support', $GLOBALS ) && $GLOBALS['mosConfig_multilingual_support'] == 1 ) { + $arguments[] = $GLOBALS['mosConfig_lang']; + } + + $ret = call_user_func_array(array($this->_cache, 'call'), $arguments); + return $ret; + } + + /** + * Clean the cache + * + * if no group is specified all cache files will be destroyed + * else only cache files of the specified group will be destroyed + * + * @param string $group name of the cache group + * @return boolean true if no problem + * @access public + */ + function clean($group = false) { + return $this->_cache->clean( $group ); + } +} +?> \ No newline at end of file diff -urN joomla-1.0.7/includes/joomla.php joomla-1.0.10/includes/joomla.php --- joomla-1.0.7/includes/joomla.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/joomla.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ 0) { error_reporting( $mosConfig_error_reporting ); @@ -87,6 +87,40 @@ $database->debug( $mosConfig_debug ); $acl = new gacl_api(); +// platform neurtral url handling +if ( isset( $_SERVER['REQUEST_URI'] ) ) { + $request_uri = $_SERVER['REQUEST_URI']; +} else { + $request_uri = $_SERVER['SCRIPT_NAME']; + // Append the query string if it exists and isn't null + if ( isset( $_SERVER['QUERY_STRING'] ) && !empty( $_SERVER['QUERY_STRING'] ) ) { + $request_uri .= '?' . $_SERVER['QUERY_STRING']; + } +} +$_SERVER['REQUEST_URI'] = $request_uri; + +// current server time +$now = date( 'Y-m-d H:i', time() ); +DEFINE( '_CURRENT_SERVER_TIME', $now ); +DEFINE( '_CURRENT_SERVER_TIME_FORMAT', '%Y-%m-%d %H:%M:%S' ); + +// Non http/https URL Schemes +$url_schemes = 'data:, file:, ftp:, gopher:, imap:, ldap:, mailto:, news:, nntp:, telnet:, javascript:, irc:'; +DEFINE( '_URL_SCHEMES', $url_schemes ); + +// disable strict mode in MySQL 5 +if (!defined( '_JOS_SET_SQLMODE' )) { + /** ensure that functions are declared only once */ + define( '_JOS_SET_SQLMODE', 1 ); + + // if running mysql 5, set sql-mode to mysql40 - thereby circumventing strict mode problems + if ( strpos( $database->getVersion(), '5' ) === 0 ) { + $query = "SET sql_mode = 'MYSQL40'"; + $database->setQuery( $query ); + $database->query(); + } +} + /** * @package Joomla * @abstract @@ -167,7 +201,7 @@ * @param string Set the default task */ function mosAbstractTasker( $default='' ) { - $taskMap = array(); + $this->_taskMap = array(); $this->_methods = array(); foreach (get_class_methods( get_class( $this ) ) as $method) { if (substr( $method, 0, 1 ) != '_') { @@ -307,8 +341,6 @@ return null; } } - - /** * Class to support function caching * @package Joomla @@ -320,7 +352,7 @@ function &getCache( $group='' ) { global $mosConfig_absolute_path, $mosConfig_caching, $mosConfig_cachepath, $mosConfig_cachetime; - require_once( $mosConfig_absolute_path . '/includes/Cache/Lite/Function.php' ); + require_once( $mosConfig_absolute_path . '/includes/joomla.cache.php' ); $options = array( 'cacheDir' => $mosConfig_cachepath . '/', @@ -328,7 +360,7 @@ 'defaultGroup' => $group, 'lifeTime' => $mosConfig_cachetime ); - $cache = new Cache_Lite_Function( $options ); + $cache = new JCache_Lite_Function( $options ); return $cache; } /** @@ -350,23 +382,24 @@ */ class mosMainFrame { /** @var database Internal database class pointer */ - var $_db = null; + var $_db = null; /** @var object An object of configuration variables */ - var $_config = null; + var $_config = null; /** @var object An object of path variables */ - var $_path = null; + var $_path = null; /** @var mosSession The current session */ - var $_session = null; + var $_session = null; /** @var string The current template */ - var $_template = null; + var $_template = null; /** @var array An array to hold global user state within a session */ - var $_userstate = null; + var $_userstate = null; /** @var array An array of page meta information */ - var $_head = null; + var $_head = null; /** @var string Custom html string to append to the pathway */ - var $_custom_pathway = null; + var $_custom_pathway = null; /** @var boolean True if in the admin client */ - var $_isAdmin = false; + var $_isAdmin = false; + /** * Class constructor @@ -392,6 +425,9 @@ //set the admin check $this->_isAdmin = (boolean) $isAdmin; + + $now = date( 'Y-m-d H:i:s', time() ); + $this->set( 'now', $now ); } /** @@ -467,6 +503,7 @@ function setPageTitle( $title=null ) { if (@$GLOBALS['mosConfig_pagetitles']) { $title = trim( htmlspecialchars( $title ) ); + $title = stripslashes($title); $this->_head['title'] = $title ? $GLOBALS['mosConfig_sitename'] . ' - '. $title : $GLOBALS['mosConfig_sitename']; } } @@ -550,6 +587,8 @@ } return implode( "\n", $head ) . "\n"; } + + /** * @return string */ @@ -591,7 +630,12 @@ $this->setUserState( $var_name, $_REQUEST[$req_name] ); } else if (!isset( $this->_userstate[$var_name] )) { $this->setUserState( $var_name, $var_default ); - } + } + + // filter input + $iFilter = new InputFilter(); + $this->_userstate[$var_name] = $iFilter->process( $this->_userstate[$var_name] ); + return $this->_userstate[$var_name]; } else { return null; @@ -616,40 +660,322 @@ * the jos_sessions table. */ function initSession() { - $session =& $this->_session; - $session = new mosSession( $this->_db ); - $session->purge(intval( $this->getCfg( 'lifetime' ) )); - - $sessionCookieName = md5( 'site'.$GLOBALS['mosConfig_live_site'] ); + // initailize session variables + $session =& $this->_session; + $session = new mosSession( $this->_db ); + + // purge expired sessions + $session->purge('core'); - $sessioncookie = mosGetParam( $_COOKIE, $sessionCookieName, null ); - $usercookie = mosGetParam( $_COOKIE, 'usercookie', null ); + // Session Cookie `name` + $sessionCookieName = mosMainFrame::sessionCookieName(); + // Get Session Cookie `value` + $sessioncookie = strval( mosGetParam( $_COOKIE, $sessionCookieName, null ) ); + + // Session ID / `value` + $sessionValueCheck = mosMainFrame::sessionCookieValue( $sessioncookie ); - if ($session->load( md5( $sessioncookie . $_SERVER['REMOTE_ADDR'] ) )) { - // Session cookie exists, update time in session table + // Check if existing session exists in db corresponding to Session cookie `value` + // extra check added in 1.0.8 to test sessioncookie value is of correct length + if ( $sessioncookie && strlen($sessioncookie) == 32 && $sessioncookie != '-' && $session->load($sessionValueCheck) ) { + // update time in session table $session->time = time(); $session->update(); } else { - $session->generateId(); - $session->guest = 1; - $session->username = ''; - $session->time = time(); - $session->gid = 0; - - if (!$session->insert()) { - die( $session->getError() ); - } - - setcookie( $sessionCookieName, $session->getCookie(), time() + 43200, '/' ); - //$_COOKIE["sessioncookie"] = $session->getCookie(); - - if ($usercookie) { - // Remember me cookie exists. Login with usercookie info. - $this->login($usercookie['username'], $usercookie['password']); + // Remember Me Cookie `name` + $remCookieName = mosMainFrame::remCookieName_User(); + + // test if cookie found + $cookie_found = false; + if ( isset($_COOKIE[$sessionCookieName]) || isset($_COOKIE[$remCookieName]) || isset($_POST['force_session']) ) { + $cookie_found = true; + } + + // check if neither remembermecookie or sessioncookie found + if (!$cookie_found) { + // create sessioncookie and set it to a test value set to expire on session end + setcookie( $sessionCookieName, '-', false, '/' ); + } else { + // otherwise, sessioncookie was found, but set to test val or the session expired, prepare for session registration and register the session + $url = strval( mosGetParam( $_SERVER, 'REQUEST_URI', null ) ); + // stop sessions being created for requests to syndicated feeds + if ( strpos( $url, 'option=com_rss' ) === false && strpos( $url, 'feed=' ) === false ) { + $session->guest = 1; + $session->username = ''; + $session->time = time(); + $session->gid = 0; + // Generate Session Cookie `value` + $session->generateId(); + + if (!$session->insert()) { + die( $session->getError() ); + } + + // create Session Tracking Cookie set to expire on session end + setcookie( $sessionCookieName, $session->getCookie(), false, '/' ); + } + } + + // Cookie used by Remember me functionality + $remCookieValue = strval( mosGetParam( $_COOKIE, $remCookieName, null ) ); + + // test if cookie is correct length + if ( strlen($remCookieValue) > 64 ) { + // Separate Values from Remember Me Cookie + $remUser = substr( $remCookieValue, 0, 32 ); + $remPass = substr( $remCookieValue, 32, 32 ); + $remID = intval( substr( $remCookieValue, 64 ) ); + + // check if Remember me cookie exists. Login with usercookie info. + if ( strlen($remUser) == 32 && strlen($remPass) == 32 ) { + $this->login( $remUser, $remPass, 1, $remID ); + } } } } + + /* + * Function used to conduct admin session duties + * Added as of 1.0.8 + * Deperciated 1.1 + */ + function initSessionAdmin($option, $task) { + global $_VERSION, $mosConfig_admin_expired; + + // logout check + if ($option == 'logout') { + require $GLOBALS['mosConfig_absolute_path'] .'/administrator/logout.php'; + exit(); + } + + $site = $GLOBALS['mosConfig_live_site']; + + // check if session name corresponds to correct format + if ( session_name() != md5( $site ) ) { + echo "\n"; + exit(); + } + // restore some session variables + $my = new mosUser( $this->_db ); + $my->id = intval( mosGetParam( $_SESSION, 'session_user_id', '' ) ); + $my->username = strval( mosGetParam( $_SESSION, 'session_username', '' ) ); + $my->usertype = strval( mosGetParam( $_SESSION, 'session_usertype', '' ) ); + $my->gid = intval( mosGetParam( $_SESSION, 'session_gid', '' ) ); + $my->params = mosGetParam( $_SESSION, 'session_user_params', '' ); + + $session_id = mosGetParam( $_SESSION, 'session_id', '' ); + $logintime = mosGetParam( $_SESSION, 'session_logintime', '' ); + + // check to see if session id corresponds with correct format + if ( $session_id == md5( $my->id . $my->username . $my->usertype . $logintime ) ) { + // if task action is to `save` or `apply` complete action before doing session checks. + if ($task != 'save' && $task != 'apply') { + // test for session_life_admin + if ( @$GLOBALS['mosConfig_session_life_admin'] ) { + $session_life_admin = $GLOBALS['mosConfig_session_life_admin']; + } else { + $session_life_admin = 1800; + } + + // purge expired admin sessions only + $past = time() - $session_life_admin; + $query = "DELETE FROM #__session" + . "\n WHERE time < '$past'" + . "\n AND guest = 1" + . "\n AND gid = 0" + . "\n AND userid <> 0" + ; + $this->_db->setQuery( $query ); + $this->_db->query(); + + // update session timestamp + $current_time = time(); + $query = "UPDATE #__session" + . "\n SET time = '$current_time'" + . "\n WHERE session_id = '$session_id'" + ; + $this->_db->setQuery( $query ); + $this->_db->query(); + + // set garbage cleaning timeout + $this->setSessionGarbageClean(); + + // check against db record of session + $query = "SELECT COUNT( session_id )" + . "\n FROM #__session" + . "\n WHERE session_id = '$session_id'" + . "\n AND username = ". $this->_db->Quote( $my->username ) + . "\n AND userid = ". intval( $my->id ) + ; + $this->_db->setQuery( $query ); + $count = $this->_db->loadResult(); + + // if no entry in session table that corresponds boot from admin area + if ( $count == 0 ) { + $link = NULL; + + if ($_SERVER['QUERY_STRING']) { + $link = 'index2.php?'. $_SERVER['QUERY_STRING']; + } + + // check if site designated as a production site + // for a demo site disallow expired page functionality + // link must also be a Joomla link to stop malicious redirection + if ( $link && strpos( $link, 'index2.php?option=com_' ) === 0 && $_VERSION->SITE == 1 && @$mosConfig_admin_expired === '1' ) { + $now = time(); + + $file = $this->getPath( 'com_xml', 'com_users' ); + $params =& new mosParameters( $my->params, $file, 'component' ); + + // return to expired page functionality + $params->set( 'expired', $link ); + $params->set( 'expired_time', $now ); + + // param handling + if (is_array( $params->toArray() )) { + $txt = array(); + foreach ( $params->toArray() as $k=>$v) { + $txt[] = "$k=$v"; + } + $saveparams = implode( "\n", $txt ); + } + + // save expired page info to user data + $query = "UPDATE #__users" + . "\n SET params = '$saveparams'" + . "\n WHERE id = $my->id" + . "\n AND username = '$my->username'" + . "\n AND usertype = '$my->usertype'" + ; + $this->_db->setQuery( $query ); + $this->_db->query(); + } + + echo "\n"; + exit(); + } + } + } else if ($session_id == '') { + // no session_id as user has person has not attempted to login + echo "\n"; + exit(); + } else { + // session id does not correspond to required session format + echo "\n"; + exit(); + } + + return $my; + } + + /* + * Function used to set Session Garbage Cleaning + * garbage cleaning set at configured session time + 600 seconds + * Added as of 1.0.8 + * Deperciated 1.1 + */ + function setSessionGarbageClean() { + /** ensure that funciton is only called once */ + if (!defined( '_JOS_GARBAGECLEAN' )) { + define( '_JOS_GARBAGECLEAN', 1 ); + + $garbage_timeout = $this->getCfg('session_life_admin') + 600; + @ini_set('session.gc_maxlifetime', $garbage_timeout); + } + } + + /* + * Static Function used to generate the Session Cookie Name + * Added as of 1.0.8 + * Deperciated 1.1 + */ + function sessionCookieName() { + global $mainframe; + + return md5( 'site' . $mainframe->getCfg( 'live_site' ) ); + } + + /* + * Static Function used to generate the Session Cookie Value + * Added as of 1.0.8 + * Deperciated 1.1 + */ + function sessionCookieValue( $id=null ) { + global $mainframe; + + $type = $mainframe->getCfg( 'session_type' ); + + $browser = @$_SERVER['HTTP_USER_AGENT']; + + switch ($type) { + case 2: + // 1.0.0 to 1.0.7 Compatibility + // lowest level security + $value = md5( $id . $_SERVER['REMOTE_ADDR'] ); + break; + + case 1: + // slightly reduced security - 3rd level IP authentication for those behind IP Proxy + $remote_addr = explode('.',$_SERVER['REMOTE_ADDR']); + $ip = $remote_addr[0] .'.'. $remote_addr[1] .'.'. $remote_addr[2]; + $value = mosHash( $id . $ip . $browser ); + break; + + default: + // Highest security level - new default for 1.0.8 and beyond + $ip = $_SERVER['REMOTE_ADDR']; + $value = mosHash( $id . $ip . $browser ); + break; + } + + return $value; + } + + /* + * Static Function used to generate the Rememeber Me Cookie Name for Username information + * Added as of 1.0.8 + * Depreciated 1.1 + */ + function remCookieName_User() { + $value = mosHash( 'remembermecookieusername'. mosMainFrame::sessionCookieName() ); + + return $value; + } + + /* + * Static Function used to generate the Rememeber Me Cookie Name for Password information + * Added as of 1.0.8 + * Depreciated 1.1 + */ + function remCookieName_Pass() { + $value = mosHash( 'remembermecookiepassword'. mosMainFrame::sessionCookieName() ); + + return $value; + } + + /* + * Static Function used to generate the Remember Me Cookie Value for Username information + * Added as of 1.0.8 + * Depreciated 1.1 + */ + function remCookieValue_User( $username ) { + $value = md5( $username . mosHash( @$_SERVER['HTTP_USER_AGENT'] ) ); + + return $value; + } + + /* + * Static Function used to generate the Remember Me Cookie Value for Password information + * Added as of 1.0.8 + * Depreciated 1.1 + */ + function remCookieValue_Pass( $passwd ) { + $value = md5( $passwd . mosHash( @$_SERVER['HTTP_USER_AGENT'] ) ); + + return $value; + } + /** * Login validation function * @@ -657,55 +983,108 @@ * table. A successful validation updates the current session record with * the users details. */ - function login( $username=null,$passwd=null ) { - global $acl; - - $usercookie = mosGetParam( $_COOKIE, 'usercookie', '' ); - $sessioncookie = mosGetParam( $_COOKIE, 'sessioncookie', '' ); + function login( $username=null,$passwd=null, $remember=0, $userid=NULL ) { + global $acl, $_VERSION; + + $bypost = 0; + + // if no username and password passed from function, then function is being called from login module/component if (!$username || !$passwd) { - $username = mosGetParam( $_POST, 'username', '' ); - $passwd = mosGetParam( $_POST, 'passwd', '' ); + $username = strval( mosGetParam( $_POST, 'username', '' ) ); + $passwd = strval( mosGetParam( $_POST, 'passwd', '' ) ); $passwd = md5( $passwd ); + $bypost = 1; + + // Session Cookie `name` + $sessionCookieName = mosMainFrame::sessionCookieName(); + // Get Session Cookie `value` + $sessioncookie = strval( mosGetParam( $_COOKIE, $sessionCookieName, null ) ); + // extra check to ensure that Joomla! sessioncookie exists + if (!($sessioncookie == '-' || strlen($sessioncookie) == 32)) { + header( 'HTTP/1.0 403 Forbidden' ); + mosErrorAlert( _NOT_AUTH ); + return; + } + + josSpoofCheck(NULL,1); } - $remember = mosGetParam( $_POST, 'remember', '' ); + $row = null; if (!$username || !$passwd) { echo "\n"; exit(); } else { - $query = "SELECT *" - . "\n FROM #__users" - . "\n WHERE username = '$username'" - . "\n AND password = '$passwd'" - ; - $this->_db->setQuery( $query ); - $row = null; - if ($this->_db->loadObject( $row )) { + if ( $remember && strlen($username) == 32 && strlen($passwd) == 32 && $userid ) { + // query used for remember me cookie + $harden = mosHash( @$_SERVER['HTTP_USER_AGENT'] ); + + $query = "SELECT id, name, username, password, usertype, block, gid" + . "\n FROM #__users" + . "\n WHERE id = $userid" + ; + $this->_db->setQuery( $query ); + $this->_db->loadObject($user); + + $check_username = md5( $user->username . $harden ); + $check_password = md5( $user->password . $harden ); + + if ( $check_username == $username && $check_password == $passwd ) { + $row = $user; + } + } else { + // query used for login via login module + $query = "SELECT id, name, username, password, usertype, block, gid" + . "\n FROM #__users" + . "\n WHERE username = '$username'" + . "\n AND password = '$passwd'" + ; + $this->_db->setQuery( $query ); + $this->_db->loadObject( $row ); + } + + if (is_object($row)) { + // user blocked from login if ($row->block == 1) { mosErrorAlert(_LOGIN_BLOCKED); } + // fudge the group stuff $grp = $acl->getAroGroup( $row->id ); $row->gid = 1; - - if ($acl->is_group_child_of( $grp->name, 'Registered', 'ARO' ) || - $acl->is_group_child_of( $grp->name, 'Public Backend', 'ARO' )) { + if ($acl->is_group_child_of( $grp->name, 'Registered', 'ARO' ) || $acl->is_group_child_of( $grp->name, 'Public Backend', 'ARO' )) { // fudge Authors, Editors, Publishers and Super Administrators into the Special Group $row->gid = 2; } $row->usertype = $grp->name; - $session =& $this->_session; - $session->guest = 0; - $session->username = $username; - $session->userid = intval( $row->id ); - $session->usertype = $row->usertype; - $session->gid = intval( $row->gid ); - + // initialize session data + $session =& $this->_session; + $session->guest = 0; + $session->username = $row->username; + $session->userid = intval( $row->id ); + $session->usertype = $row->usertype; + $session->gid = intval( $row->gid ); $session->update(); - + + // check to see if site is a production site + // allows multiple logins with same user for a demo site + if ( $_VERSION->SITE ) { + // delete any old front sessions to stop duplicate sessions + $query = "DELETE FROM #__session" + . "\n WHERE session_id != '$session->session_id'" + . "\n AND username = '$row->username'" + . "\n AND userid = $row->id" + . "\n AND gid = $row->gid" + . "\n AND guest = 0" + ; + $this->_db->setQuery( $query ); + $this->_db->query(); + } + + // update user visit data $currentDate = date("Y-m-d\TH:i:s"); + $query = "UPDATE #__users" . "\n SET lastvisitDate = '$currentDate'" . "\n WHERE id = $session->userid" @@ -715,49 +1094,53 @@ die($this->_db->stderr(true)); } - if ($remember=="yes") { - $lifetime = time() + 365*24*60*60; - setcookie( "usercookie[username]", $username, $lifetime, "/" ); - setcookie( "usercookie[password]", $passwd, $lifetime, "/" ); + // set remember me cookie if selected + $remember = strval( mosGetParam( $_POST, 'remember', '' ) ); + if ( $remember == 'yes' ) { + // cookie lifetime of 365 days + $lifetime = time() + 365*24*60*60; + $remCookieName = mosMainFrame::remCookieName_User(); + $remCookieValue = mosMainFrame::remCookieValue_User( $row->username ) . mosMainFrame::remCookieValue_Pass( $row->password ) . $row->id; + setcookie( $remCookieName, $remCookieValue, $lifetime, '/' ); } - //mosCache::cleanCache('com_content'); mosCache::cleanCache(); } else { - if (isset($bypost)) { + if ( $bypost ) { mosErrorAlert(_LOGIN_INCORRECT); } else { $this->logout(); - mosRedirect("index.php"); + mosRedirect('index.php'); } exit(); } } } + /** * User logout * * Reverts the current session record back to 'anonymous' parameters */ function logout() { - //mosCache::cleanCache('com_content'); mosCache::cleanCache(); - $session =& $this->_session; - - $session->guest = 1; - $session->username = ''; - $session->userid = ''; - $session->usertype = ''; - $session->gid = 0; + + $session =& $this->_session; + $session->guest = 1; + $session->username = ''; + $session->userid = ''; + $session->usertype = ''; + $session->gid = 0; $session->update(); - // this is daggy?? - $lifetime = time() - 1800; - setcookie( "usercookie[username]", " ", $lifetime, "/" ); - setcookie( "usercookie[password]", " ", $lifetime, "/" ); - setcookie( "usercookie", " ", $lifetime, "/" ); + // kill remember me cookie + $lifetime = time() - 86400; + $remCookieName = mosMainFrame::remCookieName_User(); + setcookie( $remCookieName, ' ', $lifetime, '/' ); + @session_destroy(); } + /** * @return mosUser A user object with the information from the current session */ @@ -772,16 +1155,22 @@ $user->gid = intval( $this->_session->gid ); if ($user->id) { - $query = "SELECT params" + $query = "SELECT id, name, email, block, sendEmail, registerDate, lastvisitDate, activation, params" . "\n FROM #__users" . "\n WHERE id = ". intval( $user->id ) ; $database->setQuery( $query ); - $params = $database->loadResult(); - } else { - $params = ''; + $database->loadObject( $my ); + + $user->params = $my->params; + $user->name = $my->name; + $user->email = $my->email; + $user->block = $my->block; + $user->sendEmail = $my->sendEmail; + $user->registerDate = $my->registerDate; + $user->lastvisitDate = $my->lastvisitDate; + $user->activation = $my->activation; } - $user->params = $params; return $user; } @@ -801,30 +1190,7 @@ function _setTemplate( $isAdmin=false ) { global $Itemid; $mosConfig_absolute_path = $this->getCfg( 'absolute_path' ); -/* -Unneeded Query -http://developer.joomla.org/sf/go/artf1710?nav=1 - // Default template - $query = "SELECT template" - . "\n FROM #__templates_menu" - . "\n WHERE client_id = 0" - . "\n AND menuid = 0" - ; - $this->_db->setQuery( $query ); - $cur_template = $this->_db->loadResult(); - // Assigned template - if (isset($Itemid) && $Itemid!="" && $Itemid!=0) { - $query = "SELECT template" - . "\n FROM #__templates_menu" - . "\n WHERE client_id = 0" - . "\n AND menuid = $Itemid" - . "\n LIMIT 1" - ; - $this->_db->setQuery( $query ); - $cur_template = $this->_db->loadResult() ? $this->_db->loadResult() : $cur_template; - } -*/ if ($isAdmin) { $query = "SELECT template" . "\n FROM #__templates_menu" @@ -851,13 +1217,19 @@ $cur_template = $this->_db->loadResult(); // TemplateChooser Start - $jos_user_template = mosGetParam( $_COOKIE, 'jos_user_template', '' ); - $jos_change_template = mosGetParam( $_REQUEST, 'jos_change_template', $jos_user_template ); + $jos_user_template = strval( mosGetParam( $_COOKIE, 'jos_user_template', '' ) ); + $jos_change_template = strval( mosGetParam( $_REQUEST, 'jos_change_template', $jos_user_template ) ); if ($jos_change_template) { + // clean template name + $jos_change_template = preg_replace( '#\W#', '', $jos_change_template ); + if ( strlen( $jos_change_template ) >= 40 ) { + $jos_change_template = substr($jos_change_template, 0 , 39); + } + // check that template exists in case it was deleted if (file_exists( $mosConfig_absolute_path .'/templates/'. $jos_change_template .'/index.php' )) { - $lifetime = 60*10; - $cur_template = $jos_change_template; + $lifetime = 60*10; + $cur_template = $jos_change_template; setcookie( 'jos_user_template', "$jos_change_template", time()+$lifetime); } else { setcookie( 'jos_user_template', '', time()-3600 ); @@ -1022,11 +1394,11 @@ if (mosGetParam( $_COOKIE, 'mosvisitor', 0 )) { return; } - setcookie( "mosvisitor", "1" ); + setcookie( 'mosvisitor', 1 ); - if (phpversion() <= "4.2.1") { - $agent = getenv( "HTTP_USER_AGENT" ); - $domain = gethostbyaddr( getenv( "REMOTE_ADDR" ) ); + if (phpversion() <= '4.2.1') { + $agent = getenv( 'HTTP_USER_AGENT' ); + $domain = @gethostbyaddr( getenv( "REMOTE_ADDR" ) ); } else { if ( isset($_SERVER['HTTP_USER_AGENT']) ) { $agent = $_SERVER['HTTP_USER_AGENT']; @@ -1034,7 +1406,7 @@ $agent = 'Unknown'; } - $domain = gethostbyaddr( $_SERVER['REMOTE_ADDR'] ); + $domain = @gethostbyaddr( $_SERVER['REMOTE_ADDR'] ); } $browser = mosGetBrowser( $agent ); @@ -1122,176 +1494,324 @@ */ function getItemid( $id, $typed=1, $link=1, $bs=1, $bc=1, $gbs=1 ) { global $Itemid; - + $_Itemid = ''; - if ($_Itemid == '' && $typed) { - // Search for typed link - $query = "SELECT id" - . "\n FROM #__menu" - . "\n WHERE type = 'content_typed'" - . "\n AND published = 1" - . "\n AND link = 'index.php?option=com_content&task=view&id=$id'" - ; - $this->_db->setQuery( $query ); - $_Itemid = $this->_db->loadResult(); + + if ($_Itemid == '' && $typed && $this->getStaticContentCount()) { + $exists = 0; + foreach( $this->get( '_ContentTyped', array() ) as $key => $value ) { + // check if id has been tested before, if it is pull from class variable store + if ( $key == $id ) { + $_Itemid = $value; + $exists = 1; + break; + } + } + // if id hasnt been checked before initaite query + if ( !$exists ) { + // Search for typed link + $query = "SELECT id" + . "\n FROM #__menu" + . "\n WHERE type = 'content_typed'" + . "\n AND published = 1" + . "\n AND link = 'index.php?option=com_content&task=view&id=$id'" + ; + $this->_db->setQuery( $query ); + // pull existing query storage into temp variable + $ContentTyped = $this->get( '_ContentTyped', array() ); + // add query result to temp array storage + $ContentTyped[$id] = $this->_db->loadResult(); + // save temp array to main array storage + $this->set( '_ContentTyped', $ContentTyped ); + + $_Itemid = $ContentTyped[$id]; + } } - if ($_Itemid == '' && $link) { - // Search for item link - $query = "SELECT id" - ."\n FROM #__menu" - ."\n WHERE type = 'content_item_link'" - . "\n AND published = 1" - . "\n AND link = 'index.php?option=com_content&task=view&id=$id'" - ; - $this->_db->setQuery( $query ); - $_Itemid = $this->_db->loadResult(); + if ($_Itemid == '' && $link && $this->getContentItemLinkCount()) { + $exists = 0; + foreach( $this->get( '_ContentItemLink', array() ) as $key => $value ) { + // check if id has been tested before, if it is pull from class variable store + if ( $key == $id ) { + $_Itemid = $value; + $exists = 1; + break; + } + } + // if id hasnt been checked before initaite query + if ( !$exists ) { + // Search for item link + $query = "SELECT id" + ."\n FROM #__menu" + ."\n WHERE type = 'content_item_link'" + . "\n AND published = 1" + . "\n AND link = 'index.php?option=com_content&task=view&id=$id'" + ; + $this->_db->setQuery( $query ); + // pull existing query storage into temp variable + $ContentItemLink = $this->get( '_ContentItemLink', array() ); + // add query result to temp array storage + $ContentItemLink[$id] = $this->_db->loadResult(); + // save temp array to main array storage + $this->set( '_ContentItemLink', $ContentItemLink ); + + $_Itemid = $ContentItemLink[$id]; + } } - + if ($_Itemid == '') { - // Search in sections - $query = "SELECT m.id " - . "\n FROM #__content AS i" - . "\n LEFT JOIN #__sections AS s ON i.sectionid = s.id" - . "\n LEFT JOIN #__menu AS m ON m.componentid = s.id " - . "\n WHERE m.type = 'content_section'" - . "\n AND m.published = 1" - . "\n AND i.id = $id" - ; - $this->_db->setQuery( $query ); - $_Itemid = $this->_db->loadResult(); + $exists = 0; + foreach( $this->get( '_ContentSection', array() ) as $key => $value ) { + // check if id has been tested before, if it is pull from class variable store + if ( $key == $id ) { + $_Itemid = $value; + $exists = 1; + break; + } + } + // if id hasnt been checked before initaite query + if ( !$exists ) { + $query = "SELECT ms.id AS sid, ms.type AS stype, mc.id AS cid, mc.type AS ctype, i.id as sectionid, i.id As catid, ms.published AS spub, mc.published AS cpub" + . "\n FROM #__content AS i" + . "\n LEFT JOIN #__sections AS s ON i.sectionid = s.id" + . "\n LEFT JOIN #__menu AS ms ON ms.componentid = s.id " + . "\n LEFT JOIN #__categories AS c ON i.catid = c.id" + . "\n LEFT JOIN #__menu AS mc ON mc.componentid = c.id " + . "\n WHERE ( ms.type IN ( 'content_section', 'content_blog_section' ) OR mc.type IN ( 'content_blog_category', 'content_category' ) )" + . "\n AND i.id = $id" + . "\n ORDER BY ms.type DESC, mc.type DESC, ms.id, mc.id" + ; + $this->_db->setQuery( $query ); + $links = $this->_db->loadObjectList(); + + if (count($links)) { + foreach($links as $link) { + if ($link->stype == 'content_section' && $link->sectionid == $id && !isset($content_section) && $link->spub == 1) { + $content_section = $link->sid; + } + + if ($link->stype == 'content_blog_section' && $link->sectionid == $id && !isset($content_blog_section) && $link->spub == 1) { + $content_blog_section = $link->sid; + } + + if ($link->ctype == 'content_blog_category' && $link->catid == $id && !isset($content_blog_category) && $link->cpub == 1) { + $content_blog_category = $link->cid; + } + + if ($link->ctype == 'content_category' && $link->catid == $id && !isset($content_category) && $link->cpub == 1) { + $content_category = $link->cid; + } + } + } + + if (!isset($content_section)) { + $content_section = null; + } + + // pull existing query storage into temp variable + $ContentSection = $this->get( '_ContentSection', array() ); + // add query result to temp array storage + $ContentSection[$id] = $content_section; + // save temp array to main array storage + $this->set( '_ContentSection', $ContentSection ); + + $_Itemid = $ContentSection[$id]; + } } - if ($_Itemid == '' && $bs) { - // Search in specific blog section - $query = "SELECT m.id " - . "\n FROM #__content AS i" - . "\n LEFT JOIN #__sections AS s ON i.sectionid = s.id" - . "\n LEFT JOIN #__menu AS m ON m.componentid = s.id " - . "\n WHERE m.type = 'content_blog_section'" - . "\n AND m.published = 1" - . "\n AND i.id = $id" - ; - $this->_db->setQuery( $query ); - $_Itemid = $this->_db->loadResult(); + if ($_Itemid == '') { + $exists = 0; + foreach( $this->get( '_ContentBlogSection', array() ) as $key => $value ) { + // check if id has been tested before, if it is pull from class variable store + if ( $key == $id ) { + $_Itemid = $value; + $exists = 1; + break; + } + } + // if id hasnt been checked before initaite query + if ( !$exists ) { + if (!isset($content_blog_section)) { + $content_blog_section = null; + } + + // pull existing query storage into temp variable + $ContentBlogSection = $this->get( '_ContentBlogSection', array() ); + // add query result to temp array storage + $ContentBlogSection[$id] = $content_blog_section; + // save temp array to main array storage + $this->set( '_ContentBlogSection', $ContentBlogSection ); + + $_Itemid = $ContentBlogSection[$id]; + } } - if ($_Itemid == '' && $bc) { - // Search in specific blog category - $query = "SELECT m.id " - . "\n FROM #__content AS i" - . "\n LEFT JOIN #__categories AS c ON i.catid = c.id" - . "\n LEFT JOIN #__menu AS m ON m.componentid = c.id " - . "\n WHERE m.type = 'content_blog_category'" - . "\n AND m.published = 1" - . "\n AND i.id = $id" - ; - $this->_db->setQuery( $query ); - $_Itemid = $this->_db->loadResult(); + if ($_Itemid == '') { + $exists = 0; + foreach( $this->get( '_ContentBlogCategory', array() ) as $key => $value ) { + // check if id has been tested before, if it is pull from class variable store + if ( $key == $id ) { + $_Itemid = $value; + $exists = 1; + break; + } + } + // if id hasnt been checked before initaite query + if ( !$exists ) { + if (!isset($content_blog_category)) { + $content_blog_category = null; + } + + // pull existing query storage into temp variable + $ContentBlogCategory = $this->get( '_ContentBlogCategory', array() ); + // add query result to temp array storage + $ContentBlogCategory[$id] = $content_blog_category; + // save temp array to main array storage + $this->set( '_ContentBlogCategory', $ContentBlogCategory ); + + $_Itemid = $ContentBlogCategory[$id]; + } } - if ($_Itemid == '' && $gbs) { - // Search in global blog section - $query = "SELECT id " - . "\n FROM #__menu " - . "\n WHERE type = 'content_blog_section'" - . "\n AND published = 1" - . "\n AND componentid = 0" - ; - $this->_db->setQuery( $query ); - $_Itemid = $this->_db->loadResult(); + if ($_Itemid == '') { + // ensure that query is only called once + if ( !$this->get( '_GlobalBlogSection' ) && !defined( '_JOS_GBS' ) ) { + define( '_JOS_GBS', 1 ); + + // Search in global blog section + $query = "SELECT id " + . "\n FROM #__menu " + . "\n WHERE type = 'content_blog_section'" + . "\n AND published = 1" + . "\n AND componentid = 0" + ; + $this->_db->setQuery( $query ); + $this->set( '_GlobalBlogSection', $this->_db->loadResult() ); + } + + $_Itemid = $this->get( '_GlobalBlogSection' ); } if ($_Itemid == '') { - // Search in categories - $query = "SELECT m.id " - . "\n FROM #__content AS i" - . "\n LEFT JOIN #__categories AS cc ON i.catid = cc.id" - . "\n LEFT JOIN #__menu AS m ON m.componentid = cc.id " - . "\n WHERE m.type = 'content_category'" - . "\n AND m.published = 1" - . "\n AND i.id = $id" - ; - $this->_db->setQuery( $query ); - $_Itemid = $this->_db->loadResult(); + $exists = 0; + foreach( $this->get( '_ContentCategory', array() ) as $key => $value ) { + // check if id has been tested before, if it is pull from class variable store + if ( $key == $id ) { + $_Itemid = $value; + $exists = 1; + break; + } + } + // if id hasnt been checked before initaite query + if ( !$exists ) { + if (!isset($content_category)) { + $content_category = null; + } + + // pull existing query storage into temp variable + $ContentCategory = $this->get( '_ContentCategory', array() ); + // add query result to temp array storage + //$ContentCategory[$id] = $this->_db->loadResult(); + $ContentCategory[$id] = $content_category; + // save temp array to main array storage + $this->set( '_ContentCategory', $ContentCategory ); + + $_Itemid = $ContentCategory[$id]; + } } + if ($_Itemid == '') { + // ensure that query is only called once + if ( !$this->get( '_GlobalBlogCategory' ) && !defined( '_JOS_GBC' ) ) { + define( '_JOS_GBC', 1 ); + + // Search in global blog category + $query = "SELECT id " + . "\n FROM #__menu " + . "\n WHERE type = 'content_blog_category'" + . "\n AND published = 1" + . "\n AND componentid = 0" + ; + $this->_db->setQuery( $query ); + $this->set( '_GlobalBlogCategory', $this->_db->loadResult() ); + } + + $_Itemid = $this->get( '_GlobalBlogCategory' ); + } + if ( $_Itemid != '' ) { + // if Itemid value discovered by queries, return this value return $_Itemid; - } else { + } else if ( $Itemid != 99999999 && $Itemid === 0 ) { + // if queries do not return Itemid value, return Itemid of page - if it is not 99999999 return $Itemid; } } /** * @return number of Published Blog Sections + * Kept for Backward Compatability */ function getBlogSectionCount( ) { - $query = "SELECT COUNT( id )" - ."\n FROM #__menu " - ."\n WHERE type = 'content_blog_section'" - ."\n AND published = 1" - ; - $this->_db->setQuery( $query ); - $count = $this->_db->loadResult(); - return $count; + return 1; } /** * @return number of Published Blog Categories + * Kept for Backward Compatability */ function getBlogCategoryCount( ) { - $query = "SELECT COUNT( id )" - ."\n FROM #__menu " - . "\n WHERE type = 'content_blog_category'" - . "\n AND published = 1" - ; - $this->_db->setQuery( $query ); - $count = $this->_db->loadResult(); - return $count; + return 1; } /** * @return number of Published Global Blog Sections + * Kept for Backward Compatability */ function getGlobalBlogSectionCount( ) { - $query = "SELECT COUNT( id )" - ."\n FROM #__menu " - ."\n WHERE type = 'content_blog_section'" - ."\n AND published = 1" - ."\n AND componentid = 0" - ; - $this->_db->setQuery( $query ); - $count = $this->_db->loadResult(); - return $count; + return 1; } /** * @return number of Static Content */ function getStaticContentCount( ) { - $query = "SELECT COUNT( id )" - ."\n FROM #__menu " - ."\n WHERE type = 'content_typed'" - ."\n AND published = 1" - ; - $this->_db->setQuery( $query ); - $count = $this->_db->loadResult(); - return $count; + // ensure that query is only called once + if ( !$this->get( '_StaticContentCount' ) && !defined( '_JOS_SCC' ) ) { + define( '_JOS_SCC', 1 ); + + $query = "SELECT COUNT( id )" + ."\n FROM #__menu " + ."\n WHERE type = 'content_typed'" + ."\n AND published = 1" + ; + $this->_db->setQuery( $query ); + // saves query result to variable + $this->set( '_StaticContentCount', $this->_db->loadResult() ); + } + + return $this->get( '_StaticContentCount' ); } /** * @return number of Content Item Links */ function getContentItemLinkCount( ) { - $query = "SELECT COUNT( id )" - ."\n FROM #__menu " - ."\n WHERE type = 'content_item_link'" - ."\n AND published = 1" - ; - $this->_db->setQuery( $query ); - $count = $this->_db->loadResult(); - return $count; + // ensure that query is only called once + if ( !$this->get( '_ContentItemLinkCount' ) && !defined( '_JOS_CILC' ) ) { + define( '_JOS_CILC', 1 ); + + $query = "SELECT COUNT( id )" + ."\n FROM #__menu " + ."\n WHERE type = 'content_item_link'" + ."\n AND published = 1" + ; + $this->_db->setQuery( $query ); + // saves query result to variable + $this->set( '_ContentItemLinkCount', $this->_db->loadResult() ); + } + + return $this->get( '_ContentItemLinkCount' ); } /** @@ -1374,12 +1894,24 @@ return $obj; } - function writableCell( $folder ) { - + function writableCell( $folder, $relative=1, $text='', $visible=1 ) { + $writeable = 'Writeable'; + $unwriteable = 'Unwriteable'; + echo ''; - echo '' . $folder . '/'; + echo ''; + echo $text; + if ( $visible ) { + echo $folder . '/'; + } + echo ''; echo ''; - echo is_writable( "../$folder" ) ? 'Writeable' : 'Unwriteable' . ''; + if ( $relative ) { + echo is_writable( "../$folder" ) ? $writeable : $unwriteable; + } else { + echo is_writable( "$folder" ) ? $writeable : $unwriteable; + } + echo ''; echo ''; } @@ -1394,9 +1926,15 @@ * @returns string HTML for the select list */ function selectList( &$arr, $tag_name, $tag_attribs, $key, $text, $selected=NULL ) { - reset( $arr ); - $html = "\n"; + $count = count( $arr ); + + for ($i=0, $n=$count; $i < $n; $i++ ) { $k = $arr[$i]->$key; $t = $arr[$i]->$text; $id = ( isset($arr[$i]->id) ? @$arr[$i]->id : null); @@ -1417,6 +1955,7 @@ $html .= "\n\t"; } $html .= "\n\n"; + return $html; } @@ -1568,6 +2107,7 @@ $html .= "\n\t"; } $html .= "\n"; + return $html; } @@ -1580,9 +2120,10 @@ */ function yesnoRadioList( $tag_name, $tag_attribs, $selected, $yes=_CMN_YES, $no=_CMN_NO ) { $arr = array( - mosHTML::makeOption( '0', $no ), - mosHTML::makeOption( '1', $yes ) + mosHTML::makeOption( '0', $no ), + mosHTML::makeOption( '1', $yes ) ); + return mosHTML::radioList( $arr, $tag_name, $tag_attribs, $selected ); } @@ -1629,13 +2170,13 @@ // displays close button in Pop-up window if ( $params->get( 'popup' ) && !$hide_js ) { ?> - + get( 'back_button' ) && !$params->get( 'popup' ) && !$hide_js) { ?> get( 'print' ) && !$hide_js ) { // use default settings if none declared if ( !$status ) { @@ -1693,19 +2233,22 @@ if ( $params->get( 'popup' ) && !$hide_js ) { // Print Preview button - used when viewing page ?> - - - - - - + + + - - - + + \n"; - $replacement .= " \n"; - $replacement .= ""; - $replacement .= ""; + $replacement .= "\n "; return $replacement; } @@ -2090,6 +2644,18 @@ function mosMenu( &$db ) { $this->mosDBTable( '#__menu', 'id', $db ); } + + function check() { + $this->id = (int) $this->id; + $this->params = (string) trim( $this->params . ' ' ); + return true; + } + + function load( $id=null ) { + parent::load( $id ); + + $this->name = htmlspecialchars( $this->name, ENT_QUOTES ); + } } /** @@ -2140,9 +2706,6 @@ function check() { global $mosConfig_uniquemail; - // filter malicious code - //$this->filter(); - // Validate user information if (trim( $this->name ) == '') { $this->_error = _REGWARN_NAME; @@ -2154,6 +2717,18 @@ return false; } + // check that username is not greater than 25 characters + $username = $this->username; + if ( strlen($username) > 25 ) { + $this->username = substr( $username, 0, 25 ); + } + + // check that password is not greater than 50 characters + $password = $this->password; + if ( strlen($password) > 50 ) { + $this->password = substr( $password, 0, 50 ); + } + if (eregi( "[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", $this->username) || strlen( $this->username ) < 3) { $this->_error = sprintf( _VALID_AZ09, _PROMPT_UNAME, 2 ); return false; @@ -2338,36 +2913,43 @@ define( "_MOS_ALLOWHTML", 0x0002 ); define( "_MOS_ALLOWRAW", 0x0004 ); function mosGetParam( &$arr, $name, $def=null, $mask=0 ) { - static $noHtmlFilter = null; - static $safeHtmlFilter = null; + static $noHtmlFilter = null; + static $safeHtmlFilter = null; $return = null; if (isset( $arr[$name] )) { - if (is_string( $arr[$name] )) { + $return = $arr[$name]; + + if (is_string( $return )) { + // trim data if (!($mask&_MOS_NOTRIM)) { - $arr[$name] = trim( $arr[$name] ); + $return = trim( $return ); } + if ($mask&_MOS_ALLOWRAW) { // do nothing } else if ($mask&_MOS_ALLOWHTML) { // do nothing - compatibility mode - /* - if (is_null( $safeHtmlFilter )) { - $safeHtmlFilter = new InputFilter( null, null, 1, 1 ); - } - $arr[$name] = $safeHtmlFilter->process( $arr[$name] ); - */ } else { + // send to inputfilter if (is_null( $noHtmlFilter )) { $noHtmlFilter = new InputFilter( /* $tags, $attr, $tag_method, $attr_method, $xss_auto */ ); } - $arr[$name] = $noHtmlFilter->process( $arr[$name] ); + $return = $noHtmlFilter->process( $return ); + + if (is_numeric($def)) { + // if default value is numeric set variable type to integer + $return = intval($return); + } } + + // account for magic quotes setting if (!get_magic_quotes_gpc()) { - $arr[$name] = addslashes( $arr[$name] ); + $return = addslashes( $return ); } } - return $arr[$name]; + + return $return; } else { return $def; } @@ -2525,6 +3107,7 @@ } function mosTreeRecurse( $id, $indent, $list, &$children, $maxlevel=9999, $level=0, $type=1 ) { + if (@$children[$id] && $level <= $maxlevel) { foreach ($children[$id] as $v) { $id = $v->id; @@ -2546,6 +3129,7 @@ $list[$id] = $v; $list[$id]->treename = "$indent$txt"; $list[$id]->children = count( @$children[$id] ); + $list = mosTreeRecurse( $id, $indent . $spacer, $list, $children, $maxlevel, $level+1, $type ); } } @@ -2670,17 +3254,6 @@ return false; } - // limitation has been removed - // check for existing title - //$this->_db->setQuery( "SELECT id FROM #__modules" - //. "\nWHERE title='$this->title'" - //); - // check for module of same name - //$xid = intval( $this->_db->loadResult() ); - //if ($xid && $xid != intval( $this->id )) { - // $this->_error = "There is a module already with that name, please try again."; - // return false; - //} return true; } } @@ -2785,28 +3358,31 @@ * @return string */ function generateId() { - $failsafe = 20; - $randnum = 0; + $failsafe = 20; + $randnum = 0; + while ($failsafe--) { - $randnum = md5( uniqid( microtime(), 1 ) ); - if ($randnum != "") { - $cryptrandnum = md5( $randnum ); + $randnum = md5( uniqid( microtime(), 1 ) ); + $new_session_id = mosMainFrame::sessionCookieValue( $randnum ); + + if ($randnum != '') { $query = "SELECT $this->_tbl_key" . "\n FROM $this->_tbl" - . "\n WHERE $this->_tbl_key = MD5( '$randnum' )" + . "\n WHERE $this->_tbl_key = '$new_session_id'" ; $this->_db->setQuery( $query ); if(!$result = $this->_db->query()) { die( $this->_db->stderr( true )); - // todo: handle gracefully } + if ($this->_db->getNumRows($result) == 0) { break; } } } - $this->_session_cookie = $randnum; - $this->session_id = md5( $randnum . $_SERVER['REMOTE_ADDR'] ); + + $this->_session_cookie = $randnum; + $this->session_id = $new_session_id; } /** @@ -2820,10 +3396,34 @@ * Purge lapsed sessions * @return boolean */ - function purge( $inc=1800 ) { - $past = time() - $inc; - $query = "DELETE FROM $this->_tbl" - . "\n WHERE ( time < '$past' )"; + function purge( $inc=1800, $and='' ) { + global $mainframe; + + if ($inc == 'core') { + $past_logged = time() - $mainframe->getCfg( 'lifetime' ); + $past_guest = time() - 900; + + $query = "DELETE FROM $this->_tbl" + . "\n WHERE (" + // purging expired logged sessions + . "\n ( time < '$past_logged' )" + . "\n AND guest = 0" + . "\n AND gid > 0" + . "\n ) OR (" + // purging expired guest sessions + . "\n ( time < '$past_guest' )" + . "\n AND guest = 1" + . "\n AND userid = 0" + . "\n )" + ; + } else { + // kept for backward compatability + $past = time() - $inc; + $query = "DELETE FROM $this->_tbl" + . "\n WHERE ( time < '$past' )" + . $and + ; + } $this->_db->setQuery($query); return $this->_db->query(); @@ -2850,7 +3450,9 @@ * Checks the user agent string against known browsers */ function mosGetBrowser( $agent ) { - require( 'includes/agent_browser.php' ); + global $mosConfig_absolute_path; + + require( $mosConfig_absolute_path .'/includes/agent_browser.php' ); if (preg_match( "/msie[\/\sa-z]*([\d\.]*)/i", $agent, $m ) && !preg_match( "/webtv/i", $agent ) @@ -2888,7 +3490,9 @@ * Checks the user agent string against known operating systems */ function mosGetOS( $agent ) { - require( "includes/agent_os.php" ); + global $mosConfig_absolute_path; + + require( $mosConfig_absolute_path .'/includes/agent_os.php' ); foreach ($osSearchOrder as $key) { if (preg_match( "/$key/i", $agent )) { @@ -2969,30 +3573,42 @@ * @return boolean True if the visitor's group at least equal to the menu access */ function mosMenuCheck( $Itemid, $menu_option, $task, $gid ) { - global $database; - $dblink="index.php?option=$menu_option"; - if ($Itemid!="" && $Itemid!=0 && $Itemid!=99999999) { - $query = "SELECT access" + global $database, $mainframe; + + if ( $Itemid != '' && $Itemid != 0 && $Itemid != 99999999 ) { + $query = "SELECT *" . "\n FROM #__menu" . "\n WHERE id = $Itemid" ; - $database->setQuery( $query ); } else { - if ($task!="") { - $dblink.="&task=$task"; + $dblink = "index.php?option=$menu_option"; + + if ($task != '') { + $dblink .= "&task=$task"; } - $query = "SELECT access" + + $query = "SELECT *" . "\n FROM #__menu" . "\n WHERE link LIKE '$dblink%'" ; - $database->setQuery( $query ); } - $results = $database->loadObjectList(); - $access = 0; - //echo "
    "; print_r($results); echo "
    "; + $database->setQuery( $query ); + $results = $database->loadObjectList(); + $access = 0; + foreach ($results as $result) { $access = max( $access, $result->access ); } + + // save menu information to global mainframe + if(isset($results[0])) { + // loads menu info of particular Itemid + $mainframe->set( 'menu', $results[0] ); + } else { + // loads empty Menu info + $mainframe->set( 'menu', new mosMenu($database) ); + } + return ($access <= $gid); } @@ -3080,7 +3696,7 @@ function mosWarning($warning, $title='Joomla! Warning') { global $mosConfig_live_site; - $mouseover = 'return overlib(\''. $warning .'\', CAPTION, \'$title\', BELOW, RIGHT);'; + $mouseover = 'return overlib(\''. $warning .'\', CAPTION, \''. $title .'\', BELOW, RIGHT);'; $tip = "\n"; $tip .= ''; @@ -3091,7 +3707,7 @@ function mosCreateGUID(){ srand((double)microtime()*1000000); - $r = rand ; + $r = rand(); $u = uniqid(getmypid() . $r . (double)microtime()*1000000,1); $m = md5 ($u); return($m); @@ -3236,31 +3852,49 @@ */ function initGzip() { global $mosConfig_gzip, $do_gzip_compress; - + $do_gzip_compress = FALSE; if ($mosConfig_gzip == 1) { - $phpver = phpversion(); - $useragent = mosGetParam( $_SERVER, 'HTTP_USER_AGENT', '' ); - $canZip = mosGetParam( $_SERVER, 'HTTP_ACCEPT_ENCODING', '' ); - - if ( $phpver >= '4.0.4pl1' && - ( strpos($useragent,'compatible') !== false || - strpos($useragent,'Gecko') !== false - ) - ) { - if ( extension_loaded('zlib') && !ini_get('zlib.output_compression')) { + $phpver = phpversion(); + $useragent = mosGetParam( $_SERVER, 'HTTP_USER_AGENT', '' ); + $canZip = mosGetParam( $_SERVER, 'HTTP_ACCEPT_ENCODING', '' ); + + $gzip_check = 0; + $zlib_check = 0; + $gz_check = 0; + $zlibO_check = 0; + $sid_check = 0; + if ( strpos( $canZip, 'gzip' ) !== false) { + $gzip_check = 1; + } + if ( extension_loaded( 'zlib' ) ) { + $zlib_check = 1; + } + if ( function_exists('ob_gzhandler') ) { + $gz_check = 1; + } + if ( ini_get('zlib.output_compression') ) { + $zlibO_check = 1; + } + if ( ini_get('session.use_trans_sid') ) { + $sid_check = 1; + } + + if ( $phpver >= '4.0.4pl1' && ( strpos($useragent,'compatible') !== false || strpos($useragent,'Gecko') !== false ) ) { + // Check for gzip header or northon internet securities or session.use_trans_sid + if ( ( $gzip_check || isset( $_SERVER['---------------']) ) && $zlib_check && $gz_check && !$zlibO_check && !$sid_check ) { // You cannot specify additional output handlers if // zlib.output_compression is activated here - ob_start("ob_gzhandler"); + ob_start( 'ob_gzhandler' ); return; } } else if ( $phpver > '4.0' ) { - if ( strpos($canZip,'gzip') !== false ) { - if (extension_loaded( 'zlib' )) { + if ( $gzip_check ) { + if ( $zlib_check ) { $do_gzip_compress = TRUE; ob_start(); ob_implicit_flush(0); - + header( 'Content-Encoding: gzip' ); return; } @@ -3301,12 +3935,12 @@ * Random password generator * @return password */ -function mosMakePassword() { +function mosMakePassword($length=8) { $salt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $len = strlen($salt); $makepass = ''; mt_srand(10000000*(double)microtime()); - for ($i = 0; $i < 8; $i++) + for ($i = 0; $i < $length; $i++) $makepass .= $salt[mt_rand(0,$len - 1)]; return $makepass; } @@ -3343,13 +3977,22 @@ */ class mosMambotHandler { /** @var array An array of functions in event groups */ - var $_events = null; + var $_events = null; /** @var array An array of lists */ - var $_lists = null; + var $_lists = null; /** @var array An array of mambots */ - var $_bots = null; + var $_bots = null; /** @var int Index of the mambot being loaded */ - var $_loading = null; + var $_loading = null; + + /** Added as of 1.0.8 to ensure queries are only called once **/ + + /** @var array An array of the content mambots in the system */ + var $_content_mambots = null; + /** @var array An array of the content mambot params */ + var $_content_mambot_params = array(); + /** @var array An array of the content mambot params */ + var $_search_mambot_params = array(); /** * Constructor @@ -3362,8 +4005,7 @@ * @param string The group name, relates to the sub-directory in the mambots directory */ function loadBotGroup( $group ) { - global $database, $my, $mosConfig_absolute_path; - global $_MAMBOTS; + global $database, $my; $group = trim( $group ); if (is_object( $my )) { @@ -3376,12 +4018,27 @@ switch ( $group ) { case 'content': - $query = "SELECT folder, element, published, params" - . "\n FROM #__mambots" - . "\n WHERE access <= $gid" - . "\n AND folder = '$group'" - . "\n ORDER BY ordering" - ; + if (!defined( '_JOS_CONTENT_MAMBOTS' )) { + /** ensure that query is only called once */ + define( '_JOS_CONTENT_MAMBOTS', 1 ); + + $query = "SELECT folder, element, published, params" + . "\n FROM #__mambots" + . "\n WHERE access <= $gid" + . "\n AND folder = 'content'" + . "\n ORDER BY ordering" + ; + $database->setQuery( $query ); + + // load query into class variable _content_mambots + if (!($this->_content_mambots = $database->loadObjectList())) { + //echo "Error loading Mambots: " . $database->getErrorMsg(); + return false; + } + } + + // pull bots to be processed from class variable + $bots = $this->_content_mambots; break; default: @@ -3392,18 +4049,21 @@ . "\n AND folder = '$group'" . "\n ORDER BY ordering" ; + $database->setQuery( $query ); + + if (!($bots = $database->loadObjectList())) { + //echo "Error loading Mambots: " . $database->getErrorMsg(); + return false; + } break; } - $database->setQuery( $query ); - - if (!($bots = $database->loadObjectList())) { - //echo "Error loading Mambots: " . $database->getErrorMsg(); - return false; - } + + // load bots found by queries $n = count( $bots); - for ($i = 0; $i < $n; $i++) { + for ($i = 0; $i < $n; $i++) { $this->loadBot( $bots[$i]->folder, $bots[$i]->element, $bots[$i]->published, $bots[$i]->params ); } + return true; } /** @@ -3662,7 +4322,7 @@ } // second pass - get an indent list of the items - $list = mosTreeRecurse( 0, '', array(), $children, 9999, 0, 0 ); + $list = mosTreeRecurse( 0, '', array(), $children, 20, 0, 0 ); // assemble menu items to the array $mitems = array(); @@ -3689,15 +4349,37 @@ * build the link/url of a menu item */ function Link( &$row, $id, $link=NULL ) { + global $mainframe; + if ( $id ) { - if ( $link ) { - $link = $row->link; - } else { - $link = $row->link .'&Itemid='. $row->id; - } + switch ($row->type) { + case 'content_item_link': + case 'content_typed': + // load menu params + $params = new mosParameters( $row->params, $mainframe->getPath( 'menu_xml', $row->type ), 'menu' ); + + if ( $params->get( 'unique_itemid' ) ) { + $row->link .= '&Itemid='. $row->id; + } else { + $temp = split( '&task=view&id=', $row->link); + $row->link .= '&Itemid='. $mainframe->getItemid($temp[1], 0, 0); + } + + $link = $row->link; + break; + + default: + if ( $link ) { + $link = $row->link; + } else { + $link = $row->link .'&Itemid='. $row->id; + } + break; + } } else { $link = NULL; } + return $link; } @@ -3721,16 +4403,13 @@ // get a list of the menu items $query = "SELECT m.*" . "\n FROM #__menu AS m" -// . "\n WHERE type != 'url'" -// . "\n AND type != 'separator'" -// Change adds Itemid support for Link - Urls without `index.php` or `Itemid=` in their url - . "\n WHERE m.type != 'separator'" - . "\n AND NOT (" - . "\n ( m.type = 'url' )" - . "\n AND ( m.link LIKE '%index.php%' )" - . "\n AND ( m.link LIKE '%Itemid=%' )" - . "\n )" - . "\n AND m.published = 1" + . "\n WHERE m.published = 1" + //. "\n AND m.type != 'separator'" + //. "\n AND NOT (" + // . "\n ( m.type = 'url' )" + // . "\n AND ( m.link LIKE '%index.php%' )" + // . "\n AND ( m.link LIKE '%Itemid=%' )" + //. "\n )" . "\n ORDER BY m.menutype, m.parent, m.ordering" ; $database->setQuery( $query ); @@ -3748,23 +4427,28 @@ $children[$pt] = $list; } // second pass - get an indent list of the items - $list = mosTreeRecurse( intval( $mitems[0]->parent ), '', array(), $children, 9999, 0, 0 ); + $list = mosTreeRecurse( intval( $mitems[0]->parent ), '', array(), $children, 20, 0, 0 ); // Code that adds menu name to Display of Page(s) - $text_count = "0"; - $mitems_spacer = $mitems_temp[0]->menutype; + $text_count = 0; + $mitems_spacer = $mitems_temp[0]->menutype; foreach ($list as $list_a) { foreach ($mitems_temp as $mitems_a) { if ($mitems_a->id == $list_a->id) { // Code that inserts the blank line that seperates different menus if ($mitems_a->menutype != $mitems_spacer) { - $list_temp[] = mosHTML::makeOption( -999, '----' ); - $mitems_spacer = $mitems_a->menutype; + $list_temp[] = mosHTML::makeOption( -999, '----' ); + $mitems_spacer = $mitems_a->menutype; } - $text = $mitems_a->menutype." | ".$list_a->treename; - $list_temp[] = mosHTML::makeOption( $list_a->id, $text ); - if ( strlen($text) > $text_count) { - $text_count = strlen($text); + + // do not display `url` menu item types that contain `index.php` and `Itemid` + if (!($mitems_a->type == 'url' && strpos($mitems_a->link, 'index.php') !== false && strpos($mitems_a->link, 'Itemid=') !== false)) { + $text = $mitems_a->menutype .' | '. $list_a->treename; + $list_temp[] = mosHTML::makeOption( $list_a->id, $text ); + + if ( strlen($text) > $text_count) { + $text_count = strlen($text); + } } } } @@ -3790,6 +4474,7 @@ // adds space, in select box which is not saved $mitems[] = mosHTML::makeOption( -999, '----' ); } + // append the rest of the menu items to the array foreach ($list as $item) { $mitems[] = mosHTML::makeOption( $item->value, $item->text ); @@ -3921,15 +4606,16 @@ function Images( $name, &$active, $javascript=NULL, $directory=NULL ) { global $mosConfig_absolute_path; - if ( !$javascript ) { - $javascript = "onchange=\"javascript:if (document.forms[0].image.options[selectedIndex].value!='') {document.imagelib.src='../images/stories/' + document.forms[0].image.options[selectedIndex].value} else {document.imagelib.src='../images/blank.png'}\""; - } if ( !$directory ) { $directory = '/images/stories'; } - + + if ( !$javascript ) { + $javascript = "onchange=\"javascript:if (document.forms[0].image.options[selectedIndex].value!='') {document.imagelib.src='..$directory/' + document.forms[0].image.options[selectedIndex].value} else {document.imagelib.src='../images/blank.png'}\""; + } + $imageFiles = mosReadDirectory( $mosConfig_absolute_path . $directory ); - $images = array( mosHTML::makeOption( '', '- Select Image -' ) ); + $images = array( mosHTML::makeOption( '', '- Select Image -' ) ); foreach ( $imageFiles as $file ) { if ( eregi( "bmp|gif|jpg|png", $file ) ) { $images[] = mosHTML::makeOption( $file ); @@ -4136,27 +4822,86 @@ } } } + + /** + * Internal function to recursive scan the media manager directories + * @param string Path to scan + * @param string root path of this folder + * @param array Value array of all existing folders + * @param array Value array of all existing images + */ + function ReadImagesX( &$folders, &$images ) { + global $mosConfig_absolute_path; + + if ( $folders[0]->value != '*0*' ) { + foreach ( $folders as $folder ) { + $imagePath = $mosConfig_absolute_path .'/images/stories' . $folder->value; + $imgFiles = mosReadDirectory( $imagePath ); + $folderPath = $folder->value .'/'; + + foreach ($imgFiles as $file) { + $ff = $folderPath . $file; + $i_f = $imagePath .'/'. $file; + + if ( eregi( "bmp|gif|jpg|png", $file ) && is_file( $i_f ) ) { + // leading / we don't need + $imageFile = substr( $ff, 1 ); + $images[$folderPath][] = mosHTML::makeOption( $imageFile, $file ); + } + } + } + } else { + $folders = array(); + $folders[] = mosHTML::makeOption( 'None' ); + } + } - function GetImageFolders( &$folders, $path ) { - $javascript = "onchange=\"changeDynaList( 'imagefiles', folderimages, document.adminForm.folders.options[document.adminForm.folders.selectedIndex].value, 0, 0); previewImage( 'imagefiles', 'view_imagefiles', '$path/' );\""; + function GetImageFolders( &$temps, $path ) { + if ( $temps[0]->value != 'None' ) { + foreach( $temps as $temp ) { + if ( substr( $temp->value, -1, 1 ) != '/' ) { + $temp = $temp->value .'/'; + $folders[] = mosHTML::makeOption( $temp, $temp ); + } else { + $temp = $temp->value; + $temp = ampReplace( $temp ); + $folders[] = mosHTML::makeOption( $temp, $temp ); + } + } + } else { + $folders[] = mosHTML::makeOption( 'None Selected' ); + } + + $javascript = "onchange=\"changeDynaList( 'imagefiles', folderimages, document.adminForm.folders.options[document.adminForm.folders.selectedIndex].value, 0, 0);\""; $getfolders = mosHTML::selectList( $folders, 'folders', 'class="inputbox" size="1" '. $javascript, 'value', 'text', '/' ); + return $getfolders; } - function GetImages( &$images, $path ) { - if ( !isset($images['/'] ) ) { - $images['/'][] = mosHTML::makeOption( '' ); + function GetImages( &$images, $path, $base='/' ) { + if ( is_array($base) && count($base) > 0 ) { + if ( $base[0]->value != '/' ) { + $base = $base[0]->value .'/'; + } else { + $base = $base[0]->value; + } + } else { + $base = '/'; + } + + if ( !isset($images[$base] ) ) { + $images[$base][] = mosHTML::makeOption( '' ); } - //$javascript = "onchange=\"previewImage( 'imagefiles', 'view_imagefiles', '$path/' )\" onfocus=\"previewImage( 'imagefiles', 'view_imagefiles', '$path/' )\""; - $javascript = "onchange=\"previewImage( 'imagefiles', 'view_imagefiles', '$path/' )\""; - $getimages = mosHTML::selectList( $images['/'], 'imagefiles', 'class="inputbox" size="10" multiple="multiple" '. $javascript , 'value', 'text', null ); + $javascript = "onchange=\"previewImage( 'imagefiles', 'view_imagefiles', '$path/' )\" onfocus=\"previewImage( 'imagefiles', 'view_imagefiles', '$path/' )\""; + $getimages = mosHTML::selectList( $images[$base], 'imagefiles', 'class="inputbox" size="10" multiple="multiple" '. $javascript , 'value', 'text', null ); return $getimages; } function GetSavedImages( &$row, $path ) { $images2 = array(); + foreach( $row->images as $file ) { $temp = explode( '|', $file ); if( strrchr($temp[0], '/') ) { @@ -4166,7 +4911,7 @@ } $images2[] = mosHTML::makeOption( $file, $filename ); } - //$javascript = "onchange=\"previewImage( 'imagelist', 'view_imagelist', '$path/' ); showImageProps( '$path/' ); \" onfocus=\"previewImage( 'imagelist', 'view_imagelist', '$path/' )\""; + $javascript = "onchange=\"previewImage( 'imagelist', 'view_imagelist', '$path/' ); showImageProps( '$path/' ); \""; $imagelist = mosHTML::selectList( $images2, 'imagelist', 'class="inputbox" size="10" '. $javascript, 'value', 'text' ); @@ -4179,23 +4924,33 @@ * Also can be used in conjunction with the menulist param to create the chosen image * load the default or use no image */ - function ImageCheck( $file, $directory='/images/M_images/', $param=NULL, $param_directory='/images/M_images/', $alt=NULL, $name='image', $type=1, $align='middle' ) { + function ImageCheck( $file, $directory='/images/M_images/', $param=NULL, $param_directory='/images/M_images/', $alt=NULL, $name='image', $type=1, $align='middle', $title=NULL, $admin=NULL ) { global $mosConfig_absolute_path, $mosConfig_live_site, $mainframe; $cur_template = $mainframe->getTemplate(); - $name = ( $name ? 'name="'. $name .'"' : '' ); + $name = ( $name ? ' name="'. $name .'"' : '' ); + $title = ( $title ? ' title="'. $title .'"' : '' ); + $alt = ( $alt ? ' alt="'. $alt .'"' : ' alt=""' ); + $align = ( $align ? ' align="'. $align .'"' : '' ); + + // change directory path from frontend or backend + if ($admin) { + $path = '/administrator/templates/'. $cur_template .'/images/'; + } else { + $path = '/templates/'. $cur_template .'/images/'; + } if ( $param ) { $image = $mosConfig_live_site. $param_directory . $param; if ( $type ) { - $image = ''. $alt .''; + $image = ''; } } else if ( $param == -1 ) { $image = ''; } else { - if ( file_exists( $mosConfig_absolute_path .'/templates/'. $cur_template .'/images/'. $file ) ) { - $image = $mosConfig_live_site .'/templates/'. $cur_template .'/images/'. $file; + if ( file_exists( $mosConfig_absolute_path . $path . $file ) ) { + $image = $mosConfig_live_site . $path . $file; } else { // outputs only path to image $image = $mosConfig_live_site. $directory . $file; @@ -4203,7 +4958,7 @@ // outputs actual html tag if ( $type ) { - $image = ''. $alt .''; + $image = ''; } } @@ -4216,33 +4971,43 @@ * Also can be used in conjunction with the menulist param to create the chosen image * load the default or use no image */ - function ImageCheckAdmin( $file, $directory='/administrator/images/', $param=NULL, $param_directory='/administrator/images/', $alt=NULL, $name=NULL, $type=1, $align='middle' ) { - global $mosConfig_absolute_path, $mosConfig_live_site, $mainframe; + function ImageCheckAdmin( $file, $directory='/administrator/images/', $param=NULL, $param_directory='/administrator/images/', $alt=NULL, $name=NULL, $type=1, $align='middle', $title=NULL ) { +/* + global $mosConfig_absolute_path, $mosConfig_live_site, $mainframe; $cur_template = $mainframe->getTemplate(); - $name = ( $name ? 'name="'. $name .'"' : '' ); + $name = ( $name ? ' name="'. $name .'"' : '' ); + $title = ( $title ? ' title="'. $title .'"' : '' ); + $alt = ( $alt ? ' alt="'. $alt .'"' : ' alt=""' ); + $align = ( $align ? ' align="'. $align .'"' : '' ); + + $path = '/administrator/templates/'. $cur_template .'/images/'; if ( $param ) { $image = $mosConfig_live_site. $param_directory . $param; if ( $type ) { - $image = ''. $alt .''; + $image = ''; } } else if ( $param == -1 ) { $image = ''; } else { - if ( file_exists( $mosConfig_absolute_path .'/administrator/templates/'. $cur_template .'/images/'. $file ) ) { - $image = $mosConfig_live_site .'/administrator/templates/'. $cur_template .'/images/'. $file; + if ( file_exists( $mosConfig_absolute_path . $path . $file ) ) { + $image = $mosConfig_live_site . $path . $file; } else { + // outputs only path to image $image = $mosConfig_live_site. $directory . $file; } // outputs actual html tag if ( $type ) { - $image = ''. $alt .''; + $image = ''; } } - +*/ + // functionality consolidated into ImageCheck + $image = mosAdminMenus::ImageCheck( $file, $directory, $param, $param_directory, $alt, $name, $type, $align, $title, $admin=1 ); + return $image; } @@ -4370,6 +5135,13 @@ function go2( pressbutton, menu, id ) { var form = document.adminForm; + // assemble the images back into one field + var temp = new Array; + for (var i=0, n=form.imagelist.options.length; i < n; i++) { + temp[i] = form.imagelist.options[i].value; + } + form.images.value = temp.join( '\n' ); + if (pressbutton == 'go2menu') { form.menu.value = menu; submitform( pressbutton ); @@ -4527,7 +5299,7 @@ ?> - checked_out && $row->checked_out != $my->id) { + if ( $row->checked_out) { $checked = mosCommonHTML::checkedOut( $row ); } else { $checked = mosHTML::idBox( $i, $row->id, ($row->checked_out && $row->checked_out != $my->id ) ); @@ -4627,6 +5399,95 @@ return $href; } + + /* + * Special handling for newfeed encoding and possible conflicts with page encoding and PHP version + * Added 1.0.8 + * Static Function + */ + function newsfeedEncoding( $rssDoc, $text ) { + if (!defined( '_JOS_FEED_ENCODING' )) { + // determine encoding of feed + $feed = $rssDoc->toNormalizedString(true); + $feed = strtolower( substr( $feed, 0, 150 ) ); + $feedEncoding = strpos( $feed, 'encoding="utf-8"' ); + + if ( $feedEncoding !== false ) { + // utf-8 feed + $utf8 = 1; + } else { + // non utf-8 page + $utf8 = 0; + } + + define( '_JOS_FEED_ENCODING', $utf8 ); + } + + if (!defined( '_JOS_SITE_ENCODING' )) { + // determine encoding of page + if ( strpos( strtolower( _ISO ), 'utf' ) !== false ) { + // utf-8 page + $utf8 = 1; + } else { + // non utf-8 page + $utf8 = 0; + } + + define( '_JOS_SITE_ENCODING', $utf8 ); + + } + + if ( phpversion() >= 5 ) { + // handling for PHP 5 + if ( _JOS_FEED_ENCODING ) { + // handling for utf-8 feed + if ( _JOS_SITE_ENCODING ) { + // utf-8 page + $encoding = 'html_entity_decode'; + } else { + // non utf-8 page + $encoding = 'utf8_decode'; + } + } else { + // handling for non utf-8 feed + if ( _JOS_SITE_ENCODING ) { + // utf-8 page + $encoding = ''; + } else { + // non utf-8 page + $encoding = 'utf8_decode'; + } + } + } else { + // handling for PHP 4 + if ( _JOS_FEED_ENCODING ) { + // handling for utf-8 feed + if ( _JOS_SITE_ENCODING ) { + // utf-8 page + $encoding = ''; + } else { + // non utf-8 page + $encoding = 'utf8_decode'; + } + } else { + // handling for non utf-8 feed + if ( _JOS_SITE_ENCODING ) { + // utf-8 page + $encoding = 'utf8_encode'; + } else { + // non utf-8 page + $encoding = 'html_entity_decode'; + } + } + } + + if ( $encoding ) { + $text = $encoding( $text ); + } + $text = str_replace(''', "'", $text); + + return $text; + } } /** @@ -4680,8 +5541,10 @@ * Includes pathway file */ function mosPathWay() { - $Itemid = mosGetParam($_REQUEST,'Itemid',''); - require $GLOBALS['mosConfig_absolute_path'] . '/includes/pathway.php'; + global $mosConfig_absolute_path; + + $Itemid = intval( mosGetParam( $_REQUEST, 'Itemid', '' ) ); + require_once ( $mosConfig_absolute_path . '/includes/pathway.php' ); } /** @@ -4722,13 +5585,17 @@ */ function mosPrepareSearchContent( $text, $length=200, $searchword ) { // strips tags won't remove the actual jscript - $text = preg_replace( "']*>.*?'si", "", $text ); + $text = preg_replace( "']*>.*?'si", "", $text ); $text = preg_replace( '/{.+?}/', '', $text); + //$text = preg_replace( '/]*>([^<]+)<\/a>/is','\2', $text ); + // replace line breaking tags with whitespace $text = preg_replace( "'<(br[^/>]*?/|hr[^/>]*?/|/(div|h[1-6]|li|p|td))>'si", ' ', $text ); + + $text = mosSmartSubstr( strip_tags( $text ), $length, $searchword ); - return mosSmartSubstr( strip_tags( $text ), $length, $searchword ); + return $text; } /** @@ -4931,6 +5798,74 @@ } } +function josSpoofCheck( $header=NULL, $alt=NULL ) { + $validate = mosGetParam( $_POST, josSpoofValue($alt), 0 ); + + // probably a spoofing attack + if (!$validate) { + header( 'HTTP/1.0 403 Forbidden' ); + mosErrorAlert( _NOT_AUTH ); + return; + } + + // First, make sure the form was posted from a browser. + // For basic web-forms, we don't care about anything + // other than requests from a browser: + if (!isset( $_SERVER['HTTP_USER_AGENT'] )) { + header( 'HTTP/1.0 403 Forbidden' ); + mosErrorAlert( _NOT_AUTH ); + return; + } + + // Make sure the form was indeed POST'ed: + // (requires your html form to use: action="post") + if (!$_SERVER['REQUEST_METHOD'] == 'POST' ) { + header( 'HTTP/1.0 403 Forbidden' ); + mosErrorAlert( _NOT_AUTH ); + return; + } + + if ($header) { + // Attempt to defend against header injections: + $badStrings = array( + 'Content-Type:', + 'MIME-Version:', + 'Content-Transfer-Encoding:', + 'bcc:', + 'cc:' + ); + + // Loop through each POST'ed value and test if it contains + // one of the $badStrings: + foreach ($_POST as $k => $v){ + foreach ($badStrings as $v2) { + if (strpos( $v, $v2 ) !== false) { + header( "HTTP/1.0 403 Forbidden" ); + mosErrorAlert( _NOT_AUTH ); + return; + } + } + } + + // Made it past spammer test, free up some memory + // and continue rest of script: + unset($k, $v, $v2, $badStrings); + } +} + +function josSpoofValue($alt=NULL) { + global $mainframe; + + if ($alt) { + $random = date( 'Ymd' ); + } else { + $random = date( 'dmY' ); + } + $validate = mosHash( $mainframe->getCfg( 'db' ) . $random ); + + return $validate; +} + // ----- NO MORE CLASSES OR FUNCTIONS PASSED THIS POINT ----- // Post class declaration initialisations // some version of PHP don't allow the instantiation of classes diff -urN joomla-1.0.7/includes/joomla.xml.php joomla-1.0.10/includes/joomla.xml.php --- joomla-1.0.7/includes/joomla.xml.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/joomla.xml.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ getAttribute( 'description' )) { // add the params description to the display - $html[] = '' . $description . ''; + $html[] = '' . $description . ''; } //$params = mosParseParams( $row->params ); @@ -279,9 +279,9 @@ $result[0] = $label ? $label : $name; if ($result[0] == '@spacer') { - $result[0] = ''; + $result[0] = ' '; } else { - $result[0] = mosToolTip( addslashes( $description ), $result[0], '', '', $result[0], '#', 0 ); + $result[0] = mosToolTip( addslashes( $description ), addslashes( $result[0] ), '', '', $result[0], '#', 0 ); } $type = $param->getAttribute( 'type' ); @@ -310,7 +310,7 @@ function _form_text( $name, $value, &$node, $control_name ) { $size = $node->getAttribute( 'size' ); - return ''; + return ''; } /** * @param string The name of the form element @@ -447,10 +447,10 @@ $options[] = mosHTML::makeOption( $file, $file ); } if ( !$node->getAttribute( 'hide_none' ) ) { - array_unshift( $options, mosHTML::makeOption( '-1', '- '. 'Do not use an image' .' -' ) ); + array_unshift( $options, mosHTML::makeOption( '-1', '- '. 'Do Not Use' .' -' ) ); } if ( !$node->getAttribute( 'hide_default' ) ) { - array_unshift( $options, mosHTML::makeOption( '', '- '. 'Use Default image' .' -' ) ); + array_unshift( $options, mosHTML::makeOption( '', '- '. 'Use Default' .' -' ) ); } return mosHTML::selectList( $options, ''. $control_name .'['. $name .']', 'class="inputbox"', 'value', 'text', $value, "param$name" ); diff -urN joomla-1.0.7/includes/js/joomla.javascript.js joomla-1.0.10/includes/js/joomla.javascript.js --- joomla-1.0.7/includes/js/joomla.javascript.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/js/joomla.javascript.js 2006-06-25 16:54:15.000000000 -0400 @@ -1,6 +1,6 @@ // limitstart); - return mosHTML::selectList( $limits, 'limit', - 'class="inputbox" size="1" onchange="document.location.href=\''.$link.'\';"', - 'value', 'text', $this->limit ); + $link = $link ."&limit=' + this.options[selectedIndex].value + '&limitstart=". $this->limitstart; + $link = sefRelToAbs( $link ); + return mosHTML::selectList( $limits, 'limit', 'class="inputbox" size="1" onchange="document.location.href=\''. $link .'\';"', 'value', 'text', $this->limit ); } /** * Writes the html limit # input box @@ -113,8 +112,8 @@ if ($this_page > 1) { $page = ($this_page - 2) * $this->limit; - $txt .= ''. _PN_LT . _PN_LT . $pnSpace . _PN_START .' '; - $txt .= ''. _PN_LT . $pnSpace . _PN_PREVIOUS .' '; + $txt .= ''. _PN_LT . _PN_LT . $pnSpace . _PN_START .' '; + $txt .= ''. _PN_LT . $pnSpace . _PN_PREVIOUS .' '; } else { $txt .= ''. _PN_LT . _PN_LT . $pnSpace . _PN_START .' '; $txt .= ''. _PN_LT . $pnSpace . _PN_PREVIOUS .' '; @@ -132,8 +131,8 @@ if ($this_page < $total_pages) { $page = $this_page * $this->limit; $end_page = ($total_pages-1) * $this->limit; - $txt .= ''. _PN_NEXT . $pnSpace . _PN_RT .' '; - $txt .= ''. _PN_END . $pnSpace . _PN_RT . _PN_RT .''; + $txt .= ''. _PN_NEXT . $pnSpace . _PN_RT .' '; + $txt .= ''. _PN_END . $pnSpace . _PN_RT . _PN_RT .''; } else { $txt .= ''. _PN_NEXT . $pnSpace . _PN_RT .' '; $txt .= ''. _PN_END . $pnSpace . _PN_RT . _PN_RT .''; diff -urN joomla-1.0.7/includes/patTemplate/patErrorManager.php joomla-1.0.10/includes/patTemplate/patErrorManager.php --- joomla-1.0.7/includes/patTemplate/patErrorManager.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/patTemplate/patErrorManager.php 2006-06-25 16:54:14.000000000 -0400 @@ -4,7 +4,7 @@ * application-internal error management. Creates patError objects for * any errors for precise error management. * - * $Id: patErrorManager.php 47 2005-09-15 02:55:27Z rhuk $ + * $Id: patErrorManager.php 3163 2006-04-19 23:53:40Z eddieajau $ * * @package patError */ @@ -197,7 +197,7 @@ } // build error object - $error =& new $class( $level, $code, $msg, $info ); + $error = new $class( $level, $code, $msg, $info ); // see what to do with this kind of error $handling = patErrorManager::getErrorHandling( $level ); @@ -691,7 +691,8 @@ function &handleErrorCallback( &$error, $options ) { $opt = $options['options']; - return call_user_func( $opt, $error ); + $result = call_user_func( $opt, $error ); + return $result; } } ?> \ No newline at end of file diff -urN joomla-1.0.7/includes/patTemplate/patTemplate/Function/Joomla.php joomla-1.0.10/includes/patTemplate/patTemplate/Function/Joomla.php --- joomla-1.0.7/includes/patTemplate/patTemplate/Function/Joomla.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/patTemplate/patTemplate/Function/Joomla.php 2006-06-25 16:54:13.000000000 -0400 @@ -1,6 +1,6 @@ getPage(); switch ($macro) { case 'initeditor': return initEditor( true ); break; - - case 'mainbody': - return $page->showMainBody(); - break; - - case 'loadcomponent': - // deprecated ?? - if( !isset( $params['component'] ) ) { - return false; - } else { - return $page->showComponent( $params['component'] ); - } - break; - - case 'hasmodules': - $position = mosGetParam( $params, 'position', '' ); - - if ($page->countModules( $position ) > 0) { - return $content; - } else { - return false; - } - break; - - case 'loadmodule': - $name = mosGetParam( $params, 'name', '' ); - $style = mosGetParam( $params, 'style', 0 ); - ob_start(); - $page->showModule( $name, $style ); - $html = ob_get_contents(); - ob_end_clean(); - return $html; - break; - - case 'loadmodules': - $position = mosGetParam( $params, 'position', '' ); - $style = mosGetParam( $params, 'style', 0 ); - ob_start(); - $page->showModules( $position, $style ); - $html = ob_get_contents(); - ob_end_clean(); - return $html; - break; - - case 'showhead': - return $page->showHead(); - break; - - case 'pathway': - $Itemid = mosGetParam( $_REQUEST, 'Itemid', '' ); - ob_start(); - require $GLOBALS['_CONFIG']->SITEPATH . '/includes/pathway.php'; - $html = ob_get_contents(); - ob_end_clean(); - return $html; - break; - } + } return false; } diff -urN joomla-1.0.7/includes/patTemplate/patTemplate/InputFilter/StripComments.php joomla-1.0.10/includes/patTemplate/patTemplate/InputFilter/StripComments.php --- joomla-1.0.7/includes/patTemplate/patTemplate/InputFilter/StripComments.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/patTemplate/patTemplate/InputFilter/StripComments.php 2006-06-25 16:54:14.000000000 -0400 @@ -2,7 +2,7 @@ /** * patTemplate StripComments input filter * - * $Id: StripComments.php 47 2005-09-15 02:55:27Z rhuk $ + * $Id: StripComments.php 3718 2006-05-29 06:48:03Z stingrey $ * * Will remove all HTML comments. * @@ -14,7 +14,7 @@ /** * patTemplate StripComments output filter * - * $Id: StripComments.php 47 2005-09-15 02:55:27Z rhuk $ + * $Id: StripComments.php 3718 2006-05-29 06:48:03Z stingrey $ * * Will remove all HTML comments. * @@ -42,8 +42,10 @@ */ function apply( $data ) { - $data = preg_replace( '��msU', '', $data ); - $data = preg_replace( '�/\*.*\*/�msU', '', $data ); + //$data = preg_replace( '��msU', '', $data ); + //$data = preg_replace( '�/\*.*\*/�msU', '', $data ); + $data = preg_replace( '°°msU', '', $data ); + $data = preg_replace( '°/\*.*\*/°msU', '', $data ); return $data; } diff -urN joomla-1.0.7/includes/patTemplate/tmpl/page.html joomla-1.0.10/includes/patTemplate/tmpl/page.html --- joomla-1.0.7/includes/patTemplate/tmpl/page.html 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/patTemplate/tmpl/page.html 2006-06-25 16:54:14.000000000 -0400 @@ -1,5 +1,5 @@ -@version $Id: page.html 1782 2006-01-13 02:29:37Z eddieajau $ +@version $Id: page.html 4123 2006-06-25 15:15:56Z stingrey $ @package Joomla @copyright Copyright (C) 2005 Open Source Matters. All rights reserved. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php @@ -89,7 +89,8 @@ background-image: url({TABURL}tab_active.png) !important; } .dynamic-tab-pane-control .tab-row .tab.hover { - background-image: url({TABURL}tab_hover.png); + background-image: url({TABURL}tab_hover.png); + } diff -urN joomla-1.0.7/includes/pathway.php joomla-1.0.10/includes/pathway.php --- joomla-1.0.7/includes/pathway.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/pathway.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ setQuery( $query ); - $home_menu = new mosMenu( $database ); - $database->loadObject( $home_menu ); + global $database, $option, $task, $mainframe, $mosConfig_absolute_path, $mosConfig_live_site, $my; // the the whole menu array and index the array by the id - $query = "SELECT id, name, link, parent, type" + $query = "SELECT id, name, link, parent, type, menutype, access" . "\n FROM #__menu" . "\n WHERE published = 1" - . "\n ORDER BY parent, ordering" + . "\n AND access <= $my->gid" + . "\n ORDER BY menutype, parent, ordering" ; $database->setQuery( $query ); $mitems = $database->loadObjectList( 'id' ); - //$isWin = (substr(PHP_OS, 0, 3) == 'WIN'); - //$optionstring = $isWin ? $_SERVER['QUERY_STRING'] : $_SERVER['REQUEST_URI']; + // get the home page + $home_menu = new mosMenu( $database ); + foreach( $mitems as $mitem ) { + if ( $mitem->menutype == 'mainmenu' ) { + $home_menu = $mitem; + break; + } + } + $optionstring = ''; if ( isset( $_SERVER['REQUEST_URI'] ) ) { $optionstring = $_SERVER['REQUEST_URI']; @@ -72,193 +68,201 @@ if ($Itemid == $home_menu->id) { switch ($option) { case 'content': - $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); - if ($task=='blogsection'){ - - $query = "SELECT title, id" - . "\n FROM #__sections" - . "\n WHERE id = $id" - ; - } else if ( $task=='blogcategory' ) { - $query = "SELECT title, id" - . "\n FROM #__categories" - . "\n WHERE id = $id" - ; - } else { - $query = "SELECT title, catid, id" - . "\n FROM #__content" - . "\n WHERE id = $id" - ; - } - $database->setQuery( $query ); - - $row = null; - $database->loadObject( $row ); - - $id = max( array_keys( $mitems ) ) + 1; - - // add the content item - $mitem2 = pathwayMakeLink( - $Itemid, - $row->title, - '', - 1 - ); - $mitems[$id] = $mitem2; - $Itemid = $id; - - $home = ''. $home .''; - break; - - } - } - - switch( @$mitems[$Itemid]->type ) { - case 'content_section': - $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); - - switch ($task) { - case 'category': - if ($id) { - $query = "SELECT title, id" - . "\n FROM #__categories" - . "\n WHERE id = $id" - ; - $database->setQuery( $query ); - $title = $database->loadResult(); - - $id = max( array_keys( $mitems ) ) + 1; - $mitem = pathwayMakeLink( - $id, - $title, - 'index.php?option='. $option .'&task='. $task .'&id='. $id .'&Itemid='. $Itemid, - $Itemid - ); - - $mitems[$id] = $mitem; - $Itemid = $id; - } - break; - - case 'view': - if ($id) { - // load the content item name and category - $query = "SELECT title, catid, id" - . "\n FROM #__content" - . "\n WHERE id = $id" - ; + $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); + + if ($task=='blogsection'){ + $query = "SELECT title, id" + . "\n FROM #__sections" + . "\n WHERE id = $id" + ; + } else if ( $task=='blogcategory' ) { + $query = "SELECT title, id" + . "\n FROM #__categories" + . "\n WHERE id = $id" + ; + } else { + $query = "SELECT title, catid, id" + . "\n FROM #__content" + . "\n WHERE id = $id" + ; + } $database->setQuery( $query ); + $row = null; $database->loadObject( $row ); - - // load and add the category - $query = "SELECT c.title AS title, s.id AS sectionid, c.id AS id" - . "\n FROM #__categories AS c" - . "\n LEFT JOIN #__sections AS s" - . "\n ON c.section = s.id" - . "\n WHERE c.id = $row->catid" - ; - $database->setQuery( $query ); - $result = $database->loadObjectList(); - - $title = $result[0]->title; - $sectionid = $result[0]->sectionid; - + $id = max( array_keys( $mitems ) ) + 1; - $mitem1 = pathwayMakeLink( - $Itemid, - $title, - 'index.php?option='. $option .'&task=category§ionid='. $sectionid .'&id='. $row->catid, - $Itemid - ); - - $mitems[$id] = $mitem1; - - // add the final content item - $id++; + + // add the content item $mitem2 = pathwayMakeLink( $Itemid, $row->title, '', - $id-1 + 1 ); - $mitems[$id] = $mitem2; $Itemid = $id; + + $home = ''. $home .''; + break; + } + } + // breadcrumbs for content items + switch( @$mitems[$Itemid]->type ) { + // menu item = List - Content Section + case 'content_section': + $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); + + switch ($task) { + case 'category': + if ($id) { + $query = "SELECT title, id" + . "\n FROM #__categories" + . "\n WHERE id = $id" + . "\n AND access <= $my->id" + ; + $database->setQuery( $query ); + $title = $database->loadResult(); + + $id = max( array_keys( $mitems ) ) + 1; + $mitem = pathwayMakeLink( + $id, + $title, + 'index.php?option='. $option .'&task='. $task .'&id='. $id .'&Itemid='. $Itemid, + $Itemid + ); + + $mitems[$id] = $mitem; + $Itemid = $id; + } + break; + + case 'view': + if ($id) { + // load the content item name and category + $query = "SELECT title, catid, id, access" + . "\n FROM #__content" + . "\n WHERE id = $id" + ; + $database->setQuery( $query ); + $row = null; + $database->loadObject( $row ); + + // load and add the category + $query = "SELECT c.title AS title, s.id AS sectionid, c.id AS id, c.access AS cat_access" + . "\n FROM #__categories AS c" + . "\n LEFT JOIN #__sections AS s" + . "\n ON c.section = s.id" + . "\n WHERE c.id = $row->catid" + . "\n AND c.access <= $my->id" + ; + $database->setQuery( $query ); + $result = $database->loadObjectList(); + + $title = $result[0]->title; + $sectionid = $result[0]->sectionid; + + $id = max( array_keys( $mitems ) ) + 1; + $mitem1 = pathwayMakeLink( + $Itemid, + $title, + 'index.php?option='. $option .'&task=category§ionid='. $sectionid .'&id='. $row->catid, + $Itemid + ); + + $mitems[$id] = $mitem1; + + if ( $row->access <= $my->gid ) { + // add the final content item + $id++; + $mitem2 = pathwayMakeLink( + $Itemid, + $row->title, + '', + $id-1 + ); + + $mitems[$id] = $mitem2; + } + $Itemid = $id; + + } + break; } break; - } - break; + // menu item = Table - Content Category case 'content_category': - $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); - - switch ($task) { - - case 'view': - if ($id) { - // load the content item name and category - $query = "SELECT title, catid, id" - . "\n FROM #__content" - . "\n WHERE id = $id" - ; - $database->setQuery( $query ); - $row = null; - $database->loadObject( $row ); - - $id = max( array_keys( $mitems ) ) + 1; - // add the final content item - $mitem2 = pathwayMakeLink( - $Itemid, - $row->title, - '', - $Itemid - ); - - $mitems[$id] = $mitem2; - $Itemid = $id; - + $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); + + switch ($task) { + case 'view': + if ($id) { + // load the content item name and category + $query = "SELECT title, catid, id" + . "\n FROM #__content" + . "\n WHERE id = $id" + . "\n AND access <= $my->id" + ; + $database->setQuery( $query ); + $row = null; + $database->loadObject( $row ); + + $id = max( array_keys( $mitems ) ) + 1; + // add the final content item + $mitem2 = pathwayMakeLink( + $Itemid, + $row->title, + '', + $Itemid + ); + + $mitems[$id] = $mitem2; + $Itemid = $id; + + } + break; } break; - } - break; + // menu item = Blog - Content Category + // menu item = Blog - Content Section case 'content_blog_category': case 'content_blog_section': - switch ($task) { - case 'view': - $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); - - if ($id) { - // load the content item name and category - - $query = "SELECT title, catid, id" - . "\n FROM #__content" - . "\n WHERE id = $id" - ; - $database->setQuery( $query ); - $row = null; - $database->loadObject( $row ); - - $id = max( array_keys( $mitems ) ) + 1; - $mitem2 = pathwayMakeLink( - $Itemid, - $row->title, - '', - $Itemid - ); - $mitems[$id] = $mitem2; - $Itemid = $id; - + switch ($task) { + case 'view': + $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); + if ($id) { + // load the content item name and category + + $query = "SELECT title, catid, id" + . "\n FROM #__content" + . "\n WHERE id = $id" + . "\n AND access <= $my->id" + ; + $database->setQuery( $query ); + $row = null; + $database->loadObject( $row ); + + $id = max( array_keys( $mitems ) ) + 1; + $mitem2 = pathwayMakeLink( + $Itemid, + $row->title, + '', + $Itemid + ); + $mitems[$id] = $mitem2; + $Itemid = $id; + + } + break; } break; - } - break; } - $i = count( $mitems ); - $mid = $Itemid; + $i = count( $mitems ); + $mid = $Itemid; $imgPath = 'templates/' . $mainframe->getTemplate() . '/images/arrow.png'; if (file_exists( "$mosConfig_absolute_path/$imgPath" )){ @@ -278,8 +282,7 @@ } $item =& $mitems[$mid]; - // converts & to & for xtml compliance - $itemname = ampReplace( $item->name ); + $itemname = stripslashes( $item->name ); // if it is the current page, then display a non hyperlink if ($item->id == $Itemid || empty( $mid ) || empty($item->link)) { @@ -295,6 +298,7 @@ $newlink = ''. $itemname .''; } + // converts & to & for xtml compliance $newlink = ampReplace( $newlink ); if (trim($newlink)!="") { @@ -315,9 +319,16 @@ $path .= implode ( "$img " ,$mainframe->getCustomPathWay()); } - echo ''. $home .' '. $path .''; + if ( $Itemid && $Itemid != 99999999 ) { + echo ''. $home .' '. $path .''; + } } // code placed in a function to prevent messing up global variables -showPathway( $Itemid ); +if (!defined( '_JOS_PATHWAY' )) { + // ensure that functions are declared only once + define( '_JOS_PATHWAY', 1 ); + + showPathway( $Itemid ); +} ?> \ No newline at end of file diff -urN joomla-1.0.7/includes/phpInputFilter/class.inputfilter.php joomla-1.0.10/includes/phpInputFilter/class.inputfilter.php --- joomla-1.0.7/includes/phpInputFilter/class.inputfilter.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/phpInputFilter/class.inputfilter.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,209 +1,377 @@ tagsArray = (array) $tagsArray; - $this->attrArray = (array) $attrArray; - $this->tagsMethod = $tagsMethod; - $this->attrMethod = $attrMethod; - $this->xssAuto = $xssAuto; + * Constructor for inputFilter class. Only first parameter is required. + * + * @access protected + * @param array $tagsArray list of user-defined tags + * @param array $attrArray list of user-defined attributes + * @param int $tagsMethod WhiteList method = 0, BlackList method = 1 + * @param int $attrMethod WhiteList method = 0, BlackList method = 1 + * @param int $xssAuto Only auto clean essentials = 0, Allow clean + * blacklisted tags/attr = 1 + */ + function inputFilter($tagsArray = array (), $attrArray = array (), $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) + { + /* + * Make sure user defined arrays are in lowercase + */ + $tagsArray = array_map('strtolower', (array) $tagsArray); + $attrArray = array_map('strtolower', (array) $attrArray); + + /* + * Assign member variables + */ + $this->tagsArray = $tagsArray; + $this->attrArray = $attrArray; + $this->tagsMethod = $tagsMethod; + $this->attrMethod = $attrMethod; + $this->xssAuto = $xssAuto; } /** - * Method to be called by another php script. Processes for XSS and specified bad code. - * @access public - * @param Mixed $source - input string/array-of-string to be 'cleaned' - * @return String $source - 'cleaned' version of input parameter - */ - function process($source) { - // clean all elements in this array - if (is_array($source)) { - foreach($source as $key => $value) + * Method to be called by another php script. Processes for XSS and + * specified bad code. + * + * @access public + * @param mixed $source Input string/array-of-string to be 'cleaned' + * @return mixed $source 'cleaned' version of input parameter + */ + function process($source) + { + /* + * Are we dealing with an array? + */ + if (is_array($source)) + { + foreach ($source as $key => $value) + { // filter element for XSS and other 'bad' code etc. - if (is_string($value)) $source[$key] = $this->remove($this->decode($value)); + if (is_string($value)) + { + $source[$key] = $this->remove($this->decode($value)); + } + } return $source; - // clean this string - } else if (is_string($source) && !empty($source)) { - // filter source for XSS and other 'bad' code etc. - return $this->remove($this->decode($source)); - // return parameter as given - } else return $source; + } else + /* + * Or a string? + */ + if (is_string($source) && !empty ($source)) + { + // filter source for XSS and other 'bad' code etc. + return $this->remove($this->decode($source)); + } else + { + /* + * Not an array or string.. return the passed parameter + */ + return $source; + } } /** - * Internal method to iteratively remove all unwanted tags and attributes - * @access protected - * @param String $source - input string to be 'cleaned' - * @return String $source - 'cleaned' version of input parameter - */ - function remove($source) { - $loopCounter=0; - // provides nested-tag protection - while($source != $this->filterTags($source)) { + * Internal method to iteratively remove all unwanted tags and attributes + * + * @access protected + * @param string $source Input string to be 'cleaned' + * @return string $source 'cleaned' version of input parameter + */ + function remove($source) + { + $loopCounter = 0; + /* + * Iteration provides nested tag protection + */ + while ($source != $this->filterTags($source)) + { $source = $this->filterTags($source); - $loopCounter++; + $loopCounter ++; } return $source; } /** - * Internal method to strip a string of certain tags - * @access protected - * @param String $source - input string to be 'cleaned' - * @return String $source - 'cleaned' version of input parameter - */ - function filterTags($source) { - // filter pass setup - $preTag = NULL; - $postTag = $source; - // find initial tag's position - $tagOpen_start = strpos($source, '<'); - // interate through string until no tags left - while($tagOpen_start !== FALSE) { - // process tag interatively - $preTag .= substr($postTag, 0, $tagOpen_start); - $postTag = substr($postTag, $tagOpen_start); - $fromTagOpen = substr($postTag, 1); - // end of tag - $tagOpen_end = strpos($fromTagOpen, '>'); - if ($tagOpen_end === false) break; - // next start of tag (for nested tag assessment) + * Internal method to strip a string of certain tags + * + * @access protected + * @param string $source Input string to be 'cleaned' + * @return string $source 'cleaned' version of input parameter + */ + function filterTags($source) + { + /* + * In the beginning we don't really have a tag, so everything is + * postTag + */ + $preTag = null; + $postTag = $source; + + /* + * Is there a tag? If so it will certainly start with a '<' + */ + $tagOpen_start = strpos($source, '<'); + + while ($tagOpen_start !== false) + { + + /* + * Get some information about the tag we are processing + */ + $preTag .= substr($postTag, 0, $tagOpen_start); + $postTag = substr($postTag, $tagOpen_start); + $fromTagOpen = substr($postTag, 1); + $tagOpen_end = strpos($fromTagOpen, '>'); + + /* + * Let's catch any non-terminated tags and skip over them + */ + if ($tagOpen_end === false) + { + $postTag = substr($postTag, $tagOpen_start +1); + $tagOpen_start = strpos($postTag, '<'); + continue; + } + + /* + * Do we have a nested tag? + */ $tagOpen_nested = strpos($fromTagOpen, '<'); - if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) { - $preTag .= substr($postTag, 0, ($tagOpen_nested+1)); - $postTag = substr($postTag, ($tagOpen_nested+1)); - $tagOpen_start = strpos($postTag, '<'); + $tagOpen_nested_end = strpos(substr($postTag, $tagOpen_end), '>'); + if (($tagOpen_nested !== false) && ($tagOpen_nested < $tagOpen_end)) + { + $preTag .= substr($postTag, 0, ($tagOpen_nested +1)); + $postTag = substr($postTag, ($tagOpen_nested +1)); + $tagOpen_start = strpos($postTag, '<'); continue; } - $tagOpen_nested = (strpos($fromTagOpen, '<') + $tagOpen_start + 1); - $currentTag = substr($fromTagOpen, 0, $tagOpen_end); - $tagLength = strlen($currentTag); - if (!$tagOpen_end) { - $preTag .= $postTag; - $tagOpen_start = strpos($postTag, '<'); - } - // iterate through tag finding attribute pairs - setup - $tagLeft = $currentTag; - $attrSet = array(); - $currentSpace = strpos($tagLeft, ' '); - // is end tag - if (substr($currentTag, 0, 1) == "/") { - $isCloseTag = TRUE; - list($tagName) = explode(' ', $currentTag); - $tagName = substr($tagName, 1); - // is start tag - } else { - $isCloseTag = FALSE; - list($tagName) = explode(' ', $currentTag); - } - // excludes all "non-regular" tagnames OR no tagname OR remove if xssauto is on and tag is blacklisted - if ((!preg_match("/^[a-z][a-z0-9]*$/i",$tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) { - $postTag = substr($postTag, ($tagLength + 2)); - $tagOpen_start = strpos($postTag, '<'); - // don't append this tag + + + /* + * Lets get some information about our tag and setup attribute pairs + */ + $tagOpen_nested = (strpos($fromTagOpen, '<') + $tagOpen_start +1); + $currentTag = substr($fromTagOpen, 0, $tagOpen_end); + $tagLength = strlen($currentTag); + $tagLeft = $currentTag; + $attrSet = array (); + $currentSpace = strpos($tagLeft, ' '); + + /* + * Are we an open tag or a close tag? + */ + if (substr($currentTag, 0, 1) == "/") + { + // Close Tag + $isCloseTag = true; + list ($tagName) = explode(' ', $currentTag); + $tagName = substr($tagName, 1); + } else + { + // Open Tag + $isCloseTag = false; + list ($tagName) = explode(' ', $currentTag); + } + + /* + * Exclude all "non-regular" tagnames + * OR no tagname + * OR remove if xssauto is on and tag is blacklisted + */ + if ((!preg_match("/^[a-z][a-z0-9]*$/i", $tagName)) || (!$tagName) || ((in_array(strtolower($tagName), $this->tagBlacklist)) && ($this->xssAuto))) + { + $postTag = substr($postTag, ($tagLength +2)); + $tagOpen_start = strpos($postTag, '<'); + // Strip tag continue; } - // this while is needed to support attribute values with spaces in! - while ($currentSpace !== FALSE) { - $fromSpace = substr($tagLeft, ($currentSpace+1)); - $nextSpace = strpos($fromSpace, ' '); - $openQuotes = strpos($fromSpace, '"'); - $closeQuotes = strpos(substr($fromSpace, ($openQuotes+1)), '"') + $openQuotes + 1; - // another equals exists - if (strpos($fromSpace, '=') !== FALSE) { - // opening and closing quotes exists - if (($openQuotes !== FALSE) && (strpos(substr($fromSpace, ($openQuotes+1)), '"') !== FALSE)) - $attr = substr($fromSpace, 0, ($closeQuotes+1)); - // one or neither exist - else $attr = substr($fromSpace, 0, $nextSpace); - // no more equals exist - } else $attr = substr($fromSpace, 0, $nextSpace); - // last attr pair - if (!$attr) $attr = $fromSpace; - // add to attribute pairs array + + /* + * Time to grab any attributes from the tag... need this section in + * case attributes have spaces in the values. + */ + while ($currentSpace !== false) + { + $fromSpace = substr($tagLeft, ($currentSpace +1)); + $nextSpace = strpos($fromSpace, ' '); + $openQuotes = strpos($fromSpace, '"'); + $closeQuotes = strpos(substr($fromSpace, ($openQuotes +1)), '"') + $openQuotes +1; + + /* + * Do we have an attribute to process? [check for equal sign] + */ + if (strpos($fromSpace, '=') !== false) + { + /* + * If the attribute value is wrapped in quotes we need to + * grab the substring from the closing quote, otherwise grab + * till the next space + */ + if (($openQuotes !== false) && (strpos(substr($fromSpace, ($openQuotes +1)), '"') !== false)) + { + $attr = substr($fromSpace, 0, ($closeQuotes +1)); + } else + { + $attr = substr($fromSpace, 0, $nextSpace); + } + } else + { + /* + * No more equal signs so add any extra text in the tag into + * the attribute array [eg. checked] + */ + $attr = substr($fromSpace, 0, $nextSpace); + } + + // Last Attribute Pair + if (!$attr) + { + $attr = $fromSpace; + } + + /* + * Add attribute pair to the attribute array + */ $attrSet[] = $attr; - // next inc - $tagLeft = substr($fromSpace, strlen($attr)); - $currentSpace = strpos($tagLeft, ' '); + + /* + * Move search point and continue iteration + */ + $tagLeft = substr($fromSpace, strlen($attr)); + $currentSpace = strpos($tagLeft, ' '); } - // appears in array specified by user + + /* + * Is our tag in the user input array? + */ $tagFound = in_array(strtolower($tagName), $this->tagsArray); - // remove this tag on condition - if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) { - // reconstruct tag with allowed attributes - if (!$isCloseTag) { + + /* + * If the tag is allowed lets append it to the output string + */ + if ((!$tagFound && $this->tagsMethod) || ($tagFound && !$this->tagsMethod)) + { + /* + * Reconstruct tag with allowed attributes + */ + if (!$isCloseTag) + { + // Open or Single tag $attrSet = $this->filterAttr($attrSet); - $preTag .= '<' . $tagName; - for ($i = 0; $i < count($attrSet); $i++) - $preTag .= ' ' . $attrSet[$i]; - // reformat single tags to XHTML - if (strpos($fromTagOpen, "'; - else $preTag .= ' />'; - // just the tagname - } else $preTag .= ''; - } - // find next tag's start - $postTag = substr($postTag, ($tagLength + 2)); - $tagOpen_start = strpos($postTag, '<'); + $preTag .= '<'.$tagName; + for ($i = 0; $i < count($attrSet); $i ++) + { + $preTag .= ' '.$attrSet[$i]; + } + + /* + * Reformat single tags to XHTML + */ + if (strpos($fromTagOpen, "'; + } else + { + $preTag .= ' />'; + } + } else + { + // Closing Tag + $preTag .= ''; + } + } + + /* + * Find next tag's start and continue iteration + */ + $postTag = substr($postTag, ($tagLength +2)); + $tagOpen_start = strpos($postTag, '<'); + //print "T: $preTag\n"; + } + + /* + * Append any code after the end of tags and return + */ + if ($postTag != '<') + { + $preTag .= $postTag; } - // append any code after end of tags - $preTag .= $postTag; return $preTag; } /** - * Internal method to strip a tag of certain attributes - * @access protected - * @param Array $attrSet - * @return Array $newSet - */ - function filterAttr($attrSet) { - $newSet = array(); - // process attributes - for ($i = 0; $i xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on')))) + * Internal method to strip a tag of certain attributes + * + * @access protected + * @param array $attrSet Array of attribute pairs to filter + * @return array $newSet Filtered array of attribute pairs + */ + function filterAttr($attrSet) + { + /* + * Initialize variables + */ + $newSet = array (); + + /* + * Iterate through attribute pairs + */ + for ($i = 0; $i < count($attrSet); $i ++) + { + /* + * Skip blank spaces + */ + if (!$attrSet[$i]) + { + continue; + } + + /* + * Split into name/value pairs + */ + $attrSubSet = explode('=', trim($attrSet[$i]), 2); + list ($attrSubSet[0]) = explode(' ', $attrSubSet[0]); + + /* + * Remove all "non-regular" attribute names + * AND blacklisted attributes + */ + if ((!eregi("^[a-z]*$", $attrSubSet[0])) || (($this->xssAuto) && ((in_array(strtolower($attrSubSet[0]), $this->attrBlacklist)) || (substr($attrSubSet[0], 0, 2) == 'on')))) + { continue; - // xss attr value filtering - if ($attrSubSet[1]) { + } + + /* + * XSS attribute value filtering + */ + if ($attrSubSet[1]) + { // strips unicode, hex, etc $attrSubSet[1] = str_replace('&#', '', $attrSubSet[1]); // strip normal newline within attr value @@ -212,24 +380,49 @@ $attrSubSet[1] = str_replace('"', '', $attrSubSet[1]); // [requested feature] convert single quotes from either side to doubles (Single quotes shouldn't be used to pad attr value) if ((substr($attrSubSet[1], 0, 1) == "'") && (substr($attrSubSet[1], (strlen($attrSubSet[1]) - 1), 1) == "'")) + { $attrSubSet[1] = substr($attrSubSet[1], 1, (strlen($attrSubSet[1]) - 2)); + } // strip slashes $attrSubSet[1] = stripslashes($attrSubSet[1]); } - // auto strip attr's with "javascript: - if (InputFilter::badAttributeValue( $attrSubSet )) + + /* + * Autostrip script tags + */ + if (InputFilter :: badAttributeValue($attrSubSet)) + { continue; + } - // if matches user defined array + /* + * Is our attribute in the user input array? + */ $attrFound = in_array(strtolower($attrSubSet[0]), $this->attrArray); - // keep this attr on condition - if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) { - // attr has value - if ($attrSubSet[1]) $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[1] . '"'; - // attr has decimal zero as value - else if ($attrSubSet[1] == "0") $newSet[] = $attrSubSet[0] . '="0"'; - // reformat single attributes to XHTML - else $newSet[] = $attrSubSet[0] . '="' . $attrSubSet[0] . '"'; + + /* + * If the tag is allowed lets keep it + */ + if ((!$attrFound && $this->attrMethod) || ($attrFound && !$this->attrMethod)) + { + /* + * Does the attribute have a value? + */ + if ($attrSubSet[1]) + { + $newSet[] = $attrSubSet[0].'="'.$attrSubSet[1].'"'; + } + elseif ($attrSubSet[1] == "0") + { + /* + * Special Case + * Is the value 0? + */ + $newSet[] = $attrSubSet[0].'="0"'; + } else + { + $newSet[] = $attrSubSet[0].'="'.$attrSubSet[0].'"'; + } } } return $newSet; @@ -237,91 +430,123 @@ /** * Function to determine if contents of an attribute is safe - * @param Array A 2 element array for attribute [name] and [value] - * @return Boolean True if bad code is detected + * + * @access protected + * @param array $attrSubSet A 2 element array for attributes name,value + * @return boolean True if bad code is detected */ - function badAttributeValue( $attrSubSet ) { - $attrSubSet[0] = strtolower( $attrSubSet[0] ); - $attrSubSet[1] = strtolower( $attrSubSet[1] ); - return ( - ((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || - (strpos($attrSubSet[1], 'javascript:') !== false) || - (strpos($attrSubSet[1], 'behaviour:') !== false) || - (strpos($attrSubSet[1], 'vbscript:') !== false) || - (strpos($attrSubSet[1], 'mocha:') !== false) || - (strpos($attrSubSet[1], 'livescript:') !== false) - ); + function badAttributeValue($attrSubSet) + { + $attrSubSet[0] = strtolower($attrSubSet[0]); + $attrSubSet[1] = strtolower($attrSubSet[1]); + return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || (strpos($attrSubSet[1], 'javascript:') !== false) || (strpos($attrSubSet[1], 'behaviour:') !== false) || (strpos($attrSubSet[1], 'vbscript:') !== false) || (strpos($attrSubSet[1], 'mocha:') !== false) || (strpos($attrSubSet[1], 'livescript:') !== false)); } /** - * Try to convert to plaintext - * @access protected - * @param String $source - * @return String $source - */ - function decode($source) { + * Try to convert to plaintext + * + * @access protected + * @param string $source + * @return string Plaintext string + */ + function decode($source) + { // url decode $source = html_entity_decode($source, ENT_QUOTES, "ISO-8859-1"); // convert decimal - $source = preg_replace('/&#(\d+);/me',"chr(\\1)", $source); // decimal notation + $source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation // convert hex - $source = preg_replace('/&#x([a-f0-9]+);/mei',"chr(0x\\1)", $source); // hex notation + $source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation return $source; } /** - * Method to be called by another php script. Processes for SQL injection - * @access public - * @param Mixed $source - input string/array-of-string to be 'cleaned' - * @param Buffer $connection - An open MySQL connection - * @return String $source - 'cleaned' version of input parameter - */ - function safeSQL($source, &$connection) { + * Method to be called by another php script. Processes for SQL injection + * + * @access public + * @param mixed $source input string/array-of-string to be 'cleaned' + * @param resource $connection - An open MySQL connection + * @return string 'cleaned' version of input parameter + */ + function safeSQL($source, & $connection) + { // clean all elements in this array - if (is_array($source)) { - foreach($source as $key => $value) + if (is_array($source)) + { + foreach ($source as $key => $value) + { // filter element for SQL injection - if (is_string($value)) $source[$key] = $this->quoteSmart($this->decode($value), $connection); + if (is_string($value)) + { + $source[$key] = $this->quoteSmart($this->decode($value), $connection); + } + } return $source; - // clean this string - } else if (is_string($source)) { - // filter source for SQL injection - if (is_string($source)) return $this->quoteSmart($this->decode($source), $connection); - // return parameter as given - } else return $source; + // clean this string + } else + if (is_string($source)) + { + // filter source for SQL injection + if (is_string($source)) + { + return $this->quoteSmart($this->decode($source), $connection); + } + // return parameter as given + } else + { + return $source; + } } /** - * @author Chris Tobin - * @author Daniel Morris - * @access protected - * @param String $source - * @param Resource $connection - An open MySQL connection - * @return String $source - */ - function quoteSmart($source, &$connection) { - // strip slashes - if (get_magic_quotes_gpc()) $source = stripslashes($source); - // quote both numeric and text + * Method to escape a string + * + * @author Chris Tobin + * @author Daniel Morris + * + * @access protected + * @param string $source + * @param resource $connection An open MySQL connection + * @return string Escaped string + */ + function quoteSmart($source, & $connection) + { + /* + * Strip escaping slashes if necessary + */ + if (get_magic_quotes_gpc()) + { + $source = stripslashes($source); + } + + /* + * Escape numeric and text values + */ $source = $this->escapeString($source, $connection); return $source; } /** - * @author Chris Tobin - * @author Daniel Morris - * @access protected - * @param String $source - * @param Resource $connection - An open MySQL connection - * @return String $source - */ - function escapeString($string, &$connection) { - // depreciated function - if (version_compare(phpversion(),"4.3.0", "<")) mysql_escape_string($string); - // current function - else mysql_real_escape_string($string); + * @author Chris Tobin + * @author Daniel Morris + * + * @access protected + * @param string $source + * @param resource $connection An open MySQL connection + * @return string Escaped string + */ + function escapeString($string, & $connection) { + /* + * Use the appropriate escape string depending upon which version of php + * you are running + */ + if (version_compare(phpversion(), '4.3.0', '<')) { + $string = mysql_escape_string($string); + } else { + $string = mysql_real_escape_string($string); + } + return $string; } } - -?> +?> \ No newline at end of file diff -urN joomla-1.0.7/includes/sef.php joomla-1.0.10/includes/sef.php --- joomla-1.0.7/includes/sef.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/sef.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ $value) { if ( !strcasecmp(substr($value,0,5),'lang,') ) { $temp = explode(',', $value); - if (isset($temp[0]) && $temp[0]!='' && isset($temp[1]) && $temp[1]!='') { + if (isset($temp[0]) && $temp[0] != '' && isset($temp[1]) && $temp[1] != '') { $_GET['lang'] = $temp[1]; $_REQUEST['lang'] = $temp[1]; $lang = $temp[1]; @@ -44,7 +44,118 @@ } } - if (isset($url_array[$pos+6]) && $url_array[$pos+6]!='') { + if (isset($url_array[$pos+8]) && $url_array[$pos+8] != '' && in_array('category', $url_array) && ( strpos( $url_array[$pos+5], 'order,' ) !== false ) && ( strpos( $url_array[$pos+6], 'filter,' ) !== false ) ) { + // $option/$task/$sectionid/$id/$Itemid/$order/$filter/$limit/$limitstart + $task = $url_array[$pos+1]; + $sectionid = $url_array[$pos+2]; + $id = $url_array[$pos+3]; + $Itemid = $url_array[$pos+4]; + $order = str_replace( 'order,', '', $url_array[$pos+5] ); + $filter = str_replace( 'filter,', '', $url_array[$pos+6] ); + $limit = $url_array[$pos+7]; + $limitstart = $url_array[$pos+8]; + + // pass data onto global variables + $_GET['task'] = $task; + $_REQUEST['task'] = $task; + $_GET['sectionid'] = $sectionid; + $_REQUEST['sectionid'] = $sectionid; + $_GET['id'] = $id; + $_REQUEST['id'] = $id; + $_GET['Itemid'] = $Itemid; + $_REQUEST['Itemid'] = $Itemid; + $_GET['order'] = $order; + $_REQUEST['order'] = $order; + $_GET['filter'] = $filter; + $_REQUEST['filter'] = $filter; + $_GET['limit'] = $limit; + $_REQUEST['limit'] = $limit; + $_GET['limitstart'] = $limitstart; + $_REQUEST['limitstart'] = $limitstart; + + $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&order=$order&filter=$filter&limit=$limit&limitstart=$limitstart"; + } else if (isset($url_array[$pos+7]) && $url_array[$pos+7] != '' && $url_array[$pos+5] > 1000 && ( in_array('archivecategory', $url_array) || in_array('archivesection', $url_array) ) ) { + // $option/$task/$id/$limit/$limitstart/year/month/module + $task = $url_array[$pos+1]; + $id = $url_array[$pos+2]; + $limit = $url_array[$pos+3]; + $limitstart = $url_array[$pos+4]; + $year = $url_array[$pos+5]; + $month = $url_array[$pos+6]; + $module = $url_array[$pos+7]; + + // pass data onto global variables + $_GET['task'] = $task; + $_REQUEST['task'] = $task; + $_GET['id'] = $id; + $_REQUEST['id'] = $id; + $_GET['limit'] = $limit; + $_REQUEST['limit'] = $limit; + $_GET['limitstart'] = $limitstart; + $_REQUEST['limitstart'] = $limitstart; + $_GET['year'] = $year; + $_REQUEST['year'] = $year; + $_GET['month'] = $month; + $_REQUEST['month'] = $month; + $_GET['module'] = $module; + $_REQUEST['module'] = $module; + + $QUERY_STRING = "option=com_content&task=$task&id=$id&limit=$limit&limitstart=$limitstart&year=$year&month=$month&module=$module"; + } else if (isset($url_array[$pos+7]) && $url_array[$pos+7] != '' && $url_array[$pos+6] > 1000 && ( in_array('archivecategory', $url_array) || in_array('archivesection', $url_array) ) ) { + // $option/$task/$id/$Itemid/$limit/$limitstart/year/month + $task = $url_array[$pos+1]; + $id = $url_array[$pos+2]; + $Itemid = $url_array[$pos+3]; + $limit = $url_array[$pos+4]; + $limitstart = $url_array[$pos+5]; + $year = $url_array[$pos+6]; + $month = $url_array[$pos+7]; + + // pass data onto global variables + $_GET['task'] = $task; + $_REQUEST['task'] = $task; + $_GET['id'] = $id; + $_REQUEST['id'] = $id; + $_GET['Itemid'] = $Itemid; + $_REQUEST['Itemid'] = $Itemid; + $_GET['limit'] = $limit; + $_REQUEST['limit'] = $limit; + $_GET['limitstart'] = $limitstart; + $_REQUEST['limitstart'] = $limitstart; + $_GET['year'] = $year; + $_REQUEST['year'] = $year; + $_GET['month'] = $month; + $_REQUEST['month'] = $month; + + $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart&year=$year&month=$month"; + } else if (isset($url_array[$pos+7]) && $url_array[$pos+7] != '' && in_array('category', $url_array) && ( strpos( $url_array[$pos+5], 'order,' ) !== false )) { + // $option/$task/$sectionid/$id/$Itemid/$order/$limit/$limitstart + $task = $url_array[$pos+1]; + $sectionid = $url_array[$pos+2]; + $id = $url_array[$pos+3]; + $Itemid = $url_array[$pos+4]; + $order = str_replace( 'order,', '', $url_array[$pos+5] ); + $limit = $url_array[$pos+6]; + $limitstart = $url_array[$pos+7]; + + // pass data onto global variables + $_GET['task'] = $task; + $_REQUEST['task'] = $task; + $_GET['sectionid'] = $sectionid; + $_REQUEST['sectionid'] = $sectionid; + $_GET['id'] = $id; + $_REQUEST['id'] = $id; + $_GET['Itemid'] = $Itemid; + $_REQUEST['Itemid'] = $Itemid; + $_GET['order'] = $order; + $_REQUEST['order'] = $order; + $_GET['limit'] = $limit; + $_REQUEST['limit'] = $limit; + $_GET['limitstart'] = $limitstart; + $_REQUEST['limitstart'] = $limitstart; + + $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&order=$order&limit=$limit&limitstart=$limitstart"; + } else if (isset($url_array[$pos+6]) && $url_array[$pos+6] != '') { // $option/$task/$sectionid/$id/$Itemid/$limit/$limitstart $task = $url_array[$pos+1]; $sectionid = $url_array[$pos+2]; @@ -68,7 +179,7 @@ $_REQUEST['limitstart'] = $limitstart; $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart"; - } else if (isset($url_array[$pos+5]) && $url_array[$pos+5]!='') { + } else if (isset($url_array[$pos+5]) && $url_array[$pos+5] != '') { // $option/$task/$id/$Itemid/$limit/$limitstart $task = $url_array[$pos+1]; $id = $url_array[$pos+2]; @@ -89,8 +200,8 @@ $_REQUEST['limitstart'] = $limitstart; $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart"; - } else if (isset($url_array[$pos+4]) && $url_array[$pos+4]!='' && ( in_array('archivecategory', $url_array) || in_array('archivesection', $url_array) )) { - // $option/$task/$Itemid/$year/$month/$module + } else if (isset($url_array[$pos+4]) && $url_array[$pos+4] != '' && ( in_array('archivecategory', $url_array) || in_array('archivesection', $url_array) )) { + // $option/$task/$year/$month/$module $task = $url_array[$pos+1]; $year = $url_array[$pos+2]; $month = $url_array[$pos+3]; @@ -107,7 +218,7 @@ $_REQUEST['module'] = $module; $QUERY_STRING = "option=com_content&task=$task&year=$year&month=$month&module=$module"; - } else if (!(isset($url_array[$pos+5]) && $url_array[$pos+5]!='') && isset($url_array[$pos+4]) && $url_array[$pos+4]!='') { + } else if (!(isset($url_array[$pos+5]) && $url_array[$pos+5] != '') && isset($url_array[$pos+4]) && $url_array[$pos+4] != '') { // $option/$task/$sectionid/$id/$Itemid $task = $url_array[$pos+1]; $sectionid = $url_array[$pos+2]; @@ -125,7 +236,7 @@ $_REQUEST['Itemid'] = $Itemid; $QUERY_STRING = "option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid"; - } else if (!(isset($url_array[$pos+4]) && $url_array[$pos+4]!='') && (isset($url_array[$pos+3]) && $url_array[$pos+3]!='')) { + } else if (!(isset($url_array[$pos+4]) && $url_array[$pos+4] != '') && (isset($url_array[$pos+3]) && $url_array[$pos+3] != '')) { // $option/$task/$id/$Itemid $task = $url_array[$pos+1]; $id = $url_array[$pos+2]; @@ -140,7 +251,7 @@ $_REQUEST['Itemid'] = $Itemid; $QUERY_STRING = "option=com_content&task=$task&id=$id&Itemid=$Itemid"; - } else if (!(isset($url_array[$pos+3]) && $url_array[$pos+3]!='') && (isset($url_array[$pos+2]) && $url_array[$pos+2]!='')) { + } else if (!(isset($url_array[$pos+3]) && $url_array[$pos+3] != '') && (isset($url_array[$pos+2]) && $url_array[$pos+2] != '')) { // $option/$task/$id $task = $url_array[$pos+1]; $id = $url_array[$pos+2]; @@ -152,7 +263,7 @@ $_REQUEST['id'] = $id; $QUERY_STRING = "option=com_content&task=$task&id=$id"; - } else if (!(isset($url_array[$pos+2]) && $url_array[$pos+2]!='') && (isset($url_array[$pos+1]) && $url_array[$pos+1]!='')) { + } else if (!(isset($url_array[$pos+2]) && $url_array[$pos+2] != '') && (isset($url_array[$pos+1]) && $url_array[$pos+1] != '')) { // $option/$task $task = $url_array[$pos+1]; @@ -163,7 +274,7 @@ } if ($lang!='') { - $QUERY_STRING .= '&lang='. $lang; + $QUERY_STRING .= '&lang='. $lang; } $_SERVER['QUERY_STRING'] = $QUERY_STRING; @@ -179,16 +290,53 @@ $uri = explode('component/', $_SERVER['REQUEST_URI']); $uri_array = explode('/', $uri[1]); $QUERY_STRING = ''; + + // needed for check if component exists + $path = $mosConfig_absolute_path .'/components'; + $dirlist = array(); + if ( is_dir( $path ) ) { + $base = opendir( $path ); + while (false !== ( $dir = readdir($base) ) ) { + if (is_dir($path .'/'. $dir) && $dir !== '.' && $dir !== '..' && strtolower($dir) !== 'cvs' && strtolower($dir) !== '.svn') { + $dirlist[] = $dir; + } + } + closedir($base); + } foreach($uri_array as $value) { $temp = explode(',', $value); if (isset($temp[0]) && $temp[0]!='' && isset($temp[1]) && $temp[1]!='') { $_GET[$temp[0]] = $temp[1]; $_REQUEST[$temp[0]] = $temp[1]; - $QUERY_STRING .= $QUERY_STRING=='' ? "$temp[0]=$temp[1]" : "&$temp[0]=$temp[1]"; + + // check to ensure component actually exists + if ( $temp[0] == 'option' ) { + $check = ''; + if (count( $dirlist )) { + foreach ( $dirlist as $dir ) { + if ( $temp[1] == $dir ) { + $check = 1; + break; + } + } + } + // redirect to 404 page if no component found to match url + if ( !$check ) { + header( 'HTTP/1.0 404 Not Found' ); + require_once( $mosConfig_absolute_path . '/templates/404.php' ); + exit( 404 ); + } + } + + if ( $QUERY_STRING == '' ) { + $QUERY_STRING .= "$temp[0]=$temp[1]"; + } else { + $QUERY_STRING .= "&$temp[0]=$temp[1]"; + } } } - + $_SERVER['QUERY_STRING'] = $QUERY_STRING; $REQUEST_URI = $uri[0].'index.php?'.$QUERY_STRING; $_SERVER['REQUEST_URI'] = $REQUEST_URI; @@ -212,14 +360,13 @@ */ $jdir = str_replace( 'index.php', '', $_SERVER['PHP_SELF'] ); $juri = str_replace( $jdir, '', $_SERVER['REQUEST_URI'] ); - - if ($juri != "" && !eregi( "index\.php", $_SERVER['REQUEST_URI'] ) && !eregi( "index2\.php", $_SERVER['REQUEST_URI'] ) && !eregi( "/\?", $_SERVER['REQUEST_URI'] ) ) { + + if ($juri != '' && $juri != '/' && !eregi( "index\.php", $_SERVER['REQUEST_URI'] ) && !eregi( "index2\.php", $_SERVER['REQUEST_URI'] ) && !eregi( "/\?", $_SERVER['REQUEST_URI'] ) && $_SERVER['QUERY_STRING'] == '' ) { header( 'HTTP/1.0 404 Not Found' ); require_once( $mosConfig_absolute_path . '/templates/404.php' ); exit( 404 ); } } - } /** @@ -228,131 +375,170 @@ * @return string */ function sefRelToAbs( $string ) { - global $mosConfig_live_site, $mosConfig_sef, $mosConfig_mbf_content; + global $mosConfig_live_site, $mosConfig_sef, $mosConfig_mbf_content, $mosConfig_multilingual_support; global $iso_client_lang; - if( $mosConfig_mbf_content && $string!='index.php' && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php') && !eregi('lang=', $string) ) { - $string .= '&lang='. $iso_client_lang; + //multilingual code url support + if( $mosConfig_sef && ($mosConfig_mbf_content || $mosConfig_multilingual_support) && $string!='index.php' && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php') && !eregi('lang=', $string) ) { + $string .= '&lang='. $iso_client_lang; } + // SEF URL Handling if ($mosConfig_sef && !eregi("^(([^:/?#]+):)",$string) && !strcasecmp(substr($string,0,9),'index.php')) { - // Replace all & with & $string = str_replace( '&', '&', $string ); - /* - Home - index.php - */ - if ($string=='index.php') { - $string=''; + // Home index.php + if ($string == 'index.php') { + $string = ''; } - - $sefstring = ''; - if ( (eregi('option=com_content',$string) || eregi('option=content',$string) ) && !eregi('task=new',$string) && !eregi('task=edit',$string) ) { - /* - Content - index.php?option=com_content&task=$task§ionid=$sectionid&id=$id&Itemid=$Itemid&limit=$limit&limitstart=$limitstart&year=$year&month=$month&module=$module - */ - $sefstring .= 'content/'; - if (eregi('&task=',$string)) { - $temp = split('&task=', $string); - $temp = split('&', $temp[1]); - - $sefstring .= $temp[0].'/'; - } - if (eregi('§ionid=',$string)) { - $temp = split('§ionid=', $string); - $temp = split('&', $temp[1]); - - $sefstring .= $temp[0].'/'; - } - if (eregi('&id=',$string)) { - $temp = split('&id=', $string); - $temp = split('&', $temp[1]); - - $sefstring .= $temp[0].'/'; + + // break link into url component parts + $url = parse_url( $string ); + + // check if link contained fragment identifiers (ex. #foo) + $fragment = ''; + if ( isset($url['fragment']) ) { + // ensure fragment identifiers are compatible with HTML4 + if (preg_match('@^[A-Za-z][A-Za-z0-9:_.-]*$@', $url['fragment'])) { + $fragment = '#'. $url['fragment']; } - if (eregi('&Itemid=',$string)) { - $temp = split('&Itemid=', $string); - $temp = split('&', $temp[1]); + } - if ( $temp[0] != 99999999 ) { - $sefstring .= $temp[0].'/'; + // check if link contained a query component + if ( isset($url['query']) ) { + // special handling for javascript + $url['query'] = stripslashes( str_replace( '+', '%2b', $url['query'] ) ); + // clean possible xss attacks + $url['query'] = preg_replace( "'%3Cscript[^%3E]*%3E.*?%3C/script%3E'si", '', $url['query'] ); + + // break url into component parts + parse_str( $url['query'], $parts ); + + // special handling for javascript + foreach( $parts as $key => $value) { + if ( strpos( $value, '+' ) !== false ) { + $parts[$key] = stripslashes( str_replace( '%2b', '+', $value ) ); } } - if (eregi('&limit=',$string)) { - $temp = split('&limit=', $string); - $temp = split('&', $temp[1]); + //var_dump($parts); + $sefstring = ''; - $sefstring .= $temp[0].'/'; - } - if (eregi('&limitstart=',$string)) { - $temp = split('&limitstart=', $string); - $temp = split('&', $temp[1]); - - $sefstring .= $temp[0].'/'; - } - if (eregi('&lang=',$string)) { - $temp = split('&lang=', $string); - $temp = split('&', $temp[1]); - - $sefstring .= 'lang,'.$temp[0].'/'; - } - if (eregi('&year=',$string)) { - $temp = split('&year=', $string); - $temp = split('&', $temp[1]); + // Component com_content urls + if ( ( $parts['option'] == 'com_content' || $parts['option'] == 'content' ) && ( $parts['task'] != 'new' ) && ( $parts['task'] != 'edit' ) ) { + // index.php?option=com_content [&task=$task] [§ionid=$sectionid] [&id=$id] [&Itemid=$Itemid] [&limit=$limit] [&limitstart=$limitstart] [&year=$year] [&month=$month] [&module=$module] + $sefstring .= 'content/'; - $sefstring .= $temp[0].'/'; - } - if (eregi('&month=',$string)) { - $temp = split('&month=', $string); - $temp = split('&', $temp[1]); + // task + if ( isset( $parts['task'] ) ) { + $sefstring .= $parts['task'].'/'; + } + // sectionid + if ( isset( $parts['sectionid'] ) ) { + $sefstring .= $parts['sectionid'].'/'; + } + // id + if ( isset( $parts['id'] ) ) { + $sefstring .= $parts['id'].'/'; + } + // Itemid + if ( isset( $parts['Itemid'] ) ) { + //only add Itemid value if it does not correspond with the 'unassigned' Itemid value + if ( $parts['Itemid'] != 99999999 && $parts['Itemid'] != 0 ) { + $sefstring .= $parts['Itemid'].'/'; + } + } + // order + if ( isset( $parts['order'] ) ) { + $sefstring .= 'order,'. $parts['order'].'/'; + } + // filter + if ( isset( $parts['filter'] ) ) { + $sefstring .= 'filter,'. $parts['filter'].'/'; + } + // limit + if ( isset( $parts['limit'] ) ) { + $sefstring .= $parts['limit'].'/'; + } + // limitstart + if ( isset( $parts['limitstart'] ) ) { + $sefstring .= $parts['limitstart'].'/'; + } + // year + if ( isset( $parts['year'] ) ) { + $sefstring .= $parts['year'].'/'; + } + // month + if ( isset( $parts['month'] ) ) { + $sefstring .= $parts['month'].'/'; + } + // module + if ( isset( $parts['module'] ) ) { + $sefstring .= $parts['module'].'/'; + } + // lang + if ( isset( $parts['lang'] ) ) { + $sefstring .= 'lang,'. $parts['lang'].'/'; + } + + $string = $sefstring; - $sefstring .= $temp[0].'/'; - } - if (eregi('&module=',$string)) { - $temp = split('&module=', $string); - $temp = split('&', $temp[1]); + // all other components + } else if ( ( strpos( $parts['option'], 'com_' ) !== false ) && ( @$parts['task'] != 'new' ) && ( @$parts['task'] != 'edit' ) ) { + // index.php?option=com_xxxx &... + $sefstring = 'component/'; - $sefstring .= $temp[0].'/'; - } - // Handle fragment identifiers (ex. #foo) - if (eregi('#', $string)) { - $temp = split('#', $string, 2); - $string = $temp[0]; - // ensure fragment identifiers are compatible with HTML4 - if (preg_match('@^[A-Za-z][A-Za-z0-9:_.-]*$@', $temp[1])) { - $fragment = '#'. $temp[1]; - $sefstring .= $fragment .'/'; + foreach($parts as $key => $value) { + // remove slashes automatically added by parse_str + $value = stripslashes($value); + $sefstring .= $key .','. $value.'/'; } + + $string = str_replace( '=', ',', $sefstring ); } - - $string = $sefstring; - } else if (eregi('option=com_',$string) && !eregi('task=new',$string) && !eregi('task=edit',$string)) { - /* - Components - index.php?option=com_xxxx&... - */ - $sefstring = 'component/'; - $temp = split("\?", $string); - $temp = split('&', $temp[1]); - - foreach($temp as $key => $value) { - $sefstring .= $value.'/'; - } - $string = str_replace( '=', ',', $sefstring ); } // comment line below if you dont have mod_rewrite - return $mosConfig_live_site.'/'.$string; + return $mosConfig_live_site .'/'. $string . $fragment; // allows SEF without mod_rewrite - // uncomment Line 348 and comment out Line 354 + // uncomment Line 508 and comment out Line 510 - // comment out line below if you dont have mod_rewrite - //return $mosConfig_live_site.'/index.php/'.$string; + // uncomment line below if you dont have mod_rewrite + // return $mosConfig_live_site .'/index.php/'. $string . $fragment; + // If the above doesnt work - try uncommenting this line instead + // return $mosConfig_live_site .'/index.php?/'. $string . $fragment; } else { + // Handling for when SEF is not activated + // Relative link handling + if ( (strpos( $string, $mosConfig_live_site ) !== 0) ) { + // if URI starts with a "/", means URL is at the root of the host... + if (strncmp($string, '/', 1) == 0) { + // splits http(s)://xx.xx/yy/zz..." into [1]="http(s)://xx.xx" and [2]="/yy/zz...": + $live_site_parts = array(); + eregi("^(https?:[\/]+[^\/]+)(.*$)", $mosConfig_live_site, $live_site_parts); + + $string = $live_site_parts[1] . $string; + } else { + $check = 1; + + // array list of non http/https URL schemes + $url_schemes = explode( ', ', _URL_SCHEMES ); + $url_schemes[] = 'http:'; + $url_schemes[] = 'https:'; + + foreach ( $url_schemes as $url ) { + if ( strpos( $string, $url ) === 0 ) { + $check = 0; + } + } + + if ( $check ) { + $string = $mosConfig_live_site .'/'. $string; + } + } + } + return $string; } } diff -urN joomla-1.0.7/includes/version.php joomla-1.0.10/includes/version.php --- joomla-1.0.7/includes/version.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/includes/version.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ Joomla! is Free Software released under the GNU/GPL License.'; + /** @var string Whether site is a production = 1 or demo site = 0: 1 is default */ + var $SITE = 1; + /** @var string Whether site has restricted functionality mostly used for demo sites: 0 is default */ + var $RESTRICT = 0; + /** @var string Whether site is still in development phase (disables checks for /installation folder) - should be set to 0 for package release: 0 is default */ + var $SVN = 0; + /** * @return string Long format version */ diff -urN joomla-1.0.7/index.php joomla-1.0.10/index.php --- joomla-1.0.7/index.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/index.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ SVN == 0) { define( '_INSTALL_CHECK', 1 ); - include ('offline.php'); + include ( $mosConfig_absolute_path .'/offline.php'); exit(); } - // displays offline/maintanance page or bar if ($mosConfig_offline == 1) { - require( 'offline.php' ); + require( $mosConfig_absolute_path .'/offline.php' ); } // load system bot group @@ -44,15 +43,15 @@ // trigger the onStart events $_MAMBOTS->trigger( 'onStart' ); -if (file_exists( 'components/com_sef/sef.php' )) { - require_once( 'components/com_sef/sef.php' ); +if (file_exists( $mosConfig_absolute_path .'/components/com_sef/sef.php' )) { + require_once( $mosConfig_absolute_path .'/components/com_sef/sef.php' ); } else { - require_once( 'includes/sef.php' ); + require_once( $mosConfig_absolute_path .'/includes/sef.php' ); } -require_once( 'includes/frontend.php' ); +require_once( $mosConfig_absolute_path .'/includes/frontend.php' ); // retrieve some expected url (or form) arguments -$option = trim( strtolower( mosGetParam( $_REQUEST, 'option' ) ) ); +$option = strval( strtolower( mosGetParam( $_REQUEST, 'option' ) ) ); $Itemid = intval( mosGetParam( $_REQUEST, 'Itemid', null ) ); if ($option == '') { @@ -105,7 +104,7 @@ // checking if we can find the Itemid thru the content if ( $option == 'com_content' && $Itemid === 0 ) { - $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); + $id = intval( mosGetParam( $_REQUEST, 'id', 0 ) ); $Itemid = $mainframe->getItemid( $id ); } @@ -132,11 +131,11 @@ if ($mosConfig_lang=='') { $mosConfig_lang = 'english'; } -include_once( 'language/' . $mosConfig_lang . '.php' ); +include_once( $mosConfig_absolute_path .'/language/' . $mosConfig_lang . '.php' ); // frontend login & logout controls -$return = mosGetParam( $_REQUEST, 'return', NULL ); -$message = mosGetParam( $_POST, 'message', 0 ); +$return = strval( mosGetParam( $_REQUEST, 'return', NULL ) ); +$message = intval( mosGetParam( $_POST, 'message', 0 ) ); if ($option == 'login') { $mainframe->login(); @@ -204,19 +203,23 @@ require_once( $mosConfig_absolute_path . '/editor/editor.php' ); ob_start(); + if ($path = $mainframe->getPath( 'front' )) { - $task = mosGetParam( $_REQUEST, 'task', '' ); + $task = strval( mosGetParam( $_REQUEST, 'task', '' ) ); $ret = mosMenuCheck( $Itemid, $option, $task, $gid ); + if ($ret) { require_once( $path ); } else { mosNotAuth(); } } else { - header("HTTP/1.0 404 Not Found"); + header( 'HTTP/1.0 404 Not Found' ); echo _NOT_EXIST; } + $_MOS_OPTION['buffer'] = ob_get_contents(); + ob_end_clean(); initGzip(); @@ -229,15 +232,15 @@ // display the offline alert if an admin is logged in if (defined( '_ADMIN_OFFLINE' )) { - include( 'offlinebar.php' ); + include( $mosConfig_absolute_path .'/offlinebar.php' ); } // loads template file -if ( !file_exists( 'templates/'. $cur_template .'/index.php' ) ) { +if ( !file_exists( $mosConfig_absolute_path .'/templates/'. $cur_template .'/index.php' ) ) { echo _TEMPLATE_WARN . $cur_template; } else { - require_once( 'templates/'. $cur_template .'/index.php' ); - echo ""; + require_once( $mosConfig_absolute_path .'/templates/'. $cur_template .'/index.php' ); + echo ''; } // displays queries performed for page @@ -247,6 +250,7 @@ foreach ($database->_log as $k=>$sql) { echo $k+1 . "\n" . $sql . '
    '; } + echo ''; } doGzip(); diff -urN joomla-1.0.7/index2.php joomla-1.0.10/index2.php --- joomla-1.0.7/index2.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/index2.php 2006-06-25 16:54:18.000000000 -0400 @@ -1,6 +1,6 @@ trigger( 'onStart' ); -if (file_exists( 'components/com_sef/sef.php' )) { - require_once( 'components/com_sef/sef.php' ); +if (file_exists( $mosConfig_absolute_path .'/components/com_sef/sef.php' )) { + require_once( $mosConfig_absolute_path .'/components/com_sef/sef.php' ); } else { - require_once( 'includes/sef.php' ); + require_once( $mosConfig_absolute_path .'/includes/sef.php' ); } -require_once( 'includes/frontend.php' ); +require_once( $mosConfig_absolute_path .'/includes/frontend.php' ); // retrieve some expected url (or form) arguments -$option = strtolower( mosGetParam( $_REQUEST, 'option' ) ); +$option = strtolower( strval( mosGetParam( $_REQUEST, 'option' ) ) ); $Itemid = intval( mosGetParam( $_REQUEST, 'Itemid', 0 ) ); $no_html = intval( mosGetParam( $_REQUEST, 'no_html', 0 ) ); -$act = mosGetParam( $_REQUEST, 'act', '' ); +$act = strval( mosGetParam( $_REQUEST, 'act', '' ) ); $do_pdf = intval( mosGetParam( $_REQUEST, 'do_pdf', 0 ) ); // mainframe is an API workhorse, lots of 'core' interaction routines @@ -61,7 +61,7 @@ if ($mosConfig_lang=='') { $mosConfig_lang = 'english'; } -include_once( 'language/' . $mosConfig_lang . '.php' ); +include_once( $mosConfig_absolute_path .'/language/' . $mosConfig_lang . '.php' ); if ($option == 'login') { @@ -73,7 +73,7 @@ } if ( $do_pdf == 1 ){ - include ('includes/pdf.php'); + include $mosConfig_absolute_path .'/includes/pdf.php'; exit(); } @@ -89,8 +89,9 @@ require_once( $mosConfig_absolute_path . '/editor/editor.php' ); ob_start(); + if ($path = $mainframe->getPath( 'front' )) { - $task = mosGetParam( $_REQUEST, 'task', '' ); + $task = strval( mosGetParam( $_REQUEST, 'task', '' ) ); $ret = mosMenuCheck( $Itemid, $option, $task, $gid ); if ($ret) { require_once( $path ); @@ -102,6 +103,7 @@ echo _NOT_EXIST; } $_MOS_OPTION['buffer'] = ob_get_contents(); + ob_end_clean(); initGzip(); @@ -114,7 +116,7 @@ // display the offline alert if an admin is logged in if (defined( '_ADMIN_OFFLINE' )) { - include( 'offlinebar.php' ); + include( $mosConfig_absolute_path .'/offlinebar.php' ); } // start basic HTML @@ -128,23 +130,23 @@ // xml prolog echo ''; ?> - - - - getHead(); ?> - - - - - id || $mainframe->get( 'joomlaJavascript' )) { ?> - - - - - - - - + + + getHead(); ?> + + + + + id || $mainframe->get( 'joomlaJavascript' )) { ?> + + + + + + + + Template File Not Found! Looking for template:'); -DEFINE('_NO_PARAMS','There are no Parameters for this item'); -DEFINE('_HANDLER','Handler not defined for type'); - -/** mambots */ -DEFINE('_TOC_JUMPTO','Article Index'); - -/** content */ -DEFINE('_READ_MORE','Read more...'); -DEFINE('_READ_MORE_REGISTER','Register to read more...'); -DEFINE('_MORE','More...'); -DEFINE('_ON_NEW_CONTENT', "A new content item has been submitted by [ %s ] titled [ %s ] from section [ %s ] and category [ %s ]" ); -DEFINE('_SEL_CATEGORY','- Select Category -'); -DEFINE('_SEL_SECTION','- Select Section -'); -DEFINE('_SEL_AUTHOR','- Select Author -'); -DEFINE('_SEL_POSITION','- Select Position -'); -DEFINE('_SEL_TYPE','- Select Type -'); -DEFINE('_EMPTY_CATEGORY','This Category is currently empty'); -DEFINE('_EMPTY_BLOG','There are no items to display'); -DEFINE('_NOT_EXIST','The page you are trying to access does not exist.
    Please select a page from the main menu.'); - -/** classes/html/modules.php */ -DEFINE('_BUTTON_VOTE','Vote'); -DEFINE('_BUTTON_RESULTS','Results'); -DEFINE('_USERNAME','Username'); -DEFINE('_LOST_PASSWORD','Lost Password?'); -DEFINE('_PASSWORD','Password'); -DEFINE('_BUTTON_LOGIN','Login'); -DEFINE('_BUTTON_LOGOUT','Logout'); -DEFINE('_NO_ACCOUNT','No account yet?'); -DEFINE('_CREATE_ACCOUNT','Register'); -DEFINE('_VOTE_POOR','Poor'); -DEFINE('_VOTE_BEST','Best'); -DEFINE('_USER_RATING','User Rating'); -DEFINE('_RATE_BUTTON','Rate'); -DEFINE('_REMEMBER_ME','Remember me'); - -/** contact.php */ -DEFINE('_ENQUIRY','Enquiry'); -DEFINE('_ENQUIRY_TEXT','This is an enquiry e-mail via %s from:'); -DEFINE('_COPY_TEXT','This is a copy of the following message you sent to %s via %s '); -DEFINE('_COPY_SUBJECT','Copy of: '); -DEFINE('_THANK_MESSAGE','Thank you for your e-mail'); -DEFINE('_CLOAKING','This email address is being protected from spam bots, you need Javascript enabled to view it'); -DEFINE('_CONTACT_HEADER_NAME','Name'); -DEFINE('_CONTACT_HEADER_POS','Position'); -DEFINE('_CONTACT_HEADER_EMAIL','Email'); -DEFINE('_CONTACT_HEADER_PHONE','Phone'); -DEFINE('_CONTACT_HEADER_FAX','Fax'); -DEFINE('_CONTACTS_DESC','The Contact list for this Website.'); - -/** classes/html/contact.php */ -DEFINE('_CONTACT_TITLE','Contact'); -DEFINE('_EMAIL_DESCRIPTION','Send an Email to this Contact:'); -DEFINE('_NAME_PROMPT',' Enter your name:'); -DEFINE('_EMAIL_PROMPT',' E-mail address:'); -DEFINE('_MESSAGE_PROMPT',' Enter your message:'); -DEFINE('_SEND_BUTTON','Send'); -DEFINE('_CONTACT_FORM_NC','Please make sure the form is complete and valid.'); -DEFINE('_CONTACT_TELEPHONE','Telephone: '); -DEFINE('_CONTACT_MOBILE','Mobile: '); -DEFINE('_CONTACT_FAX','Fax: '); -DEFINE('_CONTACT_EMAIL','Email: '); -DEFINE('_CONTACT_NAME','Name: '); -DEFINE('_CONTACT_POSITION','Postition: '); -DEFINE('_CONTACT_ADDRESS','Address: '); -DEFINE('_CONTACT_MISC','Information: '); -DEFINE('_CONTACT_SEL','Select Contact:'); -DEFINE('_CONTACT_NONE','There are no Contact Details listed.'); -DEFINE('_EMAIL_A_COPY','Email a copy of this message to your own address'); -DEFINE('_CONTACT_DOWNLOAD_AS','Download information as a'); -DEFINE('_VCARD','VCard'); - -/** pageNavigation */ -DEFINE('_PN_LT','<'); -DEFINE('_PN_RT','>'); -DEFINE('_PN_PAGE','Page'); -DEFINE('_PN_OF','of'); -DEFINE('_PN_START','Start'); -DEFINE('_PN_PREVIOUS','Prev'); -DEFINE('_PN_NEXT','Next'); -DEFINE('_PN_END','End'); -DEFINE('_PN_DISPLAY_NR','Display #'); -DEFINE('_PN_RESULTS','Results'); - -/** emailfriend */ -DEFINE('_EMAIL_TITLE','E-mail a friend'); -DEFINE('_EMAIL_FRIEND','E-mail this to a friend.'); -DEFINE('_EMAIL_FRIEND_ADDR',"Your friend's E-mail:"); -DEFINE('_EMAIL_YOUR_NAME','Your Name:'); -DEFINE('_EMAIL_YOUR_MAIL','Your E-mail:'); -DEFINE('_SUBJECT_PROMPT',' Message subject:'); -DEFINE('_BUTTON_SUBMIT_MAIL','Send e-mail'); -DEFINE('_BUTTON_CANCEL','Cancel'); -DEFINE('_EMAIL_ERR_NOINFO','You must enter your valid e-mail and the valid e-mail to send to.'); -DEFINE('_EMAIL_MSG',' The following page from the "%s" website has been sent to you by %s ( %s ). - -You can access it at the following url: -%s'); -DEFINE('_EMAIL_INFO','Item sent by'); -DEFINE('_EMAIL_SENT','This item has been sent to'); -DEFINE('_PROMPT_CLOSE','Close Window'); - -/** classes/html/content.php */ -DEFINE('_AUTHOR_BY', ' Contributed by'); -DEFINE('_WRITTEN_BY', ' Written by'); -DEFINE('_LAST_UPDATED', 'Last Updated'); -DEFINE('_BACK','[ Back ]'); -DEFINE('_LEGEND','Legend'); -DEFINE('_DATE','Date'); -DEFINE('_ORDER_DROPDOWN','Order'); -DEFINE('_HEADER_TITLE','Item Title'); -DEFINE('_HEADER_AUTHOR','Author'); -DEFINE('_HEADER_SUBMITTED','Submitted'); -DEFINE('_HEADER_HITS','Hits'); -DEFINE('_E_EDIT','Edit'); -DEFINE('_E_ADD','Add'); -DEFINE('_E_WARNUSER','Please either Cancel or Save the current change'); -DEFINE('_E_WARNTITLE','Content item must have a title'); -DEFINE('_E_WARNTEXT','Content item must have intro text'); -DEFINE('_E_WARNCAT','Please select a category'); -DEFINE('_E_CONTENT','Content'); -DEFINE('_E_TITLE','Title:'); -DEFINE('_E_CATEGORY','Category:'); -DEFINE('_E_INTRO','Intro Text'); -DEFINE('_E_MAIN','Main Text'); -DEFINE('_E_MOSIMAGE','INSERT {mosimage}'); -DEFINE('_E_IMAGES','Images'); -DEFINE('_E_GALLERY_IMAGES','Gallery Images'); -DEFINE('_E_CONTENT_IMAGES','Content Images'); -DEFINE('_E_EDIT_IMAGE','Edit Image'); -DEFINE('_E_INSERT','Insert'); -DEFINE('_E_UP','Up'); -DEFINE('_E_DOWN','Down'); -DEFINE('_E_REMOVE','Remove'); -DEFINE('_E_SOURCE','Source:'); -DEFINE('_E_ALIGN','Align:'); -DEFINE('_E_ALT','Alt Text:'); -DEFINE('_E_BORDER','Border:'); -DEFINE('_E_CAPTION','Caption'); -DEFINE('_E_APPLY','Apply'); -DEFINE('_E_PUBLISHING','Publishing'); -DEFINE('_E_STATE','State:'); -DEFINE('_E_AUTHOR_ALIAS','Author Alias:'); -DEFINE('_E_ACCESS_LEVEL','Access Level:'); -DEFINE('_E_ORDERING','Ordering:'); -DEFINE('_E_START_PUB','Start Publishing:'); -DEFINE('_E_FINISH_PUB','Finish Publishing:'); -DEFINE('_E_SHOW_FP','Show on Front Page:'); -DEFINE('_E_HIDE_TITLE','Hide Item Title:'); -DEFINE('_E_METADATA','Metadata'); -DEFINE('_E_M_DESC','Description:'); -DEFINE('_E_M_KEY','Keywords:'); -DEFINE('_E_SUBJECT','Subject:'); -DEFINE('_E_EXPIRES','Expiry Date:'); -DEFINE('_E_VERSION','Version:'); -DEFINE('_E_ABOUT','About'); -DEFINE('_E_CREATED','Created:'); -DEFINE('_E_LAST_MOD','Last Modified:'); -DEFINE('_E_HITS','Hits:'); -DEFINE('_E_SAVE','Save'); -DEFINE('_E_CANCEL','Cancel'); -DEFINE('_E_REGISTERED','Registered Users Only'); -DEFINE('_E_ITEM_INFO','Item Information'); -DEFINE('_E_ITEM_SAVED','Item succesfully saved.'); -DEFINE('_ITEM_PREVIOUS','< Prev'); -DEFINE('_ITEM_NEXT','Next >'); - - -/** content.php */ -DEFINE('_SECTION_ARCHIVE_EMPTY','There are currently no Archived Entries for this Section, please come back later'); -DEFINE('_CATEGORY_ARCHIVE_EMPTY','There are currently no Archived Entries for this Category, please come back later'); -DEFINE('_HEADER_SECTION_ARCHIVE','Section Archives'); -DEFINE('_HEADER_CATEGORY_ARCHIVE','Category Archives'); -DEFINE('_ARCHIVE_SEARCH_FAILURE','There are no Archived entries for %s %s'); // values are month then year -DEFINE('_ARCHIVE_SEARCH_SUCCESS','Here are the Archived entries for %s %s'); // values are month then year -DEFINE('_FILTER','Filter'); -DEFINE('_ORDER_DROPDOWN_DA','Date asc'); -DEFINE('_ORDER_DROPDOWN_DD','Date desc'); -DEFINE('_ORDER_DROPDOWN_TA','Title asc'); -DEFINE('_ORDER_DROPDOWN_TD','Title desc'); -DEFINE('_ORDER_DROPDOWN_HA','Hits asc'); -DEFINE('_ORDER_DROPDOWN_HD','Hits desc'); -DEFINE('_ORDER_DROPDOWN_AUA','Author asc'); -DEFINE('_ORDER_DROPDOWN_AUD','Author desc'); -DEFINE('_ORDER_DROPDOWN_O','Ordering'); - -/** poll.php */ -DEFINE('_ALERT_ENABLED','Cookies must be enabled!'); -DEFINE('_ALREADY_VOTE','You already voted for this poll today!'); -DEFINE('_NO_SELECTION','No selection has been made, please try again'); -DEFINE('_THANKS','Thanks for your vote!'); -DEFINE('_SELECT_POLL','Select Poll from the list'); - -/** classes/html/poll.php */ -DEFINE('_JAN','January'); -DEFINE('_FEB','February'); -DEFINE('_MAR','March'); -DEFINE('_APR','April'); -DEFINE('_MAY','May'); -DEFINE('_JUN','June'); -DEFINE('_JUL','July'); -DEFINE('_AUG','August'); -DEFINE('_SEP','September'); -DEFINE('_OCT','October'); -DEFINE('_NOV','November'); -DEFINE('_DEC','December'); -DEFINE('_POLL_TITLE','Poll - Results'); -DEFINE('_SURVEY_TITLE','Poll Title:'); -DEFINE('_NUM_VOTERS','Number of Voters'); -DEFINE('_FIRST_VOTE','First Vote'); -DEFINE('_LAST_VOTE','Last Vote'); -DEFINE('_SEL_POLL','Select Poll:'); -DEFINE('_NO_RESULTS','There are no results for this poll.'); - -/** registration.php */ -DEFINE('_ERROR_PASS','Sorry, no corresponding user was found'); -DEFINE('_NEWPASS_MSG','The user account $checkusername has this email associated with it.\n' -.'A web user from $mosConfig_live_site has just requested that a new password be sent.\n\n' -.' Your New Password is: $newpass\n\nIf you didn\'t ask for this, don\'t worry.' -.' You are seeing this message, not them. If this was an error just login with your' -.' new password and then change your password to what you would like it to be.'); -DEFINE('_NEWPASS_SUB','$_sitename :: New password for - $checkusername'); -DEFINE('_NEWPASS_SENT','New User Password created and sent!'); -DEFINE('_REGWARN_NAME','Please enter your name.'); -DEFINE('_REGWARN_UNAME','Please enter a user name.'); -DEFINE('_REGWARN_MAIL','Please enter a valid e-mail address.'); -DEFINE('_REGWARN_PASS','Please enter a valid password. No spaces, more than 6 characters and contain 0-9,a-z,A-Z'); -DEFINE('_REGWARN_VPASS1','Please verify the password.'); -DEFINE('_REGWARN_VPASS2','Password and verification do not match, please try again.'); -DEFINE('_REGWARN_INUSE','This username/password already in use. Please try another.'); -DEFINE('_REGWARN_EMAIL_INUSE', 'This e-mail is already registered. If you forgot the password click on "Lost your Password" and new password will be sent to you.'); -DEFINE('_SEND_SUB','Account details for %s at %s'); -DEFINE('_USEND_MSG_ACTIVATE', 'Hello %s, - -Thank you for registering at %s. Your account is created and must be activated before you can use it. -To activate the account click on the following link or copy-paste it in your browser: -%s - -After activation you may login to %s using the following username and password: - -Username - %s -Password - %s'); -DEFINE('_USEND_MSG', "Hello %s, - -Thank you for registering at %s. - -You may now login to %s using the username and password you registered with."); -DEFINE('_USEND_MSG_NOPASS','Hello $name,\n\nYou have been added as a user to $mosConfig_live_site.\n' -.'You may login to $mosConfig_live_site with the username and password you registered with.\n\n' -.'Please do not respond to this message as it is automatically generated and is for information purposes only\n'); -DEFINE('_ASEND_MSG','Hello %s, - -A new user has registered at %s. -This email contains their details: - -Name - %s -e-mail - %s -Username - %s - -Please do not respond to this message as it is automatically generated and is for information purposes only'); -DEFINE('_REG_COMPLETE_NOPASS','
    Registration Complete!

      ' -.'You may now login.
      '); -DEFINE('_REG_COMPLETE', '
    Registration Complete!

    You may now login.'); -DEFINE('_REG_COMPLETE_ACTIVATE', '
    Registration Complete!

    Your account has been created and activation link has been sent to the e-mail address you entered. Note that you must activate the account by clicking on the activation link when you get the e-mail before you can login.'); -DEFINE('_REG_ACTIVATE_COMPLETE', '
    Activation Complete!

    Your account has been successfully activated. You can now login using the username and password you choose during the registration.'); -DEFINE('_REG_ACTIVATE_NOT_FOUND', '
    Invalid Activation Link!

    There is no such account in our database or the account has already been activated.'); - -/** classes/html/registration.php */ -DEFINE('_PROMPT_PASSWORD','Lost your Password?'); -DEFINE('_NEW_PASS_DESC','Please enter your Username and e-mail address then click on the Send Password button.
    ' -.'You will receive a new password shortly. Use this new password to access the site.'); -DEFINE('_PROMPT_UNAME','Username:'); -DEFINE('_PROMPT_EMAIL','E-mail Address:'); -DEFINE('_BUTTON_SEND_PASS','Send Password'); -DEFINE('_REGISTER_TITLE','Registration'); -DEFINE('_REGISTER_NAME','Name:'); -DEFINE('_REGISTER_UNAME','Username:'); -DEFINE('_REGISTER_EMAIL','E-mail:'); -DEFINE('_REGISTER_PASS','Password:'); -DEFINE('_REGISTER_VPASS','Verify Password:'); -DEFINE('_REGISTER_REQUIRED','Fields marked with an asterisk (*) are required.'); -DEFINE('_BUTTON_SEND_REG','Send Registration'); -DEFINE('_SENDING_PASSWORD','Your password will be sent to the above e-mail address.
    Once you have received your' -.' new password you can login in and change it.'); - -/** classes/html/search.php */ -DEFINE('_SEARCH_TITLE','Search'); -DEFINE('_PROMPT_KEYWORD','Search Keyword'); -DEFINE('_SEARCH_MATCHES','returned %d matches'); -DEFINE('_CONCLUSION','Total $totalRows results found. Search for $searchword with'); -DEFINE('_NOKEYWORD','No results were found'); -DEFINE('_IGNOREKEYWORD','One or more common words were ignored in the search'); -DEFINE('_SEARCH_ANYWORDS','Any words'); -DEFINE('_SEARCH_ALLWORDS','All words'); -DEFINE('_SEARCH_PHRASE','Exact phrase'); -DEFINE('_SEARCH_NEWEST','Newest first'); -DEFINE('_SEARCH_OLDEST','Oldest first'); -DEFINE('_SEARCH_POPULAR','Most popular'); -DEFINE('_SEARCH_ALPHABETICAL','Alphabetical'); -DEFINE('_SEARCH_CATEGORY','Section/Category'); -DEFINE('_SEARCH_MESSAGE','Search term must be a minimum of 3 characters and a maximum of 20 characters'); -DEFINE('_SEARCH_ARCHIVED','Archived'); -DEFINE('_SEARCH_CATBLOG','Category Blog'); -DEFINE('_SEARCH_CATLIST','Category List'); -DEFINE('_SEARCH_NEWSFEEDS','Newsfeeds'); -DEFINE('_SEARCH_SECLIST','Section List'); -DEFINE('_SEARCH_SECBLOG','Section Blog'); - - -/** templates/*.php */ -DEFINE('_ISO','charset=iso-8859-1'); -DEFINE('_DATE_FORMAT','l, F d Y'); //Uses PHP's DATE Command Format - Depreciated -/** -* Modify this line to reflect how you want the date to appear in your site -* -*e.g. DEFINE("_DATE_FORMAT_LC","%A, %d %B %Y %H:%M"); //Uses PHP's strftime Command Format -*/ -DEFINE('_DATE_FORMAT_LC',"%A, %d %B %Y"); //Uses PHP's strftime Command Format -DEFINE('_DATE_FORMAT_LC2',"%A, %d %B %Y %H:%M"); -DEFINE('_SEARCH_BOX','search...'); -DEFINE('_NEWSFLASH_BOX','Newsflash!'); -DEFINE('_MAINMENU_BOX','Main Menu'); - -/** classes/html/usermenu.php */ -DEFINE('_UMENU_TITLE','User Menu'); -DEFINE('_HI','Hi, '); - -/** user.php */ -DEFINE('_SAVE_ERR','Please complete all the fields.'); -DEFINE('_THANK_SUB','Thanks for your submission. Your submission will now be reviewed before being posted to the site.'); -DEFINE('_UP_SIZE','You cannot upload files greater than 15kb in size.'); -DEFINE('_UP_EXISTS','Image $userfile_name already exists. Please rename the file and try again.'); -DEFINE('_UP_COPY_FAIL','Failed to copy'); -DEFINE('_UP_TYPE_WARN','You may only upload a gif, or jpg image.'); -DEFINE('_MAIL_SUB','User Submitted'); -DEFINE('_MAIL_MSG','Hello $adminName,\n\n\nA user submitted $type:\n [ $title ]\n has been just been submitted by user:\n [ $author ]\n' -.' for $mosConfig_live_site.\n\n\n\n' -.'Please go to $mosConfig_live_site/administrator to view and approve this $type.\n\n' -.'Please do not respond to this message as it is automatically generated and is for information purposes only\n'); -DEFINE('_PASS_VERR1','If changing your password please enter the password again to verify.'); -DEFINE('_PASS_VERR2','If changing your password please make sure the password and verification match.'); -DEFINE('_UNAME_INUSE','This username already in use.'); -DEFINE('_UPDATE','Update'); -DEFINE('_USER_DETAILS_SAVE','Your settings have been saved.'); -DEFINE('_USER_LOGIN','User Login'); - -/** components/com_user */ -DEFINE('_EDIT_TITLE','Edit Your Details'); -DEFINE('_YOUR_NAME','Your Name:'); -DEFINE('_EMAIL','e-mail:'); -DEFINE('_UNAME','User Name:'); -DEFINE('_PASS','Password:'); -DEFINE('_VPASS','Verify Password:'); -DEFINE('_SUBMIT_SUCCESS','Submission Success!'); -DEFINE('_SUBMIT_SUCCESS_DESC','Your item has been successfully submitted to our administrators. It will be reviewed before being published on this site.'); -DEFINE('_WELCOME','Welcome!'); -DEFINE('_WELCOME_DESC','Welcome to the user section of our site'); -DEFINE('_CONF_CHECKED_IN','Checked out items have now been all checked in'); -DEFINE('_CHECK_TABLE','Checking table'); -DEFINE('_CHECKED_IN','Checked in '); -DEFINE('_CHECKED_IN_ITEMS',' items'); -DEFINE('_PASS_MATCH','Passwords do not match'); - -/** components/com_banners */ -DEFINE('_BNR_CLIENT_NAME','You must select a name for the client.'); -DEFINE('_BNR_CONTACT','You must select a contact for the client.'); -DEFINE('_BNR_VALID_EMAIL','You must select a valid email for the client.'); -DEFINE('_BNR_CLIENT','You must select a client,'); -DEFINE('_BNR_NAME','You must select a name for the banner.'); -DEFINE('_BNR_IMAGE','You must select a image for the banner.'); -DEFINE('_BNR_URL','You must select a URL/Custom banner code for the banner.'); - -/** components/com_login */ -DEFINE('_ALREADY_LOGIN','You are already logged in!'); -DEFINE('_LOGOUT','Click here to logout'); -DEFINE('_LOGIN_TEXT','Use the login and password fields opposite to gain full access'); -DEFINE('_LOGIN_SUCCESS','You have succesfully Logged In'); -DEFINE('_LOGOUT_SUCCESS','You have successfully Logged Out'); -DEFINE('_LOGIN_DESCRIPTION','To access the Private area of this site please Login'); -DEFINE('_LOGOUT_DESCRIPTION','You are currently Logged in to the private area of this site'); - - -/** components/com_weblinks */ -DEFINE('_WEBLINKS_TITLE','Web Links'); -DEFINE('_WEBLINKS_DESC','We are regularly out on the web. When we find a great site we list' -.' it here for you to enjoy.
    From the list below choose one of our weblink topics, then select a URL to visit.'); -DEFINE('_HEADER_TITLE_WEBLINKS','Web Link'); -DEFINE('_SECTION','Section:'); -DEFINE('_SUBMIT_LINK','Submit A Web Link'); -DEFINE('_URL','URL:'); -DEFINE('_URL_DESC','Description:'); -DEFINE('_NAME','Name:'); -DEFINE('_WEBLINK_EXIST','There is a weblink already with that name, please try again.'); -DEFINE('_WEBLINK_TITLE','Your Weblink must contain a title.'); - -/** components/com_newfeeds */ -DEFINE('_FEED_NAME','Feed Name'); -DEFINE('_FEED_ARTICLES','# Articles'); -DEFINE('_FEED_LINK','Feed Link'); - -/** whos_online.php */ -DEFINE('_WE_HAVE', 'We have '); -DEFINE('_AND', ' and '); -DEFINE('_GUEST_COUNT','$guest_array guest'); -DEFINE('_GUESTS_COUNT','$guest_array guests'); -DEFINE('_MEMBER_COUNT','$user_array member'); -DEFINE('_MEMBERS_COUNT','$user_array members'); -DEFINE('_ONLINE',' online'); -DEFINE('_NONE','No Users Online'); - -/** modules/mod_stats.php */ -DEFINE('_TIME_STAT','Time'); -DEFINE('_MEMBERS_STAT','Members'); -DEFINE('_HITS_STAT','Hits'); -DEFINE('_NEWS_STAT','News'); -DEFINE('_LINKS_STAT','WebLinks'); -DEFINE('_VISITORS','Visitors'); - -/** /adminstrator/components/com_menus/admin.menus.html.php */ -DEFINE('_MAINMENU_HOME','* The 1st Published item in this menu [mainmenu] is the default `Homepage` for the site *'); -DEFINE('_MAINMENU_DEL','* You cannot `delete` this menu as it is required for the proper operation of Joomla! *'); -DEFINE('_MENU_GROUP','* Some `Menu Types` appear in more than one group *'); - - -/** administrators/components/com_users */ -DEFINE('_NEW_USER_MESSAGE_SUBJECT', 'New User Details' ); -DEFINE('_NEW_USER_MESSAGE', 'Hello %s, - - -You have been added as a user to %s by an Administrator. - -This email contains your username and password to log into the %s - -Username - %s -Password - %s - - -Please do not respond to this message as it is automatically generated and is for information purposes only'); - -/** administrators/components/com_massmail */ -DEFINE('_MASSMAIL_MESSAGE', "This is an email from '%s' - -Message: -" ); - - -/** includes/pdf.php */ -DEFINE('_PDF_GENERATED','Generated:'); -DEFINE('_PDF_POWERED','Powered by Joomla!'); +Template File Not Found! Looking for template:'); +DEFINE('_NO_PARAMS','There are no Parameters for this item'); +DEFINE('_HANDLER','Handler not defined for type'); + +/** mambots */ +DEFINE('_TOC_JUMPTO','Article Index'); + +/** content */ +DEFINE('_READ_MORE','Read more...'); +DEFINE('_READ_MORE_REGISTER','Register to read more...'); +DEFINE('_MORE','More...'); +DEFINE('_ON_NEW_CONTENT', "A new content item has been submitted by [ %s ] titled [ %s ] from section [ %s ] and category [ %s ]" ); +DEFINE('_SEL_CATEGORY','- Select Category -'); +DEFINE('_SEL_SECTION','- Select Section -'); +DEFINE('_SEL_AUTHOR','- Select Author -'); +DEFINE('_SEL_POSITION','- Select Position -'); +DEFINE('_SEL_TYPE','- Select Type -'); +DEFINE('_EMPTY_CATEGORY','This Category is currently empty'); +DEFINE('_EMPTY_BLOG','There are no items to display'); +DEFINE('_NOT_EXIST','The page you are trying to access does not exist.
    Please select a page from the main menu.'); + +/** classes/html/modules.php */ +DEFINE('_BUTTON_VOTE','Vote'); +DEFINE('_BUTTON_RESULTS','Results'); +DEFINE('_USERNAME','Username'); +DEFINE('_LOST_PASSWORD','Lost Password?'); +DEFINE('_PASSWORD','Password'); +DEFINE('_BUTTON_LOGIN','Login'); +DEFINE('_BUTTON_LOGOUT','Logout'); +DEFINE('_NO_ACCOUNT','No account yet?'); +DEFINE('_CREATE_ACCOUNT','Register'); +DEFINE('_VOTE_POOR','Poor'); +DEFINE('_VOTE_BEST','Best'); +DEFINE('_USER_RATING','User Rating'); +DEFINE('_RATE_BUTTON','Rate'); +DEFINE('_REMEMBER_ME','Remember me'); + +/** contact.php */ +DEFINE('_ENQUIRY','Enquiry'); +DEFINE('_ENQUIRY_TEXT','This is an enquiry e-mail via %s from:'); +DEFINE('_COPY_TEXT','This is a copy of the following message you sent to %s via %s '); +DEFINE('_COPY_SUBJECT','Copy of: '); +DEFINE('_THANK_MESSAGE','Thank you for your e-mail'); +DEFINE('_CLOAKING','This email address is being protected from spam bots, you need Javascript enabled to view it'); +DEFINE('_CONTACT_HEADER_NAME','Name'); +DEFINE('_CONTACT_HEADER_POS','Position'); +DEFINE('_CONTACT_HEADER_EMAIL','Email'); +DEFINE('_CONTACT_HEADER_PHONE','Phone'); +DEFINE('_CONTACT_HEADER_FAX','Fax'); +DEFINE('_CONTACTS_DESC','The Contact list for this Website.'); +DEFINE('_CONTACT_MORE_THAN','You cannot enter more than one email address.'); + +/** classes/html/contact.php */ +DEFINE('_CONTACT_TITLE','Contact'); +DEFINE('_EMAIL_DESCRIPTION','Send an Email to this Contact:'); +DEFINE('_NAME_PROMPT',' Enter your name:'); +DEFINE('_EMAIL_PROMPT',' E-mail address:'); +DEFINE('_MESSAGE_PROMPT',' Enter your message:'); +DEFINE('_SEND_BUTTON','Send'); +DEFINE('_CONTACT_FORM_NC','Please make sure the form is complete and valid.'); +DEFINE('_CONTACT_TELEPHONE','Telephone: '); +DEFINE('_CONTACT_MOBILE','Mobile: '); +DEFINE('_CONTACT_FAX','Fax: '); +DEFINE('_CONTACT_EMAIL','Email: '); +DEFINE('_CONTACT_NAME','Name: '); +DEFINE('_CONTACT_POSITION','Position: '); +DEFINE('_CONTACT_ADDRESS','Address: '); +DEFINE('_CONTACT_MISC','Information: '); +DEFINE('_CONTACT_SEL','Select Contact:'); +DEFINE('_CONTACT_NONE','There are no Contact Details listed.'); +DEFINE('_CONTACT_ONE_EMAIL','You cannot enter more than one email address.'); +DEFINE('_EMAIL_A_COPY','Email a copy of this message to your own address'); +DEFINE('_CONTACT_DOWNLOAD_AS','Download information as a'); +DEFINE('_VCARD','VCard'); + +/** pageNavigation */ +DEFINE('_PN_LT','<'); +DEFINE('_PN_RT','>'); +DEFINE('_PN_PAGE','Page'); +DEFINE('_PN_OF','of'); +DEFINE('_PN_START','Start'); +DEFINE('_PN_PREVIOUS','Prev'); +DEFINE('_PN_NEXT','Next'); +DEFINE('_PN_END','End'); +DEFINE('_PN_DISPLAY_NR','Display #'); +DEFINE('_PN_RESULTS','Results'); + +/** emailfriend */ +DEFINE('_EMAIL_TITLE','E-mail a friend'); +DEFINE('_EMAIL_FRIEND','E-mail this to a friend.'); +DEFINE('_EMAIL_FRIEND_ADDR',"Your friend's E-mail:"); +DEFINE('_EMAIL_YOUR_NAME','Your Name:'); +DEFINE('_EMAIL_YOUR_MAIL','Your E-mail:'); +DEFINE('_SUBJECT_PROMPT',' Message subject:'); +DEFINE('_BUTTON_SUBMIT_MAIL','Send e-mail'); +DEFINE('_BUTTON_CANCEL','Cancel'); +DEFINE('_EMAIL_ERR_NOINFO','You must enter your valid e-mail and the valid e-mail to send to.'); +DEFINE('_EMAIL_MSG','The following page from the "%s" website has been sent to you by %s ( %s ). + +You can access it at the following url: +%s'); +DEFINE('_EMAIL_INFO','Item sent by'); +DEFINE('_EMAIL_SENT','This item has been sent to'); +DEFINE('_PROMPT_CLOSE','Close Window'); + +/** classes/html/content.php */ +DEFINE('_AUTHOR_BY', ' Contributed by'); +DEFINE('_WRITTEN_BY', ' Written by'); +DEFINE('_LAST_UPDATED', 'Last Updated'); +DEFINE('_BACK','[ Back ]'); +DEFINE('_LEGEND','Legend'); +DEFINE('_DATE','Date'); +DEFINE('_ORDER_DROPDOWN','Order'); +DEFINE('_HEADER_TITLE','Item Title'); +DEFINE('_HEADER_AUTHOR','Author'); +DEFINE('_HEADER_SUBMITTED','Submitted'); +DEFINE('_HEADER_HITS','Hits'); +DEFINE('_E_EDIT','Edit'); +DEFINE('_E_ADD','Add'); +DEFINE('_E_WARNUSER','Please either Cancel or Save the current change'); +DEFINE('_E_WARNTITLE','Content item must have a title'); +DEFINE('_E_WARNTEXT','Content item must have intro text'); +DEFINE('_E_WARNCAT','Please select a category'); +DEFINE('_E_CONTENT','Content'); +DEFINE('_E_TITLE','Title:'); +DEFINE('_E_CATEGORY','Category:'); +DEFINE('_E_INTRO','Intro Text'); +DEFINE('_E_MAIN','Main Text'); +DEFINE('_E_MOSIMAGE','INSERT {mosimage}'); +DEFINE('_E_IMAGES','Images'); +DEFINE('_E_GALLERY_IMAGES','Gallery Images'); +DEFINE('_E_CONTENT_IMAGES','Content Images'); +DEFINE('_E_EDIT_IMAGE','Edit Image'); +DEFINE('_E_NO_IMAGE','No Image'); +DEFINE('_E_INSERT','Insert'); +DEFINE('_E_UP','Up'); +DEFINE('_E_DOWN','Down'); +DEFINE('_E_REMOVE','Remove'); +DEFINE('_E_SOURCE','Source:'); +DEFINE('_E_ALIGN','Align:'); +DEFINE('_E_ALT','Alt Text:'); +DEFINE('_E_BORDER','Border:'); +DEFINE('_E_CAPTION','Caption'); +DEFINE('_E_CAPTION_POSITION','Caption Position'); +DEFINE('_E_CAPTION_ALIGN','Caption Align'); +DEFINE('_E_CAPTION_WIDTH','Caption Width'); +DEFINE('_E_APPLY','Apply'); +DEFINE('_E_PUBLISHING','Publishing'); +DEFINE('_E_STATE','State:'); +DEFINE('_E_AUTHOR_ALIAS','Author Alias:'); +DEFINE('_E_ACCESS_LEVEL','Access Level:'); +DEFINE('_E_ORDERING','Ordering:'); +DEFINE('_E_START_PUB','Start Publishing:'); +DEFINE('_E_FINISH_PUB','Finish Publishing:'); +DEFINE('_E_SHOW_FP','Show on Front Page:'); +DEFINE('_E_HIDE_TITLE','Hide Item Title:'); +DEFINE('_E_METADATA','Metadata'); +DEFINE('_E_M_DESC','Description:'); +DEFINE('_E_M_KEY','Keywords:'); +DEFINE('_E_SUBJECT','Subject:'); +DEFINE('_E_EXPIRES','Expiry Date:'); +DEFINE('_E_VERSION','Version:'); +DEFINE('_E_ABOUT','About'); +DEFINE('_E_CREATED','Created:'); +DEFINE('_E_LAST_MOD','Last Modified:'); +DEFINE('_E_HITS','Hits:'); +DEFINE('_E_SAVE','Save'); +DEFINE('_E_CANCEL','Cancel'); +DEFINE('_E_REGISTERED','Registered Users Only'); +DEFINE('_E_ITEM_INFO','Item Information'); +DEFINE('_E_ITEM_SAVED','Item successfully saved.'); +DEFINE('_ITEM_PREVIOUS','< Prev'); +DEFINE('_ITEM_NEXT','Next >'); +DEFINE('_KEY_NOT_FOUND','Key not found'); + + +/** content.php */ +DEFINE('_SECTION_ARCHIVE_EMPTY','There are currently no Archived Entries for this Section, please come back later'); +DEFINE('_CATEGORY_ARCHIVE_EMPTY','There are currently no Archived Entries for this Category, please come back later'); +DEFINE('_HEADER_SECTION_ARCHIVE','Section Archives'); +DEFINE('_HEADER_CATEGORY_ARCHIVE','Category Archives'); +DEFINE('_ARCHIVE_SEARCH_FAILURE','There are no Archived entries for %s %s'); // values are month then year +DEFINE('_ARCHIVE_SEARCH_SUCCESS','Here are the Archived entries for %s %s'); // values are month then year +DEFINE('_FILTER','Filter'); +DEFINE('_ORDER_DROPDOWN_DA','Date asc'); +DEFINE('_ORDER_DROPDOWN_DD','Date desc'); +DEFINE('_ORDER_DROPDOWN_TA','Title asc'); +DEFINE('_ORDER_DROPDOWN_TD','Title desc'); +DEFINE('_ORDER_DROPDOWN_HA','Hits asc'); +DEFINE('_ORDER_DROPDOWN_HD','Hits desc'); +DEFINE('_ORDER_DROPDOWN_AUA','Author asc'); +DEFINE('_ORDER_DROPDOWN_AUD','Author desc'); +DEFINE('_ORDER_DROPDOWN_O','Ordering'); + +/** poll.php */ +DEFINE('_ALERT_ENABLED','Cookies must be enabled!'); +DEFINE('_ALREADY_VOTE','You already voted for this poll today!'); +DEFINE('_NO_SELECTION','No selection has been made, please try again'); +DEFINE('_THANKS','Thanks for your vote!'); +DEFINE('_SELECT_POLL','Select Poll from the list'); + +/** classes/html/poll.php */ +DEFINE('_JAN','January'); +DEFINE('_FEB','February'); +DEFINE('_MAR','March'); +DEFINE('_APR','April'); +DEFINE('_MAY','May'); +DEFINE('_JUN','June'); +DEFINE('_JUL','July'); +DEFINE('_AUG','August'); +DEFINE('_SEP','September'); +DEFINE('_OCT','October'); +DEFINE('_NOV','November'); +DEFINE('_DEC','December'); +DEFINE('_POLL_TITLE','Poll - Results'); +DEFINE('_SURVEY_TITLE','Poll Title:'); +DEFINE('_NUM_VOTERS','Number of Voters'); +DEFINE('_FIRST_VOTE','First Vote'); +DEFINE('_LAST_VOTE','Last Vote'); +DEFINE('_SEL_POLL','Select Poll:'); +DEFINE('_NO_RESULTS','There are no results for this poll.'); + +/** registration.php */ +DEFINE('_ERROR_PASS','Sorry, no corresponding user was found'); +DEFINE('_NEWPASS_MSG','The user account $checkusername has this email associated with it.\n' +.'A web user from $mosConfig_live_site has just requested that a new password be sent.\n\n' +.' Your New Password is: $newpass\n\nIf you didn\'t ask for this, don\'t worry.' +.' You are seeing this message, not them. If this was an error just login with your' +.' new password and then change your password to what you would like it to be.'); +DEFINE('_NEWPASS_SUB','$_sitename :: New password for - $checkusername'); +DEFINE('_NEWPASS_SENT','New User Password created and sent!'); +DEFINE('_REGWARN_NAME','Please enter your name.'); +DEFINE('_REGWARN_UNAME','Please enter a user name.'); +DEFINE('_REGWARN_MAIL','Please enter a valid e-mail address.'); +DEFINE('_REGWARN_PASS','Please enter a valid password. No spaces, more than 6 characters and contain 0-9,a-z,A-Z'); +DEFINE('_REGWARN_VPASS1','Please verify the password.'); +DEFINE('_REGWARN_VPASS2','Password and verification do not match, please try again.'); +DEFINE('_REGWARN_INUSE','This username/password already in use. Please try another.'); +DEFINE('_REGWARN_EMAIL_INUSE', 'This e-mail is already registered. If you forgot the password click on "Lost your Password" and new password will be sent to you.'); +DEFINE('_SEND_SUB','Account details for %s at %s'); +DEFINE('_USEND_MSG_ACTIVATE', 'Hello %s, + +Thank you for registering at %s. Your account is created and must be activated before you can use it. +To activate the account click on the following link or copy-paste it in your browser: +%s + +After activation you may login to %s using the following username and password: + +Username - %s +Password - %s'); +DEFINE('_USEND_MSG', "Hello %s, + +Thank you for registering at %s. + +You may now login to %s using the username and password you registered with."); +DEFINE('_USEND_MSG_NOPASS','Hello $name,\n\nYou have been added as a user to $mosConfig_live_site.\n' +.'You may login to $mosConfig_live_site with the username and password you registered with.\n\n' +.'Please do not respond to this message as it is automatically generated and is for information purposes only\n'); +DEFINE('_ASEND_MSG','Hello %s, + +A new user has registered at %s. +This email contains their details: + +Name - %s +e-mail - %s +Username - %s + +Please do not respond to this message as it is automatically generated and is for information purposes only'); +DEFINE('_REG_COMPLETE_NOPASS','
    Registration Complete!

      ' +.'You may now login.
      '); +DEFINE('_REG_COMPLETE', '
    Registration Complete!

    You may now login.'); +DEFINE('_REG_COMPLETE_ACTIVATE', '
    Registration Complete!

    Your account has been created and activation link has been sent to the e-mail address you entered. Note that you must activate the account by clicking on the activation link when you get the e-mail before you can login.'); +DEFINE('_REG_ACTIVATE_COMPLETE', '
    Activation Complete!

    Your account has been successfully activated. You can now login using the username and password you chose during the registration.'); +DEFINE('_REG_ACTIVATE_NOT_FOUND', '
    Invalid Activation Link!

    There is no such account in our database or the account has already been activated.'); + +/** classes/html/registration.php */ +DEFINE('_PROMPT_PASSWORD','Lost your Password?'); +DEFINE('_NEW_PASS_DESC','Please enter your Username and e-mail address then click on the Send Password button.
    ' +.'You will receive a new password shortly. Use this new password to access the site.'); +DEFINE('_PROMPT_UNAME','Username:'); +DEFINE('_PROMPT_EMAIL','E-mail Address:'); +DEFINE('_BUTTON_SEND_PASS','Send Password'); +DEFINE('_REGISTER_TITLE','Registration'); +DEFINE('_REGISTER_NAME','Name:'); +DEFINE('_REGISTER_UNAME','Username:'); +DEFINE('_REGISTER_EMAIL','E-mail:'); +DEFINE('_REGISTER_PASS','Password:'); +DEFINE('_REGISTER_VPASS','Verify Password:'); +DEFINE('_REGISTER_REQUIRED','Fields marked with an asterisk (*) are required.'); +DEFINE('_BUTTON_SEND_REG','Send Registration'); +DEFINE('_SENDING_PASSWORD','Your password will be sent to the above e-mail address.
    Once you have received your' +.' new password you can login in and change it.'); + +/** classes/html/search.php */ +DEFINE('_SEARCH_TITLE','Search'); +DEFINE('_PROMPT_KEYWORD','Search Keyword'); +DEFINE('_SEARCH_MATCHES','returned %d matches'); +DEFINE('_CONCLUSION','Total $totalRows results found. Search for [ $searchword ] with'); +DEFINE('_NOKEYWORD','No results were found'); +DEFINE('_IGNOREKEYWORD','One or more common words were ignored in the search'); +DEFINE('_SEARCH_ANYWORDS','Any words'); +DEFINE('_SEARCH_ALLWORDS','All words'); +DEFINE('_SEARCH_PHRASE','Exact phrase'); +DEFINE('_SEARCH_NEWEST','Newest first'); +DEFINE('_SEARCH_OLDEST','Oldest first'); +DEFINE('_SEARCH_POPULAR','Most popular'); +DEFINE('_SEARCH_ALPHABETICAL','Alphabetical'); +DEFINE('_SEARCH_CATEGORY','Section/Category'); +DEFINE('_SEARCH_MESSAGE','Search term must be a minimum of 3 characters and a maximum of 20 characters'); +DEFINE('_SEARCH_ARCHIVED','Archived'); +DEFINE('_SEARCH_CATBLOG','Category Blog'); +DEFINE('_SEARCH_CATLIST','Category List'); +DEFINE('_SEARCH_NEWSFEEDS','Newsfeeds'); +DEFINE('_SEARCH_SECLIST','Section List'); +DEFINE('_SEARCH_SECBLOG','Section Blog'); + + +/** templates/*.php */ +DEFINE('_ISO','charset=iso-8859-1'); +DEFINE('_DATE_FORMAT','l, F d Y'); //Uses PHP's DATE Command Format - Depreciated +/** +* Modify this line to reflect how you want the date to appear in your site +* +*e.g. DEFINE("_DATE_FORMAT_LC","%A, %d %B %Y %H:%M"); //Uses PHP's strftime Command Format +*/ +DEFINE('_DATE_FORMAT_LC',"%A, %d %B %Y"); //Uses PHP's strftime Command Format +DEFINE('_DATE_FORMAT_LC2',"%A, %d %B %Y %H:%M"); +DEFINE('_SEARCH_BOX','search...'); +DEFINE('_NEWSFLASH_BOX','Newsflash!'); +DEFINE('_MAINMENU_BOX','Main Menu'); + +/** classes/html/usermenu.php */ +DEFINE('_UMENU_TITLE','User Menu'); +DEFINE('_HI','Hi, '); + +/** user.php */ +DEFINE('_SAVE_ERR','Please complete all the fields.'); +DEFINE('_THANK_SUB','Thanks for your submission. Your submission will now be reviewed before being posted to the site.'); +DEFINE('_THANK_SUB_PUB','Thanks for your submission.'); +DEFINE('_UP_SIZE','You cannot upload files greater than 15kb in size.'); +DEFINE('_UP_EXISTS','Image $userfile_name already exists. Please rename the file and try again.'); +DEFINE('_UP_COPY_FAIL','Failed to copy'); +DEFINE('_UP_TYPE_WARN','You may only upload a gif, or jpg image.'); +DEFINE('_MAIL_SUB','User Submitted'); +DEFINE('_MAIL_MSG','Hello $adminName,\n\n\nA user submitted $type:\n [ $title ]\n has been just been submitted by user:\n [ $author ]\n' +.' for $mosConfig_live_site.\n\n\n\n' +.'Please go to $mosConfig_live_site/administrator to view and approve this $type.\n\n' +.'Please do not respond to this message as it is automatically generated and is for information purposes only\n'); +DEFINE('_PASS_VERR1','If changing your password please enter the password again to verify.'); +DEFINE('_PASS_VERR2','If changing your password please make sure the password and verification match.'); +DEFINE('_UNAME_INUSE','This username already in use.'); +DEFINE('_UPDATE','Update'); +DEFINE('_USER_DETAILS_SAVE','Your settings have been saved.'); +DEFINE('_USER_LOGIN','User Login'); + +/** components/com_user */ +DEFINE('_EDIT_TITLE','Edit Your Details'); +DEFINE('_YOUR_NAME','Your Name:'); +DEFINE('_EMAIL','e-mail:'); +DEFINE('_UNAME','User Name:'); +DEFINE('_PASS','Password:'); +DEFINE('_VPASS','Verify Password:'); +DEFINE('_SUBMIT_SUCCESS','Submission Success!'); +DEFINE('_SUBMIT_SUCCESS_DESC','Your item has been successfully submitted to our administrators. It will be reviewed before being published on this site.'); +DEFINE('_WELCOME','Welcome!'); +DEFINE('_WELCOME_DESC','Welcome to the user section of our site'); +DEFINE('_CONF_CHECKED_IN','Checked out items have now been all checked in'); +DEFINE('_CHECK_TABLE','Checking table'); +DEFINE('_CHECKED_IN','Checked in '); +DEFINE('_CHECKED_IN_ITEMS',' items'); +DEFINE('_PASS_MATCH','Passwords do not match'); + +/** components/com_banners */ +DEFINE('_BNR_CLIENT_NAME','You must select a name for the client.'); +DEFINE('_BNR_CONTACT','You must select a contact for the client.'); +DEFINE('_BNR_VALID_EMAIL','You must select a valid email for the client.'); +DEFINE('_BNR_CLIENT','You must select a client,'); +DEFINE('_BNR_NAME','You must select a name for the banner.'); +DEFINE('_BNR_IMAGE','You must select a image for the banner.'); +DEFINE('_BNR_URL','You must select a URL/Custom banner code for the banner.'); + +/** components/com_login */ +DEFINE('_ALREADY_LOGIN','You are already logged in!'); +DEFINE('_LOGOUT','Click here to logout'); +DEFINE('_LOGIN_TEXT','Use the login and password fields opposite to gain full access'); +DEFINE('_LOGIN_SUCCESS','You have successfully Logged In'); +DEFINE('_LOGOUT_SUCCESS','You have successfully Logged Out'); +DEFINE('_LOGIN_DESCRIPTION','To access the Private area of this site please Login'); +DEFINE('_LOGOUT_DESCRIPTION','You are currently Logged in to the private area of this site'); + + +/** components/com_weblinks */ +DEFINE('_WEBLINKS_TITLE','Web Links'); +DEFINE('_WEBLINKS_DESC','We are regularly out on the web. When we find a great site we list' +.' it here for you to enjoy.
    From the list below choose one of our weblink topics, then select a URL to visit.'); +DEFINE('_HEADER_TITLE_WEBLINKS','Web Link'); +DEFINE('_SECTION','Section:'); +DEFINE('_SUBMIT_LINK','Submit A Web Link'); +DEFINE('_URL','URL:'); +DEFINE('_URL_DESC','Description:'); +DEFINE('_NAME','Name:'); +DEFINE('_WEBLINK_EXIST','There is a weblink already with that name, please try again.'); +DEFINE('_WEBLINK_TITLE','Your Weblink must contain a title.'); + +/** components/com_newfeeds */ +DEFINE('_FEED_NAME','Feed Name'); +DEFINE('_FEED_ARTICLES','# Articles'); +DEFINE('_FEED_LINK','Feed Link'); + +/** whos_online.php */ +DEFINE('_WE_HAVE', 'We have '); +DEFINE('_AND', ' and '); +DEFINE('_GUEST_COUNT','%s guest'); +DEFINE('_GUESTS_COUNT','%s guests'); +DEFINE('_MEMBER_COUNT','%s member'); +DEFINE('_MEMBERS_COUNT','%s members'); +DEFINE('_ONLINE',' online'); +DEFINE('_NONE','No Users Online'); + +/** modules/mod_random_image */ +DEFINE('_NO_IMAGES','No Images'); + +/** modules/mod_stats.php */ +DEFINE('_TIME_STAT','Time'); +DEFINE('_MEMBERS_STAT','Members'); +DEFINE('_HITS_STAT','Hits'); +DEFINE('_NEWS_STAT','News'); +DEFINE('_LINKS_STAT','WebLinks'); +DEFINE('_VISITORS','Visitors'); + +/** /adminstrator/components/com_menus/admin.menus.html.php */ +DEFINE('_MAINMENU_HOME','* The 1st Published item in this menu [mainmenu] is the default `Homepage` for the site *'); +DEFINE('_MAINMENU_DEL','* You cannot `delete` this menu as it is required for the proper operation of Joomla! *'); +DEFINE('_MENU_GROUP','* Some `Menu Types` appear in more than one group *'); + + +/** administrators/components/com_users */ +DEFINE('_NEW_USER_MESSAGE_SUBJECT', 'New User Details' ); +DEFINE('_NEW_USER_MESSAGE', 'Hello %s, + + +You have been added as a user to %s by an Administrator. + +This email contains your username and password to log into the %s + +Username - %s +Password - %s + + +Please do not respond to this message as it is automatically generated and is for information purposes only'); + +/** administrators/components/com_massmail */ +DEFINE('_MASSMAIL_MESSAGE', "This is an email from '%s' + +Message: +" ); + + +/** includes/pdf.php */ +DEFINE('_PDF_GENERATED','Generated:'); +DEFINE('_PDF_POWERED','Powered by Joomla!'); ?> \ No newline at end of file diff -urN joomla-1.0.7/mambots/content/geshi/geshi/css.php joomla-1.0.10/mambots/content/geshi/geshi/css.php --- joomla-1.0.7/mambots/content/geshi/geshi/css.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi/css.php 2006-06-25 16:54:37.000000000 -0400 @@ -4,10 +4,10 @@ * ------- * Author: Nigel McNie (oracle.shinoda@gmail.com) * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/) - * Release Version: 1.0.3 - * CVS Revision Version: $Revision: 47 $ + * Release Version: 1.0.7.8 + * CVS Revision Version: $Revision: 2968 $ * Date Started: 2004/06/18 - * Last Modified: $Date: 2005-09-05 17:53:16 -0500 (Mon, 05 Sep 2005) $ + * Last Modified: $Date: 2006/02/25 00:46:33 $ * * CSS language file for GeSHi. * @@ -31,7 +31,7 @@ * ************************************************************************************* * - * This file is part of GeSHi. + * This file is part of GeSHi. * * GeSHi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -67,12 +67,12 @@ 'border-right-style', 'border-right-width', 'border-top-color', 'border-top-style', 'border-top-width','border-bottom', 'border-collapse', 'border-left', 'border-width', 'border-color', 'border-spacing', - 'border-style', 'border-top', 'border', 'bottom', 'caption-side', + 'border-style', 'border-top', 'border', 'caption-side', 'clear', 'clip', 'color', 'content', 'counter-increment', 'counter-reset', 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display', 'elevation', 'empty-cells', 'float', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', - 'font-weight', 'font', 'height', 'left', 'letter-spacing', 'line-height', + 'font-weight', 'font', 'height', 'letter-spacing', 'line-height', 'list-style', 'list-style-image', 'list-style-position', 'list-style-type', 'margin-bottom', 'margin-left', 'margin-right', 'margin-top', 'margin', 'marker-offset', 'marks', 'max-height', 'max-width', 'min-height', @@ -85,12 +85,13 @@ 'speak', 'speech-rate', 'stress', 'table-layout', 'text-align', 'text-decoration', 'text-indent', 'text-shadow', 'text-transform', 'top', 'unicode-bidi', 'vertical-align', 'visibility', 'voice-family', 'volume', 'white-space', 'widows', - 'width', 'word-spacing', 'z-index' + 'width', 'word-spacing', 'z-index', 'bottom', 'left' ), 2 => array( 'above', 'absolute', 'always', 'armenian', 'aural', 'auto', 'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink', 'block', 'bold', 'bolder', 'both', - 'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic', 'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive', + 'capitalize', 'center-left', 'center-right', 'center', 'circle', 'cjk-ideographic', + 'close-quote', 'collapse', 'condensed', 'continuous', 'crop', 'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero', 'decimal', 'default', 'digits', 'disc', 'dotted', 'double', 'e-resize', 'embed', 'extra-condensed', 'extra-expanded', 'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast', 'fixed', 'fuchsia', diff -urN joomla-1.0.7/mambots/content/geshi/geshi/html4strict.php joomla-1.0.10/mambots/content/geshi/geshi/html4strict.php --- joomla-1.0.7/mambots/content/geshi/geshi/html4strict.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi/html4strict.php 2006-06-25 16:54:37.000000000 -0400 @@ -4,17 +4,19 @@ * --------------- * Author: Nigel McNie (oracle.shinoda@gmail.com) * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/) - * Release Version: 1.0.3 - * CVS Revision Version: $Revision: 47 $ + * Release Version: 1.0.7.8 + * CVS Revision Version: $Revision: 2968 $ * Date Started: 2004/07/10 - * Last Modified: $Date: 2005-09-05 17:53:16 -0500 (Mon, 05 Sep 2005) $ + * Last Modified: $Date: 2006/02/25 00:46:33 $ * * HTML 4.01 strict language file for GeSHi. * * CHANGES * ------- + * 2005/12/28 (1.0.4) + * - Removed escape character for strings * 2004/11/27 (1.0.3) - * - Added support for multiple object splitters + * - Added support for multiple object splitters * 2004/10/27 (1.0.2) * - Added support for URLs * 2004/08/05 (1.0.1) @@ -31,7 +33,7 @@ * ************************************************************************************* * - * This file is part of GeSHi. + * This file is part of GeSHi. * * GeSHi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,7 +57,7 @@ 'COMMENT_MULTI' => array(''), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array("'", '"'), - 'ESCAPE_CHAR' => '\\', + 'ESCAPE_CHAR' => '', 'KEYWORDS' => array( 1 => array( ), diff -urN joomla-1.0.7/mambots/content/geshi/geshi/ini.php joomla-1.0.10/mambots/content/geshi/geshi/ini.php --- joomla-1.0.7/mambots/content/geshi/geshi/ini.php 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi/ini.php 2006-06-25 16:54:37.000000000 -0400 @@ -0,0 +1,125 @@ + 'ini', + 'COMMENT_SINGLE' => array(0 => ';'), + 'COMMENT_MULTI' => array(), + 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, + 'QUOTEMARKS' => array('"'), + 'ESCAPE_CHAR' => '', + 'KEYWORDS' => array( + ), + 'SYMBOLS' => array( + '[', ']', '=' + ), + 'CASE_SENSITIVE' => array( + GESHI_COMMENTS => false + ), + 'STYLES' => array( + 'KEYWORDS' => array( + ), + 'COMMENTS' => array( + 0 => 'color: #666666; font-style: italic;' + ), + 'ESCAPE_CHAR' => array( + 0 => '' + ), + 'BRACKETS' => array( + 0 => '' + ), + 'STRINGS' => array( + 0 => 'color: #933;' + ), + 'NUMBERS' => array( + 0 => '' + ), + 'METHODS' => array( + 0 => '' + ), + 'SYMBOLS' => array( + 0 => 'color: #000066; font-weight:bold;' + ), + 'REGEXPS' => array( + 0 => 'color: #000066; font-weight:bold;', + 1 => 'color: #000099;', + 2 => 'color: #660066;' + ), + 'SCRIPT' => array( + 0 => '' + ) + ), + 'URLS' => array( + ), + 'OOLANG' => false, + 'OBJECT_SPLITTERS' => array( + ), + 'REGEXPS' => array( + 0 => '\[.+\]', + 1 => array( + GESHI_SEARCH => '([a-zA-Z0-9_]+\s*)=(.+)', + GESHI_REPLACE => '\\1', + GESHI_MODIFIERS => '', + GESHI_BEFORE => '', + GESHI_AFTER => '=\\2' + ), + 2 => array( + // Evil hackery to get around GeSHi bug: <>" and ; are added so s can be matched + // Explicit match on variable names because if a comment is before the first < of the span + // gets chewed up... + GESHI_SEARCH => '([<>";a-zA-Z0-9_]+\s*)=(.+)', + GESHI_REPLACE => '\\2', + GESHI_MODIFIERS => '', + GESHI_BEFORE => '\\1=', + GESHI_AFTER => '' + ) + ), + 'STRICT_MODE_APPLIES' => GESHI_NEVER, + 'SCRIPT_DELIMITERS' => array( + ), + 'HIGHLIGHT_STRICT_BLOCK' => array( + ) +); + +?> \ No newline at end of file diff -urN joomla-1.0.7/mambots/content/geshi/geshi/javascript.php joomla-1.0.10/mambots/content/geshi/geshi/javascript.php --- joomla-1.0.7/mambots/content/geshi/geshi/javascript.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi/javascript.php 2006-06-25 16:54:37.000000000 -0400 @@ -4,10 +4,10 @@ * -------------- * Author: Ben Keen (ben.keen@gmail.com) * Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter) - * Release Version: 1.0.1 - * CVS Revision Version: $Revision: 47 $ + * Release Version: 1.0.7.8 + * CVS Revision Version: $Revision: 2968 $ * Date Started: 2004/06/20 - * Last Modified: $Date: 2005-09-05 17:53:16 -0500 (Mon, 05 Sep 2005) $ + * Last Modified: $Date: 2006/02/25 00:46:33 $ * * JavaScript language file for GeSHi. * @@ -23,7 +23,7 @@ * ************************************************************************************* * - * This file is part of GeSHi. + * This file is part of GeSHi. * * GeSHi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,73 +49,73 @@ 'QUOTEMARKS' => array("'", '"'), 'ESCAPE_CHAR' => '\\', 'KEYWORDS' => array( - 1 => array( - 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do', - 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item', - 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void', - 'while', 'write', 'with' - ), - 2 => array( - 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false', - 'function', 'import', 'namespace', 'new', 'null', 'package', 'private', - 'protected', 'public', 'super', 'true', 'use', 'var' - ), - 3 => array( + 1 => array( + 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do', + 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item', + 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void', + 'while', 'write', 'with' + ), + 2 => array( + 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false', + 'function', 'import', 'namespace', 'new', 'null', 'package', 'private', + 'protected', 'public', 'super', 'true', 'use', 'var' + ), + 3 => array( - // common functions for Window object - 'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home', - 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove', - 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status', - 'stop', - ) - ), + // common functions for Window object + 'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home', + 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove', + 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status', + 'stop', + ) + ), 'SYMBOLS' => array( - '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>' - ), + '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>' + ), 'CASE_SENSITIVE' => array( - GESHI_COMMENTS => false, - 1 => false, - 2 => false, - 3 => false - ), + GESHI_COMMENTS => false, + 1 => false, + 2 => false, + 3 => false + ), 'STYLES' => array( - 'KEYWORDS' => array( - 1 => 'color: #000066; font-weight: bold;', - 2 => 'color: #003366; font-weight: bold;', - 3 => 'color: #000066;' - ), - 'COMMENTS' => array( - 1 => 'color: #009900; font-style: italic;', - 'MULTI' => 'color: #009900; font-style: italic;' - ), - 'ESCAPE_CHAR' => array( - 0 => 'color: #000099; font-weight: bold;' - ), - 'BRACKETS' => array( - 0 => 'color: #66cc66;' - ), - 'STRINGS' => array( - 0 => 'color: #3366CC;' - ), - 'NUMBERS' => array( - 0 => 'color: #CC0000;' - ), - 'METHODS' => array( - 1 => 'color: #006600;' - ), - 'SYMBOLS' => array( - 0 => 'color: #66cc66;' - ), - 'REGEXPS' => array( - 0 => 'color: #0066FF;' - ), - 'SCRIPT' => array( - 0 => '', - 1 => '', - 2 => '', - 3 => '' - ) - ), + 'KEYWORDS' => array( + 1 => 'color: #000066; font-weight: bold;', + 2 => 'color: #003366; font-weight: bold;', + 3 => 'color: #000066;' + ), + 'COMMENTS' => array( + 1 => 'color: #009900; font-style: italic;', + 'MULTI' => 'color: #009900; font-style: italic;' + ), + 'ESCAPE_CHAR' => array( + 0 => 'color: #000099; font-weight: bold;' + ), + 'BRACKETS' => array( + 0 => 'color: #66cc66;' + ), + 'STRINGS' => array( + 0 => 'color: #3366CC;' + ), + 'NUMBERS' => array( + 0 => 'color: #CC0000;' + ), + 'METHODS' => array( + 1 => 'color: #006600;' + ), + 'SYMBOLS' => array( + 0 => 'color: #66cc66;' + ), + 'REGEXPS' => array( + 0 => 'color: #0066FF;' + ), + 'SCRIPT' => array( + 0 => '', + 1 => '', + 2 => '', + 3 => '' + ) + ), 'URLS' => array( 1 => '', 2 => '', @@ -126,20 +126,20 @@ 1 => '.' ), 'REGEXPS' => array( - 0 => "/.*/([igm]*)?" // matches js reg exps - ), + 0 => "/.*/([igm]*)?" // matches js reg exps + ), 'STRICT_MODE_APPLIES' => GESHI_MAYBE, 'SCRIPT_DELIMITERS' => array( - 0 => array( - '' - ), - 1 => array( - '' - ) - ), + 0 => array( + '' + ), + 1 => array( + '' + ) + ), 'HIGHLIGHT_STRICT_BLOCK' => array( - 0 => true, - 1 => true + 0 => true, + 1 => true ) ); diff -urN joomla-1.0.7/mambots/content/geshi/geshi/mysql.php joomla-1.0.10/mambots/content/geshi/geshi/mysql.php --- joomla-1.0.7/mambots/content/geshi/geshi/mysql.php 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi/mysql.php 2006-06-25 16:54:37.000000000 -0400 @@ -0,0 +1,175 @@ + 'MySQL', + 'COMMENT_SINGLE' => array(1 =>'--', 2 => '#'), + 'COMMENT_MULTI' => array('/*' => '*/'), + 'CASE_KEYWORDS' => 1, + 'QUOTEMARKS' => array("'", '"', ''), + 'ESCAPE_CHAR' => '\\', + 'KEYWORDS' => array( + 1 => array( + /* Mix */ + 'ALTER DATABASE', 'ALTER TABLE', 'CREATE DATABASE', 'CREATE INDEX', 'CREATE TABLE', 'DROP DATABASE', + 'DROP INDEX', 'DROP TABLE', 'RENAME TABLE', 'DELETE', 'DO', 'HANDLER', 'INSERT', 'LOAD DATA INFILE', + 'REPLACE', 'SELECT', 'TRUNCATE', 'UPDATE', 'DESCRIBE', 'USE', 'START TRANSACTION', 'COMMIT', 'ROLLBACK', + 'SAVEPOINT', 'ROLLBACK TO SAVEPOINT', 'LOCK TABLES', 'UNLOCK_TABLES', 'SET TRANACTIONS', 'SET', 'SHOW', + 'CREATE PROCEDURE', 'CREATE FUNCTION', 'ALTER PROCEDURE', 'ALTER FUNCTION', 'DROP PROCEDURE', 'DROP FUNCTION', + 'SHOW CREATE PROCEDURE', 'SHOW CREATE FUNCTION', 'SHOW PROCEDURE STATUS', 'SHOW FUNCTION STATUS', + 'CALL', 'BEGIN', 'END', 'DECLARE', 'CREATE ROUTINE', 'ALTER ROUTINE', 'CREATE', 'ALTER', 'DROP', + 'PRIMARY KEY', 'VALUES', 'INTO', 'FROM', + 'ANALYZE', 'BDB', 'BERKELEYDB', 'BTREE', 'BY', 'CASCADE', 'CHECK', 'COLUMN', 'COLUMNS', 'CONSTRAINT', + 'CROSS', 'DATABASES', 'DELAYED', 'DISTINCT', 'DISTINCTROW', 'ENCLOSED', 'ERRORS', 'ESCAPED', 'EXISTS', + 'EXPLAIN', 'FALSE', 'FIELDS', 'FORCE', 'FOREIGN', 'FULLTEXT', 'GEOMETRY', 'GRANT', 'GROUP', 'HASH', + 'HAVING', 'HELP', 'HIGH_PRIORITY', 'IGNORE', 'INNER', 'INNODB', 'INTERVAL', 'JOIN', 'KEYS', 'KILL', + 'LINES', 'LOW_PRIORITY', 'MASTER_SERVER_ID', 'MATCH', 'MIDDLEINT', 'MRG_MYISAM', 'NATURAL', 'OPTIMIZE', + 'OPTION', 'OPTIONALLY', 'ORDER', 'OUTER', 'OUTFILE', 'PRIVILEGES', 'PURGE', 'READ', 'REFERENCES', + 'REQUIRE', 'RESTRICT', 'RETURNS', 'REVOKE', 'RLIKE', 'RTREE', 'SOME', 'SONAME', 'SPATIAL', 'SQL_BIG_RESULT', + 'SQL_CALC_FOUND_ROWS', 'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN', 'STRIPED', 'TERMINATED', + 'TRUE', 'TYPES', 'UNION', 'USAGE', 'USER_RESOURCES', 'USING', 'VARCHARACTER', 'WARNINGS', 'WHERE', 'WRITE', + /* Control Flow Functions */ + 'CASE', 'WHEN', 'THEN', 'ELSE', 'END', + /* String Functions */ + 'BIN', 'BIT_LENGTH', 'CHAR_LENGTH', 'CHARACTER_LENGTH', 'COMPRESS', 'CONCAT', + 'CONCAT_WS', 'CONV', 'ELT', 'EXPORT_SET', 'FIELD', 'FIND_IN_SET', 'FORMAT', 'HEX', + 'INSERT', 'INSTR', 'LCASE', 'LEFT', 'LENGTH', 'LOAD_FILE', 'LOCATE', 'LOWER', 'LPAD', + 'LTRIM', 'MAKE_SET', 'MID', 'OCT', 'OCTET_LENGTH', 'ORD', 'POSITION', 'QUOTE', 'REPEAT', + 'REPLACE', 'REVERSE', 'RIGHT', 'RPAD', 'RTRIM', 'SOUNDEX', 'SPACE', 'SUBSTRING', + 'SUBSTRING_INDEX', 'TRIM', 'UCASE', 'UPPER', 'UNCOMPRESS', 'UNCOMPRESSD_LENGTH', 'UNHEX', + /* Numeric Functions */ + 'ABS', 'ACOS', 'ASIN', 'ATAN', 'ATAN2', 'CEILING', 'CEIL', 'COS', 'COT', 'CRC32', 'DEGREES', + 'EXP', 'FLOOR', 'LN', 'LOG', 'LOG2', 'LOG10', 'MOD', 'PI', 'POW', 'POWER', 'RADIANS', 'RAND', + 'ROUND', 'SIGN', 'SIN', 'SQRT', 'TAN', 'TRUNCATE', + /* Date and Time Functions */ + 'ADDDATE', 'ADDTIME', 'CONVERT_TZ', 'CURDATE', 'CURRENT_DATE', 'CURTIME', 'CURRENT_TIME', + 'CURRENT_TIMESTAMP', 'DATEDIFF', 'DATE_ADD', 'DATE_SUB', 'DATE_FORMAT', 'DAY', + 'DAYNAME', 'DAYOFMONTH', 'DAYOFWEEK', 'DAYOFYEAR', 'EXTRACT', 'FROM_DAYS', 'FROM_UNIXTIME', + 'GET_FORMAT', 'LAST_DAY', 'LOCALTIME', 'LOCALTIMESTAMP', 'MAKEDATE', 'MAKETIME', + 'MICROSECOND', 'MONTHNAME', 'NOW', 'PERIOD_ADD', 'PERIOD_DIFF', 'QUARTER', + 'SECOND', 'SEC_TO_TIME', 'STR_TO_DATE', 'SUBDATE', 'SUBTIME', 'SYSDATE', 'TIME', 'TIMEDIFF', + 'TIMESTAMP', 'TIMESTAMPADD', 'TIMESTAMPDIFF', 'TIME_FORMAT', 'TIME_TO_SEC', 'TO_DAYS', + 'UNIX_TIMESTAMP', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'WEEKDAY', 'WEEKOFYEAR', + 'YEARWEEK', + + ), + 2 => array( + 'INTEGER', 'SMALLINT', 'DECIMAL', 'NUMERIC', 'FLOAT', 'REAL', 'DOUBLE PRECISION', + 'DOUBLE', 'INT', 'DEC', 'BIT' ,'TINYINT', 'SMALLINT', 'MEDIUMINT', 'BIGINT', + 'DATETIME', 'DATE', 'TIMESTAMP', 'TIME', 'YEAR', + 'CHAR', 'VARCHAR', 'BINARY', 'CHARACTER VARYING', 'VARBINARY', 'TINYBLOB', 'TINYTEXT', + 'BLOB', 'TEXT','MEDIUMBLOB', 'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT', 'ENUM', 'SET', + 'SERIAL DEFAULT VALUE', 'SERIAL', 'FIXED' + ), + 3 => array( + 'ZEROFILL', 'NOT NULL', 'UNSIGNED', 'AUTO_INCREMENT', 'UNIQUE', 'NOT', 'NULL', 'CHARACTER SET', 'CHARSET', + 'ASCII', 'UNICODE', 'NATIONAL', 'BOTH', 'LEADING', 'TRAILING','DEFAULT' + ), + 4 => array( + 'MICROSECOND', 'SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'QUARTER', 'YEAR', 'SECOND_MICROSECOND', + 'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'HOUR_MICROSECOND', 'HOUR_SECOND', 'HOUR_MINUTE', 'DAY_MICROSECOND', + 'DAY_SECOND', 'DAY_MINUTE', 'DAY_HOUR', 'YEAR_MONTH', + ), + ), + 'SYMBOLS' => array( + ':=', + '||', 'OR', 'XOR', + '&&', 'AND', + 'NOT', + 'BETWEEN', 'CASE', 'WHEN', 'THEN', 'ELSE', + '=', '<=>', '>=', '>', '<=', '<', '<>', '!=', 'IS', 'LIKE', 'REGEXP', 'IN', + '|', + '&', + '<<', '>>', + '-', '+', + '*', '/', 'DIV', '%', 'MOD', + '^', + '-', '~', + '!', + 'BINARY', 'COLLATE', + '(', ')', + ), + 'CASE_SENSITIVE' => array( + GESHI_COMMENTS => false, + 1 => false, + 2 => false, + 3 => false, + 4 => false, + ), + 'STYLES' => array( + 'KEYWORDS' => array( + 1 => 'color: #993333; font-weight: bold;', + 2 => 'color: #aa9933; font-weight: bold;', + 3 => 'color: #aa3399; font-weight: bold;', + 4 => 'color: #33aa99; font-weight: bold;', + ), + 'COMMENTS' => array( + 1 => 'color: #808080; font-style: italic;', + 2 => 'color: #808080; font-style: italic;' + ), + 'ESCAPE_CHAR' => array( + 0 => 'color: #000099; font-weight: bold;' + ), + 'BRACKETS' => array( + 0 => 'color: #66cc66;' + ), + 'STRINGS' => array( + 0 => 'color: #ff0000;' + ), + 'NUMBERS' => array( + 0 => 'color: #cc66cc;' + ), + 'METHODS' => array( + ), + 'SYMBOLS' => array( + 0 => 'color: #66cc66;' + ), + 'SCRIPT' => array( + ), + 'REGEXPS' => array( + ) + ), + 'OOLANG' => false, + 'OBJECT_SPLITTERS' => array( + ), + 'REGEXPS' => array( + ), + 'STRICT_MODE_APPLIES' => GESHI_NEVER, + 'SCRIPT_DELIMITERS' => array( + ), + 'HIGHLIGHT_STRICT_BLOCK' => array( + ) +); + +?> diff -urN joomla-1.0.7/mambots/content/geshi/geshi/php-brief.php joomla-1.0.10/mambots/content/geshi/geshi/php-brief.php --- joomla-1.0.7/mambots/content/geshi/geshi/php-brief.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi/php-brief.php 2006-06-25 16:54:37.000000000 -0400 @@ -4,10 +4,10 @@ * ------------- * Author: Nigel McNie (oracle.shinoda@gmail.com) * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/) - * Release Version: 1.0.3 - * CVS Revision Version: $Revision: 47 $ + * Release Version: 1.0.7.8 + * CVS Revision Version: $Revision: 2968 $ * Date Started: 2004/06/02 - * Last Modified: $Date: 2005-09-05 17:53:16 -0500 (Mon, 05 Sep 2005) $ + * Last Modified: $Date: 2006/02/25 00:46:33 $ * * PHP language file for GeSHi (brief version). * @@ -29,7 +29,7 @@ * ************************************************************************************* * - * This file is part of GeSHi. + * This file is part of GeSHi. * * GeSHi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff -urN joomla-1.0.7/mambots/content/geshi/geshi/php.php joomla-1.0.10/mambots/content/geshi/geshi/php.php --- joomla-1.0.7/mambots/content/geshi/geshi/php.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi/php.php 2006-06-25 16:54:37.000000000 -0400 @@ -4,10 +4,10 @@ * -------- * Author: Nigel McNie (oracle.shinoda@gmail.com) * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/) - * Release Version: 1.0.3 - * CVS Revision Version: $Revision: 47 $ + * Release Version: 1.0.7.8 + * CVS Revision Version: $Revision: 2968 $ * Date Started: 2004/06/20 - * Last Modified: $Date: 2005-09-05 17:53:16 -0500 (Mon, 05 Sep 2005) $ + * Last Modified: $Date: 2006/02/25 00:46:33 $ * * PHP language file for GeSHi. * @@ -32,7 +32,7 @@ * ************************************************************************************* * - * This file is part of GeSHi. + * This file is part of GeSHi. * * GeSHi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,8 +60,9 @@ 'KEYWORDS' => array( 1 => array( 'include', 'require', 'include_once', 'require_once', - 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', 'endif', 'switch', 'case', 'endswitch', - 'return', 'break' + 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', + 'endif', 'switch', 'case', 'endswitch', + 'return', 'break', 'continue' ), 2 => array( 'null', '__LINE__', '__FILE__', @@ -254,7 +255,8 @@ 'apache_setenv','apache_response_headers','apache_request_headers','apache_note','apache_lookup_uri','apache_get_version', 'apache_child_terminate','aggregation_info','aggregate_properties_by_regexp','aggregate_properties_by_list','aggregate_properties','aggregate_methods_by_regexp', 'aggregate_methods_by_list','aggregate_methods','aggregate','addslashes','addcslashes','acosh', - 'acos','abs','_','echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die' + 'acos','abs','_','echo', 'print', 'global', 'static', 'exit', 'array', 'empty', + 'eval', 'isset', 'unset', 'die', 'list' ) ), 'SYMBOLS' => array( diff -urN joomla-1.0.7/mambots/content/geshi/geshi/sql.php joomla-1.0.10/mambots/content/geshi/geshi/sql.php --- joomla-1.0.7/mambots/content/geshi/geshi/sql.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi/sql.php 2006-06-25 16:54:37.000000000 -0400 @@ -4,10 +4,10 @@ * ------- * Author: Nigel McNie (oracle.shinoda@gmail.com) * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter) - * Release Version: 1.0.3 - * CVS Revision Version: $Revision: 47 $ + * Release Version: 1.0.7.8 + * CVS Revision Version: $Revision: 2968 $ * Date Started: 2004/06/04 - * Last Modified: $Date: 2005-09-05 17:53:16 -0500 (Mon, 05 Sep 2005) $ + * Last Modified: $Date: 2006/02/25 00:46:33 $ * * SQL language file for GeSHi. * @@ -31,7 +31,7 @@ * ************************************************************************************* * - * This file is part of GeSHi. + * This file is part of GeSHi. * * GeSHi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,7 +52,7 @@ $language_data = array ( 'LANG_NAME' => 'SQL', 'COMMENT_SINGLE' => array(1 =>'--', 2 => '#'), - 'COMMENT_MULTI' => array(), + 'COMMENT_MULTI' => array('/*' => '*/'), 'CASE_KEYWORDS' => 1, 'QUOTEMARKS' => array("'", '"', '`'), 'ESCAPE_CHAR' => '\\', @@ -97,7 +97,8 @@ ), 'COMMENTS' => array( 1 => 'color: #808080; font-style: italic;', - 2 => 'color: #808080; font-style: italic;' + 2 => 'color: #808080; font-style: italic;', + 'MULTI' => 'color: #808080; font-style: italic;' ), 'ESCAPE_CHAR' => array( 0 => 'color: #000099; font-weight: bold;' diff -urN joomla-1.0.7/mambots/content/geshi/geshi/xml.php joomla-1.0.10/mambots/content/geshi/geshi/xml.php --- joomla-1.0.7/mambots/content/geshi/geshi/xml.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi/xml.php 2006-06-25 16:54:37.000000000 -0400 @@ -4,15 +4,17 @@ * ------- * Author: Nigel McNie (oracle.shinoda@gmail.com) * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/) - * Release Version: 1.0.1 - * CVS Revision Version: $Revision: 47 $ + * Release Version: 1.0.7.8 + * CVS Revision Version: $Revision: 2968 $ * Date Started: 2004/09/01 - * Last Modified: $Date: 2005-09-05 17:53:16 -0500 (Mon, 05 Sep 2005) $ + * Last Modified: $Date: 2006/03/23 07:31:32 $ * * XML language file for GeSHi. Based on the idea/file by Christian Weiske * * CHANGES * ------- + * 2005/12/28 (1.0.2) + * - Removed escape character for strings * 2004/11/27 (1.0.1) * - Added support for multiple object splitters * 2004/10/27 (1.0.0) @@ -24,7 +26,7 @@ * ************************************************************************************* * - * This file is part of GeSHi. + * This file is part of GeSHi. * * GeSHi is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -43,12 +45,12 @@ ************************************************************************************/ $language_data = array ( - 'LANG_NAME' => 'HTML', + 'LANG_NAME' => 'XML', 'COMMENT_SINGLE' => array(), 'COMMENT_MULTI' => array(''), 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, 'QUOTEMARKS' => array("'", '"'), - 'ESCAPE_CHAR' => '\\', + 'ESCAPE_CHAR' => '', 'KEYWORDS' => array( ), 'SYMBOLS' => array( @@ -105,14 +107,14 @@ GESHI_AFTER => '\\4' ), 1 => array( - GESHI_SEARCH => '(</?[a-z0-9]*(>)?)', + GESHI_SEARCH => '(<[/?|(\?xml)]?[a-z0-9_]*(\??>)?)', GESHI_REPLACE => '\\1', GESHI_MODIFIERS => 'i', GESHI_BEFORE => '', GESHI_AFTER => '' ), 2 => array( - GESHI_SEARCH => '((/)?>)', + GESHI_SEARCH => '(([/|\?])?>)', GESHI_REPLACE => '\\1', GESHI_MODIFIERS => 'i', GESHI_BEFORE => '', diff -urN joomla-1.0.7/mambots/content/geshi/geshi.php joomla-1.0.10/mambots/content/geshi/geshi.php --- joomla-1.0.7/mambots/content/geshi/geshi.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi/geshi.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,40 +1,36 @@ + * @copyright Copyright © 2004, 2005, Nigel McNie + * @license http://gnu.org/copyleft/gpl.html GNU GPL + * @version $Id: geshi.php 2968 2006-03-30 07:51:33Z stingrey $ * - ************************************************************************************/ - + */ // // GeSHi Constants @@ -43,151 +39,397 @@ // version // -// For the future (though this may never be realised) -define('GESHI_OUTPUT_HTML', 0); +/** The version of this GeSHi file */ +define('GESHI_VERSION', '1.0.7.8'); -// Shouldn't be used by your program -define('GESHI_COMMENTS', 0); +/** Set the correct directory separator */ +define('GESHI_DIR_SEPARATOR', ('WIN' != substr(PHP_OS, 0, 3)) ? '/' : '\\'); + +// Define the root directory for the GeSHi code tree +if (!defined('GESHI_ROOT')) { + /** The root directory for GeSHi */ + define('GESHI_ROOT', dirname(__FILE__) . GESHI_DIR_SEPARATOR); +} +/** The language file directory for GeSHi + @access private */ +define('GESHI_LANG_ROOT', GESHI_ROOT . 'geshi' . GESHI_DIR_SEPARATOR); -// Error detection - use these to analyse faults -define('GESHI_ERROR_NO_INPUT', 1); -define('GESHI_ERROR_NO_SUCH_LANG', 2); -// Human error messages - added in 1.0.2 -$_GESHI_ERRORS = array( - GESHI_ERROR_NO_INPUT => 'No source code inputted', - GESHI_ERROR_NO_SUCH_LANG => 'GeSHi could not find the language {LANGUAGE} (using path {PATH})' -); // Line numbers - use with enable_line_numbers() +/** Use no line numbers when building the result */ define('GESHI_NO_LINE_NUMBERS', 0); +/** Use normal line numbers when building the result */ define('GESHI_NORMAL_LINE_NUMBERS', 1); +/** Use fancy line numbers when building the result */ define('GESHI_FANCY_LINE_NUMBERS', 2); -// Strict mode - shouldn't be used by your scripts -define('GESHI_NEVER', 0); -define('GESHI_MAYBE', 1); -define('GESHI_ALWAYS', 2); - -// Container HTML type - use these (added in 1.0.1) +// Container HTML type +/** Use nothing to surround the source */ +define('GESHI_HEADER_NONE', 0); +/** Use a "div" to surround the source */ define('GESHI_HEADER_DIV', 1); +/** Use a "pre" to surround the source */ define('GESHI_HEADER_PRE', 2); -// Capatalisation constants - use these (added in 1.0.1) +// Capatalisation constants +/** Lowercase keywords found */ define('GESHI_CAPS_NO_CHANGE', 0); +/** Uppercase keywords found */ define('GESHI_CAPS_UPPER', 1); +/** Leave keywords found as the case that they are */ define('GESHI_CAPS_LOWER', 2); -// Link style constants - use these (added in 1.0.2) +// Link style constants +/** Links in the source in the :link state */ define('GESHI_LINK', 0); +/** Links in the source in the :hover state */ define('GESHI_HOVER', 1); +/** Links in the source in the :active state */ define('GESHI_ACTIVE', 2); +/** Links in the source in the :visited state */ define('GESHI_VISITED', 3); -// Important string starter/finisher - use these (added in 1.0.2). +// Important string starter/finisher // Note that if you change these, they should be as-is: i.e., don't // write them as if they had been run through htmlentities() +/** The starter for important parts of the source */ define('GESHI_START_IMPORTANT', ''); +/** The ender for important parts of the source */ define('GESHI_END_IMPORTANT', ''); -// Advanced regexp handling - don't use these (added in 1.0.2) +/**#@+ + * @access private + */ +// When strict mode applies for a language +/** Strict mode never applies (this is the most common) */ +define('GESHI_NEVER', 0); +/** Strict mode *might* apply, and can be enabled or + disabled by {@link GeSHi::enable_strict_mode()} */ +define('GESHI_MAYBE', 1); +/** Strict mode always applies */ +define('GESHI_ALWAYS', 2); + +// Advanced regexp handling constants, used in language files +/** The key of the regex array defining what to search for */ define('GESHI_SEARCH', 0); +/** The key of the regex array defining what bracket group in a + matched search to use as a replacement */ define('GESHI_REPLACE', 1); +/** The key of the regex array defining any modifiers to the regular expression */ define('GESHI_MODIFIERS', 2); +/** The key of the regex array defining what bracket group in a + matched search to put before the replacement */ define('GESHI_BEFORE', 3); +/** The key of the regex array defining what bracket group in a + matched search to put after the replacement */ define('GESHI_AFTER', 4); -// Begin Class GeSHi +/** Used in language files to mark comments */ +define('GESHI_COMMENTS', 0); + +// Error detection - use these to analyse faults +/** No sourcecode to highlight was specified + * @deprecated + */ +define('GESHI_ERROR_NO_INPUT', 1); +/** The language specified does not exist */ +define('GESHI_ERROR_NO_SUCH_LANG', 2); +/** GeSHi could not open a file for reading (generally a language file) */ +define('GESHI_ERROR_FILE_NOT_READABLE', 3); +/** The header type passed to {@link GeSHi::set_header_type()} was invalid */ +define('GESHI_ERROR_INVALID_HEADER_TYPE', 4); +/** The line number type passed to {@link GeSHi::enable_line_numbers()} was invalid */ +define('GESHI_ERROR_INVALID_LINE_NUMBER_TYPE', 5); +/**#@-*/ + + +/** + * The GeSHi Class. + * + * Please refer to the documentation for GeSHi 1.0.X that is available + * at http://qbnz.com/highlighter/documentation.php for more information + * about how to use this class. + * + * @package core + * @author Nigel McNie + * @copyright Copyright © 2004, 2005 Nigel McNie + */ class GeSHi { - // - // Data Fields - // - - // Basic fields - var $source = ''; // The source code to highlight - var $language = ''; // The language to use when highlighting - var $language_data = array(); // The data for the language used - var $language_path = 'geshi/'; // The path to the language files - var $error = false; // The error message associated with an error - var $strict_mode = false; // Whether highlighting is strict or not - var $use_classes = false; // Whether to use classes - var $header_type = GESHI_HEADER_PRE; // The type of header to use - var $lexic_permissions = array(); // Array of permissions for which lexics should be highlighted - // Added in 1.0.2 basic fields - var $time = 0; // The time it took to parse the code - var $header_content = ''; // The content of the header block - var $footer_content = ''; // The content of the footer block - var $header_content_style = ''; // The style of the header block - var $footer_content_style = ''; // The style of the footer block - var $link_styles = array(); // The styles for hyperlinks in the code - var $enable_important_blocks = true; // Whether important blocks should be recognised or not + /**#@+ + * @access private + */ + /** + * The source code to highlight + * @var string + */ + var $source = ''; + + /** + * The language to use when highlighting + * @var string + */ + var $language = ''; + + /** + * The data for the language used + * @var array + */ + var $language_data = array(); + + /** + * The path to the language files + * @var string + */ + var $language_path = GESHI_LANG_ROOT; + + /** + * The error message associated with an error + * @var string + * @todo check err reporting works + */ + var $error = false; + + /** + * Possible error messages + * @var array + */ + var $error_messages = array( + //GESHI_ERROR_NO_INPUT => 'No source code inputted', + GESHI_ERROR_NO_SUCH_LANG => 'GeSHi could not find the language {LANGUAGE} (using path {PATH})', + GESHI_ERROR_FILE_NOT_READABLE => 'The file specified for load_from_file was not readable', + GESHI_ERROR_INVALID_HEADER_TYPE => 'The header type specified is invalid', + GESHI_ERROR_INVALID_LINE_NUMBER_TYPE => 'The line number type specified is invalid' + ); + + /** + * Whether highlighting is strict or not + * @var boolean + */ + var $strict_mode = false; + + /** + * Whether to use CSS classes in output + * @var boolean + */ + var $use_classes = false; + + /** + * The type of header to use. Can be one of the following + * values: + * + *
      + *
    • GESHI_HEADER_PRE: Source is outputted in + * a <pre> HTML element.
    • + *
    • GESHI_HEADER_DIV: Source is outputted in + * a <div> HTML element.
    • + *
    • GESHI_HEADER_NONE: No header is outputted.
    • + *
    + * + * @var int + */ + var $header_type = GESHI_HEADER_PRE; + + /** + * Array of permissions for which lexics should be highlighted + * @var array + */ + var $lexic_permissions = array( + 'KEYWORDS' => array(), + 'COMMENTS' => array('MULTI' => true), + 'REGEXPS' => array(), + 'ESCAPE_CHAR' => true, + 'BRACKETS' => true, + 'SYMBOLS' => true, + 'STRINGS' => true, + 'NUMBERS' => true, + 'METHODS' => true, + 'SCRIPT' => true + ); + + /** + * The time it took to parse the code + * @var double + */ + var $time = 0; + + /** + * The content of the header block + * @var string + */ + var $header_content = ''; + + /** + * The content of the footer block + * @var string + */ + var $footer_content = ''; + + /** + * The style of the header block + * @var string + */ + var $header_content_style = ''; + + /** + * The style of the footer block + * @var string + */ + var $footer_content_style = ''; + + /** + * The styles for hyperlinks in the code + * @var array + */ + var $link_styles = array(); + + /** + * Whether important blocks should be recognised or not + * @var boolean + * @deprecated + * @todo REMOVE THIS FUNCTIONALITY! + */ + var $enable_important_blocks = false; + + /** + * Styles for important parts of the code + * @var string + * @deprecated + * @todo As above - rethink the whole idea of important blocks as it is buggy and + * will be hard to implement in 1.2 + */ var $important_styles = 'font-weight: bold; color: red;'; // Styles for important parts of the code - var $add_ids = false; // Whether css IDs should be added to the code - var $highlight_extra_lines = array(); // Lines that should be highlighted extra - var $highlight_extra_lines_style = 'color: #cc0; background-color: #ffc;';// Styles of extra-highlighted lines - var $line_numbers_start = 1; // Number at which line numbers should start at - - // Style fields - var $overall_style = ''; // The overall style for this code block - // The style for the actual code + + /** + * Whether CSS IDs should be added to the code + * @var boolean + */ + var $add_ids = false; + + /** + * Lines that should be highlighted extra + * @var array + */ + var $highlight_extra_lines = array(); + + /** + * Styles of extra-highlighted lines + * @var string + */ + var $highlight_extra_lines_style = 'color: #cc0; background-color: #ffc;'; + + /** + * Number at which line numbers should start at + * @var int + * @todo Warning documentation about XHTML compliance + */ + var $line_numbers_start = 1; + + /** + * The overall style for this code block + * @var string + */ + var $overall_style = ''; + + /** + * The style for the actual code + * @var string + */ var $code_style = 'font-family: \'Courier New\', Courier, monospace; font-weight: normal;'; - var $overall_class = ''; // The overall class for this code block - var $overall_id = ''; // The overall id for this code block - // Line number styles + + /** + * The overall class for this code block + * @var string + */ + var $overall_class = ''; + + /** + * The overall ID for this code block + * @var string + */ + var $overall_id = ''; + + /** + * Line number styles + * @var string + */ var $line_style1 = 'font-family: \'Courier New\', Courier, monospace; color: black; font-weight: normal; font-style: normal;'; + + /** + * Line number styles for fancy lines + * @var string + */ var $line_style2 = 'font-weight: bold;'; - var $line_numbers = GESHI_NO_LINE_NUMBERS; // Flag for how line numbers are displayed - var $line_nth_row = 0; // The "nth" value for fancy line highlighting - - // Misc - var $tab_width = 8; // A value for the size of tab stops. - var $max_tabs = 20; // Maximum number of spaces per tab - var $min_tabs = 0; // Minimum " " " " " - var $link_target = ''; // default target for keyword links - var $encoding = ''; // The encoding to use for htmlentities() calls - - // Deprecated/unused - var $output_format = GESHI_OUTPUT_HTML; + + /** + * Flag for how line nubmers are displayed + * @var boolean + */ + var $line_numbers = GESHI_NO_LINE_NUMBERS; + + /** + * The "nth" value for fancy line highlighting + * @var int + */ + var $line_nth_row = 0; + + /** + * The size of tab stops + * @var int + */ + var $tab_width = 8; + + /** + * Default target for keyword links + * @var string + */ + var $link_target = ''; + + /** + * The encoding to use for entity encoding + * @var string + */ + var $encoding = 'ISO-8859-1'; + /**#@-*/ /** - * constructor: GeSHi - * ------------------ * Creates a new GeSHi object, with source and language - */ - function GeSHi ($source, $language, $path = 'geshi/') - { - $this->source = $source; - // Security, just in case :) - $language = preg_replace('#[^a-zA-Z0-9\-\_]#', '', $language); - $this->language = strtolower($language); - $this->language_path = ( substr($path, strlen($path) - 1, 1) == '/' ) ? $path : $path . '/'; - $this->load_language(); + * + * @param string The source code to highlight + * @param string The language to highlight the source with + * @param string The path to the language file directory. This + * is deprecated! I've backported the auto path + * detection from the 1.1.X dev branch, so now it + * should be automatically set correctly. If you have + * renamed the language directory however, you will + * still need to set the path using this parameter or + * {@link GeSHi::set_language_path()} + * @since 1.0.0 + */ + function GeSHi ($source, $language, $path = '') + { + $this->set_source($source); + $this->set_language_path($path); + $this->set_language($language); } - - // - // Error methods - // - /** - * method: error - * ------------- * Returns an error message associated with the last GeSHi operation, * or false if no error has occured + * + * @return string|false An error message if there has been an error, else false + * @since 1.0.0 */ - function error() + function error () { - global $_GESHI_ERRORS; - if ( $this->error != 0 ) - { - $msg = $_GESHI_ERRORS[$this->error]; + if ($this->error) { + $msg = $this->error_messages[$this->error]; $debug_tpl_vars = array( '{LANGUAGE}' => $this->language, '{PATH}' => $this->language_path ); - foreach ( $debug_tpl_vars as $tpl => $var ) - { + foreach ($debug_tpl_vars as $tpl => $var) { $msg = str_replace($tpl, $var, $msg); } return "
    GeSHi Error: $msg (code $this->error)
    "; @@ -195,694 +437,760 @@ return false; } - - // - // Getters - // - /** - * get_language_name() - * --------------- * Gets a human-readable language name (thanks to Simon Patterson * for the idea :)) + * + * @return string The name for the current language + * @since 1.0.2 */ - function get_language_name() + function get_language_name () { - if ( $this->error == GESHI_ERROR_NO_SUCH_LANG ) - { + if (GESHI_ERROR_NO_SUCH_LANG == $this->_error) { return $this->language_data['LANG_NAME'] . ' (Unknown Language)'; } return $this->language_data['LANG_NAME']; } - - // - // Setters - // - /** - * method: set_source - * ------------------ * Sets the source code for this object + * + * @param string The source code to highlight + * @since 1.0.0 */ - function set_source ( $source ) + function set_source ($source) { $this->source = $source; } - /** - * method: set_language - * -------------------- * Sets the language for this object - */ - function set_language ( $language ) - { + * + * @param string The name of the language to use + * @since 1.0.0 + */ + function set_language ($language) + { + $this->error = false; + $this->strict_mode = GESHI_NEVER; + $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language); $this->language = strtolower($language); + + $file_name = $this->language_path . $this->language . '.php'; + if (!is_readable($file_name)) { + $this->error = GESHI_ERROR_NO_SUCH_LANG; + return; + } // Load the language for parsing - $this->load_language(); + $this->load_language($file_name); } - /** - * method: set_language_path - * ------------------------- - * Sets the path to the directory containing the language files. NOTE + * Sets the path to the directory containing the language files. Note * that this path is relative to the directory of the script that included * geshi.php, NOT geshi.php itself. - */ - function set_language_path ( $path ) - { - $this->language_path = ( substr($path, strlen($path) - 1, 1) == '/' ) ? $path : $path . '/'; + * + * @param string The path to the language directory + * @since 1.0.0 + * @deprecated The path to the language files should now be automatically + * detected, so this method should no longer be needed. The + * 1.1.X branch handles manual setting of the path differently + * so this method will disappear in 1.2.0. + */ + function set_language_path ($path) + { + if ($path) { + $this->language_path = ('/' == substr($path, strlen($path) - 1, 1)) ? $path : $path . '/'; + $this->set_language($this->language); // otherwise set_language_path has no effect + } } - /** - * method: set_header_type - * ----------------------- - * Sets the type of header to be used. If GESHI_HEADER_DIV is used, - * the code is surrounded in a
    . This means more source code but - * more control over tab width and line-wrapping. GESHI_HEADER_PRE - * means that a
     is used - less source, but less control. Default
    -	 * is GESHI_HEADER_PRE
    -	 */
    -	function set_header_type ( $type )
    -	{
    +	 * Sets the type of header to be used.
    +     * 
    +     * If GESHI_HEADER_DIV is used, the code is surrounded in a "div".This
    +     * means more source code but more control over tab width and line-wrapping.
    +     * GESHI_HEADER_PRE means that a "pre" is used - less source, but less
    +     * control. Default is GESHI_HEADER_PRE.
    +     * 
    +     * From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code
    +     * should be outputted.
    +     * 
    +     * @param int The type of header to be used
    +     * @since 1.0.0
    +	 */
    +	function set_header_type ($type)
    +	{
    +        if (GESHI_HEADER_DIV != $type && GESHI_HEADER_PRE != $type && GESHI_HEADER_NONE != $type) {
    +            $this->error = GESHI_ERROR_INVALID_HEADER_TYPE;
    +            return;
    +        }
     		$this->header_type = $type;
     	}
     
    -
     	/**
    -	 * method: set_overall_style
    -	 * -------------------------
     	 * Sets the styles for the code that will be outputted
     	 * when this object is parsed. The style should be a
     	 * string of valid stylesheet declarations
    +     * 
    +     * @param string  The overall style for the outputted code block
    +     * @param boolean Whether to merge the styles with the current styles or not
    +     * @since 1.0.0
     	 */
    -	function set_overall_style ( $style, $preserve_defaults = false )
    +	function set_overall_style ($style, $preserve_defaults = false)
     	{
    -		if ( $preserve_defaults )
    -		{
    -			$this->overall_style .= $style;
    -		}
    -		else
    -		{
    +		if (!$preserve_defaults) {
     			$this->overall_style = $style;
    +		} else {
    +			$this->overall_style .= $style;
     		}
     	}
     
    -
     	/**
    -	 * method: set_overall_class
    -	 * -------------------------
     	 * Sets the overall classname for this block of code. This
     	 * class can then be used in a stylesheet to style this object's
     	 * output
    +     * 
    +     * @param string The class name to use for this block of code
    +     * @since 1.0.0
     	 */
    -	function set_overall_class ( $class )
    +	function set_overall_class ($class)
     	{
     		$this->overall_class = $class;
     	}
     
    -
     	/**
    -	 * method: set_overall_id
    -	 * ----------------------
     	 * Sets the overall id for this block of code. This id can then
     	 * be used in a stylesheet to style this object's output
    +     * 
    +     * @param string The ID to use for this block of code
    +     * @since 1.0.0
     	 */
    -	function set_overall_id ( $id )
    +	function set_overall_id ($id)
     	{
     		$this->overall_id = $id;
     	}
     
    -
     	/**
    -	 * method: enable_classes
    -	 * ----------------------
    -	 * Sets whether CSS classes should be used to highlight the source. Default
    -	 * is off, calling this method with no arguments will turn it on
    -	 */
    -	function enable_classes ( $flag = true )
    +     * Sets whether CSS classes should be used to highlight the source. Default
    +     * is off, calling this method with no arguments will turn it on
    +     * 
    +     * @param boolean Whether to turn classes on or not
    +     * @since 1.0.0
    +     */
    +	function enable_classes ($flag = true)
     	{
    -		$this->use_classes = ( $flag ) ? true : false;
    +		$this->use_classes = ($flag) ? true : false;
     	}
     
    -
     	/**
    -	 * method: set_code_style
    -	 * ----------------------
     	 * Sets the style for the actual code. This should be a string
     	 * containing valid stylesheet declarations. If $preserve_defaults is
     	 * true, then styles are merged with the default styles, with the
     	 * user defined styles having priority
     	 *
    -	 * NOTE: Use this method to override any style changes you made to
    +	 * Note: Use this method to override any style changes you made to
     	 * the line numbers if you are using line numbers, else the line of
     	 * code will have the same style as the line number! Consult the
     	 * GeSHi documentation for more information about this.
    +     * 
    +     * @param string  The style to use for actual code
    +     * @param boolean Whether to merge the current styles with the new styles
    +	 */
    +	function set_code_style ($style, $preserve_defaults = false)
    +	{
    +        if (!$preserve_defaults) {
    +            $this->code_style = $style;
    +        } else {
    +            $this->code_style .= $style;
    +        }
    +    }
    +
    +	/**
    +	 * Sets the styles for the line numbers.
    +     * 
    +     * @param string The style for the line numbers that are "normal"
    +     * @param string|boolean If a string, this is the style of the line
    +     *        numbers that are "fancy", otherwise if boolean then this
    +     *        defines whether the normal styles should be merged with the
    +     *        new normal styles or not
    +     * @param boolean If set, is the flag for whether to merge the "fancy"
    +     *        styles with the current styles or not
    +     * @since 1.0.2
     	 */
    -	function set_code_style ( $style, $preserve_defaults )
    +	function set_line_style ($style1, $style2 = '', $preserve_defaults = false)
     	{
    -		if ( $preserve_defaults )
    -		{
    -			$this->code_style .= $style;
    -		}
    -		else
    -		{
    -			$this->code_style = $style;
    -		}
    -	}
    -
    -
    -	/**
    -	 * method: set_line_style
    -	 * ----------------------
    -	 * Sets the styles for the line numbers. This should be a string
    -	 * containing valid stylesheet declarations. If $preserve_defaults is
    -	 * true, then styles are merged with the default styles, with the
    -	 * user defined styles having priority
    -	 */
    -	function set_line_style ( $style1, $style2 = '', $preserve_defaults = false )
    -	{
    -		if ( is_bool($style2) )
    -		{
    +		if (is_bool($style2)) {
     			$preserve_defaults = $style2;
     			$style2 = '';
     		}
    -		if ( $preserve_defaults )
    -		{
    -			$this->line_style1 .= $style1;
    -			$this->line_style2 .= $style2;
    -		}
    -		else
    -		{
    +		if (!$preserve_defaults) {
     			$this->line_style1 = $style1;
     			$this->line_style2 = $style2;
    +		} else {
    +			$this->line_style1 .= $style1;
    +			$this->line_style2 .= $style2;
     		}
     	}
     
    -
     	/**
    -	 * method: enable_line_numbers
    -	 * ---------------------------
    -	 * Sets whether line numbers should be displayed. GESHI_NO_LINE_NUMBERS = not displayed,
    -	 * GESHI_NORMAL_LINE_NUMBERS = displayed, GESHI_FANCY_LINE_NUMBERS = every nth line a
    -	 * different class. Default is for no line numbers to be used
    -	 */
    -	function enable_line_numbers ( $flag, $nth_row = 5 )
    -	{
    +	 * Sets whether line numbers should be displayed.
    +     * 
    +     * Valid values for the first parameter are:
    +     * 
    +     * 
      + *
    • GESHI_NO_LINE_NUMBERS: Line numbers will not be displayed
    • + *
    • GESHI_NORMAL_LINE_NUMBERS: Line numbers will be displayed
    • + *
    • GESHI_FANCY_LINE_NUMBERS: Fancy line numbers will be displayed
    • + *
    + * + * For fancy line numbers, the second parameter is used to signal which lines + * are to be fancy. For example, if the value of this parameter is 5 then every + * 5th line will be fancy. + * + * @param int How line numbers should be displayed + * @param int Defines which lines are fancy + * @since 1.0.0 + */ + function enable_line_numbers ($flag, $nth_row = 5) + { + if (GESHI_NO_LINE_NUMBERS != $flag && GESHI_NORMAL_LINE_NUMBERS != $flag + && GESHI_FANCY_LINE_NUMBERS != $flag) { + $this->error = GESHI_ERROR_INVALID_LINE_NUMBER_TYPE; + } $this->line_numbers = $flag; $this->line_nth_row = $nth_row; } - /** - * method: set_keyword_group_style - * ------------------------------- * Sets the style for a keyword group. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority + * + * @param int The key of the keyword group to change the styles of + * @param string The style to make the keywords + * @param boolean Whether to merge the new styles with the old or just + * to overwrite them + * @since 1.0.0 */ - function set_keyword_group_style ( $key, $style, $preserve_defaults = false ) + function set_keyword_group_style ($key, $style, $preserve_defaults = false) { - if ( $preserve_defaults ) - { - $this->language_data['STYLES']['KEYWORDS'][$key] .= $style; - } - else - { + if (!$preserve_defaults) { $this->language_data['STYLES']['KEYWORDS'][$key] = $style; + } else { + $this->language_data['STYLES']['KEYWORDS'][$key] .= $style; } } - /** - * method: set_keyword_group_highlighting - * -------------------------------------- * Turns highlighting on/off for a keyword group + * + * @param int The key of the keyword group to turn on or off + * @param boolean Whether to turn highlighting for that group on or off + * @since 1.0.0 */ function set_keyword_group_highlighting ( $key, $flag = true ) { - $this->lexic_permissions['KEYWORDS'][$key] = ( $flag ) ? true : false; + $this->lexic_permissions['KEYWORDS'][$key] = ($flag) ? true : false; } - /** - * method: set_comments_style - * -------------------------- * Sets the styles for comment groups. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority + * + * @param int The key of the comment group to change the styles of + * @param string The style to make the comments + * @param boolean Whether to merge the new styles with the old or just + * to overwrite them + * @since 1.0.0 */ - function set_comments_style ( $key, $style, $preserve_defaults = false ) + function set_comments_style ($key, $style, $preserve_defaults = false) { - if ( $preserve_defaults ) - { - $this->language_data['STYLES']['COMMENTS'][$key] .= $style; - } - else - { + if (!$preserve_defaults) { $this->language_data['STYLES']['COMMENTS'][$key] = $style; + } else { + $this->language_data['STYLES']['COMMENTS'][$key] .= $style; } } - /** - * method: set_comments_highlighting - * --------------------------------- * Turns highlighting on/off for comment groups + * + * @param int The key of the comment group to turn on or off + * @param boolean Whether to turn highlighting for that group on or off + * @since 1.0.0 */ - function set_comments_highlighting ( $key, $flag = true ) + function set_comments_highlighting ($key, $flag = true) { - $this->lexic_permissions['COMMENTS'][$key] = ( $flag ) ? true : false; + $this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false; } - /** - * method: set_escape_characters_style - * ----------------------------------- * Sets the styles for escaped characters. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority + * + * @param string The style to make the escape characters + * @param boolean Whether to merge the new styles with the old or just + * to overwrite them + * @since 1.0.0 */ - function set_escape_characters_style ( $style, $preserve_defaults = false ) + function set_escape_characters_style ($style, $preserve_defaults = false) { - if ( $preserve_defaults ) - { - $this->language_data['STYLES']['ESCAPE_CHAR'][0] .= $style; - } - else - { + if (!$preserve_defaults) { $this->language_data['STYLES']['ESCAPE_CHAR'][0] = $style; + } else { + $this->language_data['STYLES']['ESCAPE_CHAR'][0] .= $style; } } - /** - * method: set_escape_characters_highlighting - * ------------------------------------------ * Turns highlighting on/off for escaped characters + * + * @param boolean Whether to turn highlighting for escape characters on or off + * @since 1.0.0 */ - function set_escape_characters_highlighting ( $flag = true ) + function set_escape_characters_highlighting ($flag = true) { - $this->lexic_permissions['ESCAPE_CHAR'] = ( $flag ) ? true : false; + $this->lexic_permissions['ESCAPE_CHAR'] = ($flag) ? true : false; } - /** - * method: set_brackets_style - * -------------------------- * Sets the styles for brackets. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority * * This method is DEPRECATED: use set_symbols_style instead. * This method will be removed in 1.2.X + * + * @param string The style to make the brackets + * @param boolean Whether to merge the new styles with the old or just + * to overwrite them + * @since 1.0.0 + * @deprecated In favour of set_symbols_style */ - function set_brackets_style ( $style, $preserve_defaults = false ) + function set_brackets_style ($style, $preserve_defaults = false) { - if ( $preserve_defaults ) - { - $this->language_data['STYLES']['BRACKETS'][0] .= $style; - } - else - { + if (!$preserve_defaults) { $this->language_data['STYLES']['BRACKETS'][0] = $style; + } else { + $this->language_data['STYLES']['BRACKETS'][0] .= $style; } } - /** - * method: set_brackets_highlighting - * --------------------------------- * Turns highlighting on/off for brackets * * This method is DEPRECATED: use set_symbols_highlighting instead. * This method will be remove in 1.2.X + * + * @param boolean Whether to turn highlighting for brackets on or off + * @since 1.0.0 + * @deprecated In favour of set_symbols_highlighting */ - function set_brackets_highlighting ( $flag ) + function set_brackets_highlighting ($flag) { - $this->lexic_permissions['BRACKETS'] = ( $flag ) ? true : false; + $this->lexic_permissions['BRACKETS'] = ($flag) ? true : false; } - /** - * method: set_symbols_style - * -------------------------- * Sets the styles for symbols. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority + * + * @param string The style to make the symbols + * @param boolean Whether to merge the new styles with the old or just + * to overwrite them + * @since 1.0.1 */ - function set_symbols_style ( $style, $preserve_defaults = false ) + function set_symbols_style ($style, $preserve_defaults = false) { - if ( $preserve_defaults ) - { - $this->language_data['STYLES']['SYMBOLS'][0] .= $style; - } - else - { + if (!$preserve_defaults) { $this->language_data['STYLES']['SYMBOLS'][0] = $style; + } else { + $this->language_data['STYLES']['SYMBOLS'][0] .= $style; } // For backward compatibility - $this->set_brackets_style ( $style, $preserve_defaults ); + $this->set_brackets_style ($style, $preserve_defaults); } - /** - * method: set_symbols_highlighting - * --------------------------------- * Turns highlighting on/off for symbols + * + * @param boolean Whether to turn highlighting for symbols on or off + * @since 1.0.0 */ - function set_symbols_highlighting ( $flag ) + function set_symbols_highlighting ($flag) { - $this->lexic_permissions['SYMBOLS'] = ( $flag ) ? true : false; + $this->lexic_permissions['SYMBOLS'] = ($flag) ? true : false; // For backward compatibility - $this->set_brackets_highlighting ( $flag ); + $this->set_brackets_highlighting ($flag); } - /** - * method: set_strings_style - * ------------------------- * Sets the styles for strings. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority + * + * @param string The style to make the escape characters + * @param boolean Whether to merge the new styles with the old or just + * to overwrite them + * @since 1.0.0 */ - function set_strings_style ( $style, $preserve_defaults = false ) + function set_strings_style ($style, $preserve_defaults = false) { - if ( $preserve_defaults ) - { - $this->language_data['STYLES']['STRINGS'][0] .= $style; - } - else - { + if (!$preserve_defaults) { $this->language_data['STYLES']['STRINGS'][0] = $style; + } else { + $this->language_data['STYLES']['STRINGS'][0] .= $style; } } - /** - * method: set_strings_highlighting - * -------------------------------- * Turns highlighting on/off for strings + * + * @param boolean Whether to turn highlighting for strings on or off + * @since 1.0.0 */ - function set_strings_highlighting ( $flag ) + function set_strings_highlighting ($flag) { - $this->lexic_permissions['STRINGS'] = ( $flag ) ? true : false; + $this->lexic_permissions['STRINGS'] = ($flag) ? true : false; } - /** - * method: set_numbers_style - * ------------------------- * Sets the styles for numbers. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority + * + * @param string The style to make the numbers + * @param boolean Whether to merge the new styles with the old or just + * to overwrite them + * @since 1.0.0 */ - function set_numbers_style ( $style, $preserve_defaults = false ) + function set_numbers_style ($style, $preserve_defaults = false) { - if ( $preserve_defaults ) - { - $this->language_data['STYLES']['NUMBERS'][0] .= $style; - } - else - { + if (!$preserve_defaults) { $this->language_data['STYLES']['NUMBERS'][0] = $style; + } else { + $this->language_data['STYLES']['NUMBERS'][0] .= $style; } } - /** - * method: set_numbers_highlighting - * -------------------------------- * Turns highlighting on/off for numbers + * + * @param boolean Whether to turn highlighting for numbers on or off + * @since 1.0.0 */ - function set_numbers_highlighting ( $flag ) + function set_numbers_highlighting ($flag) { - $this->lexic_permissions['NUMBERS'] = ( $flag ) ? true : false; + $this->lexic_permissions['NUMBERS'] = ($flag) ? true : false; } - /** - * method: set_methods_style - * ------------------------- * Sets the styles for methods. $key is a number that references the * appropriate "object splitter" - see the language file for the language * you are highlighting to get this number. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority + * + * @param int The key of the object splitter to change the styles of + * @param string The style to make the methods + * @param boolean Whether to merge the new styles with the old or just + * to overwrite them + * @since 1.0.0 */ - function set_methods_style ( $key, $style, $preserve_defaults = false ) + function set_methods_style ($key, $style, $preserve_defaults = false) { - if ( $preserve_defaults ) - { - $this->language_data['STYLES']['METHODS'][$key] .= $style; - } - else - { + if (!$preserve_defaults) { $this->language_data['STYLES']['METHODS'][$key] = $style; + } else { + $this->language_data['STYLES']['METHODS'][$key] .= $style; } } - /** - * method: set_methods_highlighting - * -------------------------------- * Turns highlighting on/off for methods + * + * @param boolean Whether to turn highlighting for methods on or off + * @since 1.0.0 */ - function set_methods_highlighting ( $flag ) + function set_methods_highlighting ($flag) { - $this->lexic_permissions['METHODS'] = ( $flag ) ? true : false; + $this->lexic_permissions['METHODS'] = ($flag) ? true : false; } - /** - * method: set_regexps_style - * ------------------------- * Sets the styles for regexps. If $preserve_defaults is * true, then styles are merged with the default styles, with the * user defined styles having priority + * + * @param string The style to make the regular expression matches + * @param boolean Whether to merge the new styles with the old or just + * to overwrite them + * @since 1.0.0 */ - function set_regexps_style ( $key, $style, $preserve_defaults = false ) + function set_regexps_style ($key, $style, $preserve_defaults = false) { - if ( $preserve_defaults ) - { - $this->language_data['STYLES']['REGEXPS'][$key] .= $style; - } - else - { + if (!$preserve_defaults) { $this->language_data['STYLES']['REGEXPS'][$key] = $style; + } else { + $this->language_data['STYLES']['REGEXPS'][$key] .= $style; } } - /** - * method: set_regexps_highlighting - * -------------------------------- * Turns highlighting on/off for regexps + * + * @param int The key of the regular expression group to turn on or off + * @param boolean Whether to turn highlighting for the regular expression group on or off + * @since 1.0.0 */ - function set_regexps_highlighting ( $key, $flag ) + function set_regexps_highlighting ($key, $flag) { - $this->lexic_permissions['REGEXPS'][$key] = ( $flag ) ? true : false; + $this->lexic_permissions['REGEXPS'][$key] = ($flag) ? true : false; } - /** - * method: set_case_sensitivity - * ---------------------------- * Sets whether a set of keywords are checked for in a case sensitive manner + * + * @param int The key of the keyword group to change the case sensitivity of + * @param boolean Whether to check in a case sensitive manner or not + * @since 1.0.0 */ - function set_case_sensitivity ( $key, $case ) + function set_case_sensitivity ($key, $case) { - $this->language_data['CASE_SENSITIVE'][$key] = ( $case ) ? true : false; + $this->language_data['CASE_SENSITIVE'][$key] = ($case) ? true : false; } - /** - * method: set_case_keywords - * ------------------------- * Sets the case that keywords should use when found. Use the constants: - * GESHI_CAPS_NO_CHANGE: leave keywords as-is - * GESHI_CAPS_UPPER: convert all keywords to uppercase where found - * GESHI_CAPS_LOWER: convert all keywords to lowercase where found - * Method added in 1.0.1 + * + *
      + *
    • GESHI_CAPS_NO_CHANGE: leave keywords as-is
    • + *
    • GESHI_CAPS_UPPER: convert all keywords to uppercase where found
    • + *
    • GESHI_CAPS_LOWER: convert all keywords to lowercase where found
    • + *
    + * + * @param int A constant specifying what to do with matched keywords + * @since 1.0.1 + * @todo Error check the passed value */ - function set_case_keywords ( $case ) + function set_case_keywords ($case) { $this->language_data['CASE_KEYWORDS'] = $case; } - /** - * method: set_tab_width - * --------------------- * Sets how many spaces a tab is substituted for - * This method will probably be re-engineered later to allow customisability - * in the maximum and minimum number of tabs without mutulating data fields. + * + * Widths below zero are ignored + * + * @param int The tab width + * @since 1.0.0 */ - function set_tab_width ( $width ) + function set_tab_width ($width) { - if ( $width > $this->max_tabs ) $width = $this->max_tabs; - if ( $width < $this->min_tabs ) $width = $this->min_tabs; - $this->tab_width = $width; + $this->tab_width = intval($width); } - /** - * method: enable_strict_mode - * -------------------------- * Enables/disables strict highlighting. Default is off, calling this * method without parameters will turn it on. See documentation - * for more details on strict mode and where to use it - */ - function enable_strict_mode ( $mode = true ) - { - $this->strict_mode = ( $mode ) ? true : false; - // Turn on strict mode no matter what if language should always - // be in strict mode - if ( $this->language_data['STRICT_MODE_APPLIES'] == GESHI_ALWAYS ) - { - $this->strict_mode = true; - } - // Turn off strict mode no matter what if language should never - // be in strict mode - elseif ( $this->language_data['STRICT_MODE_APPLIES'] == GESHI_NEVER ) - { - $this->strict_mode = false; - } + * for more details on strict mode and where to use it. + * + * @param boolean Whether to enable strict mode or not + * @since 1.0.0 + */ + function enable_strict_mode ($mode = true) + { + if (GESHI_MAYBE == $this->language_data['STRICT_MODE_APPLIES']) { + $this->strict_mode = ($mode) ? true : false; + } } - /** - * method: disable_highlighting - * ---------------------------- * Disables all highlighting + * + * @since 1.0.0 + * @todo Rewrite with an array traversal */ function disable_highlighting () { - foreach ( $this->language_data['KEYWORDS'] as $key => $words ) - { - $this->lexic_permissions['KEYWORDS'][$key] = false; - } - foreach ( $this->language_data['COMMENT_SINGLE'] as $key => $comment ) - { - $this->lexic_permissions['COMMENTS'][$key] = false; - } - // Multiline comments - $this->lexic_permissions['COMMENTS']['MULTI'] = false; - // Escape characters - $this->lexic_permissions['ESCAPE_CHAR'] = false; - // Brackets - $this->lexic_permissions['BRACKETS'] = false; - // Strings - $this->lexic_permissions['STRINGS'] = false; - // Numbers - $this->lexic_permissions['NUMBERS'] = false; - // Methods - $this->lexic_permissions['METHODS'] = false; - // Symbols - $this->lexic_permissions['SYMBOLS'] = false; - // Script - $this->lexic_permissions['SCRIPT'] = false; - // Regexps - foreach ( $this->language_data['REGEXPS'] as $key => $regexp ) - { - $this->lexic_permissions['REGEXPS'][$key] = false; - } + foreach ($this->lexic_permissions as $key => $value) { + if (is_array($value)) { + foreach ($value as $k => $v) { + $this->lexic_permissions[$key][$k] = false; + } + } else { + $this->lexic_permissions[$key] = false; + } + } // Context blocks $this->enable_important_blocks = false; } - /** - * method: enable_highlighting - * --------------------------- * Enables all highlighting + * + * @since 1.0.0 + * @todo Rewrite with array traversal */ function enable_highlighting () { - foreach ( $this->language_data['KEYWORDS'] as $key => $words ) - { - $this->lexic_permissions['KEYWORDS'][$key] = true; - } - foreach ( $this->language_data['COMMENT_SINGLE'] as $key => $comment ) - { - $this->lexic_permissions['COMMENTS'][$key] = true; - } - // Multiline comments - $this->lexic_permissions['COMMENTS']['MULTI'] = true; - // Escape characters - $this->lexic_permissions['ESCAPE_CHAR'] = true; - // Brackets - $this->lexic_permissions['BRACKETS'] = true; - // Strings - $this->lexic_permissions['STRINGS'] = true; - // Numbers - $this->lexic_permissions['NUMBERS'] = true; - // Methods - $this->lexic_permissions['METHODS'] = true; - // Symbols - $this->lexic_permissions['SYMBOLS'] = true; - // Script - $this->lexic_permissions['SCRIPT'] = true; - // Regexps - foreach ( $this->language_data['REGEXPS'] as $key => $regexp ) - { - $this->lexic_permissions['REGEXPS'][$key] = true; - } + foreach ($this->lexic_permissions as $key => $value) { + if (is_array($value)) { + foreach ($value as $k => $v) { + $this->lexic_permissions[$key][$k] = true; + } + } else { + $this->lexic_permissions[$key] = true; + } + } // Context blocks $this->enable_important_blocks = true; } + /** + * Given a file extension, this method returns either a valid geshi language + * name, or the empty string if it couldn't be found + * + * @param string The extension to get a language name for + * @param array A lookup array to use instead of the default + * @since 1.0.5 + * @todo Re-think about how this method works (maybe make it private and/or make it + * a extension->lang lookup?) + * @todo static? + */ + function get_language_name_from_extension ( $extension, $lookup = array() ) + { + if ( !$lookup ) + { + $lookup = array( + 'actionscript' => array('as'), + 'ada' => array('a', 'ada', 'adb', 'ads'), + 'apache' => array('conf'), + 'asm' => array('ash', 'asm'), + 'asp' => array('asp'), + 'bash' => array('sh'), + 'c' => array('c'), + 'c_mac' => array('c'), + 'caddcl' => array(), + 'cadlisp' => array(), + 'cpp' => array('cpp'), + 'csharp' => array(), + 'css' => array('css'), + 'delphi' => array('dpk', 'dpr'), + 'html4strict' => array('html', 'htm'), + 'java' => array('java'), + 'javascript' => array('js'), + 'lisp' => array('lisp'), + 'lua' => array('lua'), + 'mpasm' => array(), + 'nsis' => array(), + 'objc' => array(), + 'oobas' => array(), + 'oracle8' => array(), + 'pascal' => array('pas'), + 'perl' => array('pl', 'pm'), + 'php' => array('php', 'php5', 'phtml', 'phps'), + 'python' => array('py'), + 'qbasic' => array('bi'), + 'smarty' => array(), + 'vb' => array('bas'), + 'vbnet' => array(), + 'visualfoxpro' => array(), + 'xml' => array('xml') + ); + } + + foreach ($lookup as $lang => $extensions) { + foreach ($extensions as $ext) { + if ($ext == $extension) { + return $lang; + } + } + } + return ''; + } + + /** + * Given a file name, this method loads its contents in, and attempts + * to set the language automatically. An optional lookup table can be + * passed for looking up the language name. If not specified a default + * table is used + * + * The language table is in the form + *
    array(
    +	 *   'lang_name' => array('extension', 'extension', ...),
    +	 *   'lang_name' ...
    +	 * );
    + * + * @todo Complete rethink of this and above method + * @since 1.0.5 + */ + function load_from_file ($file_name, $lookup = array()) + { + if (is_readable($file_name)) { + $this->set_source(implode('', file($file_name))); + $this->set_language($this->get_language_name_from_extension(substr(strrchr($file_name, '.'), 1), $lookup)); + } else { + $this->error = GESHI_ERROR_FILE_NOT_READABLE; + } + } /** - * method: add_keyword - * ------------------- * Adds a keyword to a keyword group for highlighting + * + * @param int The key of the keyword group to add the keyword to + * @param string The word to add to the keyword group + * @since 1.0.0 */ - function add_keyword( $key, $word ) + function add_keyword ($key, $word) { $this->language_data['KEYWORDS'][$key][] = $word; } - /** - * method: remove_keyword - * ---------------------- * Removes a keyword from a keyword group + * + * @param int The key of the keyword group to remove the keyword from + * @param string The word to remove from the keyword group + * @since 1.0.0 */ - function remove_keyword ( $key, $word ) + function remove_keyword ($key, $word) { - $this->language_data['KEYWORDS'][$key] = array_diff($this->language_data['KEYWORDS'][$key], array($word)); + $this->language_data['KEYWORDS'][$key] = + array_diff($this->language_data['KEYWORDS'][$key], array($word)); } - /** - * method: add_keyword_group - * ------------------------- * Creates a new keyword group + * + * @param int The key of the keyword group to create + * @param string The styles for the keyword group + * @param boolean Whether the keyword group is case sensitive ornot + * @param array The words to use for the keyword group + * @since 1.0.0 */ function add_keyword_group ( $key, $styles, $case_sensitive = true, $words = array() ) { - if ( !is_array($words) ) - { - $words = array($words); - } + $words = (array) $words; $this->language_data['KEYWORDS'][$key] = $words; $this->lexic_permissions['KEYWORDS'][$key] = true; $this->language_data['CASE_SENSITIVE'][$key] = $case_sensitive; $this->language_data['STYLES']['KEYWORDS'][$key] = $styles; } - /** - * method: remove_keyword_group - * ---------------------------- * Removes a keyword group + * + * @param int The key of the keyword group to remove + * @since 1.0.0 */ - function remove_keyword_group ( $key ) + function remove_keyword_group ($key) { unset($this->language_data['KEYWORDS'][$key]); unset($this->lexic_permissions['KEYWORDS'][$key]); @@ -890,209 +1198,210 @@ unset($this->language_data['STYLES']['KEYWORDS'][$key]); } - /** - * method: set_header_content - * -------------------------- * Sets the content of the header block + * + * @param string The content of the header block + * @since 1.0.2 */ - function set_header_content ( $content ) + function set_header_content ($content) { $this->header_content = $content; } - /** - * method: set_footer_content - * -------------------------- * Sets the content of the footer block + * + * @param string The content of the footer block + * @since 1.0.2 */ - function set_footer_content ( $content ) + function set_footer_content ($content) { $this->footer_content = $content; } - /** - * method: set_header_content_style - * -------------------------------- * Sets the style for the header content + * + * @param string The style for the header content + * @since 1.0.2 */ - function set_header_content_style ( $style ) + function set_header_content_style ($style) { $this->header_content_style = $style; } - /** - * method: set_footer_content_style - * -------------------------------- * Sets the style for the footer content + * + * @param string The style for the footer content + * @since 1.0.2 */ - function set_footer_content_style ( $style ) + function set_footer_content_style ($style) { $this->footer_content_style = $style; } - /** - * method: set_url_for_keyword_group - * --------------------------------- * Sets the base URL to be used for keywords + * + * @param int The key of the keyword group to set the URL for + * @param string The URL to set for the group. If {FNAME} is in + * the url somewhere, it is replaced by the keyword + * that the URL is being made for + * @since 1.0.2 */ - function set_url_for_keyword_group ( $group, $url ) + function set_url_for_keyword_group ($group, $url) { $this->language_data['URLS'][$group] = $url; } - /** - * method: set_link_styles - * ----------------------- * Sets styles for links in code + * + * @param int A constant that specifies what state the style is being + * set for - e.g. :hover or :visited + * @param string The styles to use for that state + * @since 1.0.2 */ - function set_link_styles ( $type, $styles ) + function set_link_styles ($type, $styles) { $this->link_styles[$type] = $styles; } - /** - * method: set_link_target - * ----------------------- - * Sets the target for links in code - */ + * Sets the target for links in code + * + * @param string The target for links in the code, e.g. _blank + * @since 1.0.3 + */ function set_link_target ( $target ) { - if ( empty( $target ) ) - { + if (!$target) { $this->link_target = ''; - } - else - { + } else { $this->link_target = ' target="' . $target . '" '; } } - /** - * method: set_important_styles - * ---------------------------- * Sets styles for important parts of the code + * + * @param string The styles to use on important parts of the code + * @since 1.0.2 */ - function set_important_styles ( $styles ) + function set_important_styles ($styles) { $this->important_styles = $styles; } - /** - * method: enable_important_blocks - * ------------------------------- * Sets whether context-important blocks are highlighted + * + * @todo REMOVE THIS SHIZ FROM GESHI! + * @deprecated */ function enable_important_blocks ( $flag ) { $this->enable_important_blocks = ( $flag ) ? true : false; } - /** - * method: enable_ids - * ------------------ * Whether CSS IDs should be added to each line + * + * @param boolean If true, IDs will be added to each line. + * @since 1.0.2 */ - function enable_ids ( $flag = true ) + function enable_ids ($flag = true) { - $this->add_ids = ( $flag ) ? true : false; + $this->add_ids = ($flag) ? true : false; } - /** - * method: highlight_lines_extra - * ----------------------------- * Specifies which lines to highlight extra + * + * @param mixed An array of line numbers to highlight, or just a line + * number on its own. + * @since 1.0.2 + * @todo Some data replication here that could be cut down on */ - function highlight_lines_extra ( $lines ) + function highlight_lines_extra ($lines) { - if ( is_array($lines) ) - { - foreach ( $lines as $line ) - { + if (is_array($lines)) { + foreach ($lines as $line) { $this->highlight_extra_lines[intval($line)] = intval($line); } - } - else - { + } else { $this->highlight_extra_lines[intval($lines)] = intval($lines); } } - /** - * method: set_highlight_lines_extra_style - * --------------------------------------- * Sets the style for extra-highlighted lines + * + * @param string The style for extra-highlighted lines + * @since 1.0.2 */ - function set_highlight_lines_extra_style ( $styles ) + function set_highlight_lines_extra_style ($styles) { $this->highlight_extra_lines_style = $styles; } - /** - * method: start_line_numbers_at - * ----------------------------- * Sets what number line numbers should start at. Should * be a positive integer, and will be converted to one. + * + * Warning: Using this method will add the "start" + * attribute to the <ol> that is used for line numbering. + * This is not valid XHTML strict, so if that's what you + * care about then don't use this method. Firefox is getting + * support for the CSS method of doing this in 1.1 and Opera + * has support for the CSS method, but (of course) IE doesn't + * so it's not worth doing it the CSS way yet. + * + * @param int The number to start line numbers at + * @since 1.0.2 */ - function start_line_numbers_at ( $number ) + function start_line_numbers_at ($number) { $this->line_numbers_start = abs(intval($number)); } - /** - * method: set_encoding - * -------------------- - * Sets the encoding used for htmlentities(), for international + * Sets the encoding used for htmlspecialchars(), for international * support. - */ - function set_encoding ( $encoding ) - { - $this->encoding = $encoding; + * + * @param string The encoding to use for the source + * @since 1.0.3 + */ + function set_encoding ($encoding) + { + if ($encoding) { + $this->encoding = $encoding; + } } - /** - * method: parse_code() - * -------------------- * Returns the code in $this->source, highlighted and surrounded by the - * nessecary HTML. This should only be called ONCE, cos it's SLOW! - * If you want to highlight the same source multiple times, you're better - * off doing a whole lot of str_replaces to replace the s + * nessecary HTML. + * + * This should only be called ONCE, cos it's SLOW! If you want to highlight + * the same source multiple times, you're better off doing a whole lot of + * str_replaces to replace the <span>s + * + * @since 1.0.0 */ - function parse_code() + function parse_code () { // Start the timer $start_time = microtime(); // Firstly, if there is an error, we won't highlight - // FUTURE: maybe an option to try to force highlighting anyway? - if ( $this->error ) - { - $result = $this->header(); - if ( $this->header_type != GESHI_HEADER_PRE ) - { - $result .= $this->indent(htmlentities($this->source, ENT_COMPAT, $this->encoding)); - } - else - { - $result .= htmlentities($this->source, ENT_COMPAT, $this->encoding); - } - // Stop Timing - $this->set_time($start_time, microtime()); - return $result . $this->footer(); + if ($this->error) { + $result = @htmlspecialchars($this->source, ENT_COMPAT, $this->encoding); + // Timing is irrelevant + $this->set_time($start_time, $start_time); + return $this->finalise($result); } // Add spaces for regular expression matching and line numbers @@ -1102,67 +1411,55 @@ $code = str_replace("\r", "\n", $code); // Initialise various stuff - $length = strlen($code); - $STRING_OPEN = ''; - $CLOSE_STRING = false; + $length = strlen($code); + $STRING_OPEN = ''; + $CLOSE_STRING = false; $ESCAPE_CHAR_OPEN = false; - $COMMENT_MATCHED = false; + $COMMENT_MATCHED = false; // Turn highlighting on if strict mode doesn't apply to this language - $HIGHLIGHTING_ON = ( !$this->strict_mode ) ? true : ''; + $HIGHLIGHTING_ON = ( !$this->strict_mode ) ? true : ''; // Whether to highlight inside a block of code $HIGHLIGHT_INSIDE_STRICT = false; - $stuff_to_parse = ''; - $result = ''; + $HARDQUOTE_OPEN = false; + $stuff_to_parse = ''; + $result = ''; // "Important" selections are handled like multiline comments - if ( $this->enable_important_blocks ) - { + // @todo GET RID OF THIS SHIZ + if ($this->enable_important_blocks) { $this->language_data['COMMENT_MULTI'][GESHI_START_IMPORTANT] = GESHI_END_IMPORTANT; } - - if ( $this->strict_mode ) - { + if ($this->strict_mode) { // Break the source into bits. Each bit will be a portion of the code // within script delimiters - for example, HTML between < and > $parts = array(0 => array(0 => '')); $k = 0; - for ( $i = 0; $i < $length; $i++ ) - { + for ($i = 0; $i < $length; $i++) { $char = substr($code, $i, 1); - if ( !$HIGHLIGHTING_ON ) - { - foreach ( $this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters ) - { - foreach ( $delimiters as $open => $close ) - { + if (!$HIGHLIGHTING_ON) { + foreach ($this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters) { + foreach ($delimiters as $open => $close) { // Get the next little bit for this opening string $check = substr($code, $i, strlen($open)); // If it matches... - if ( $check == $open ) - { + if ($check == $open) { // We start a new block with the highlightable // code in it $HIGHLIGHTING_ON = $open; $i += strlen($open) - 1; - ++$k; $char = $open; - $parts[$k][0] = $char; + $parts[++$k][0] = $char; // No point going around again... break(2); } } } - } - else - { - foreach ( $this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters ) - { - foreach ( $delimiters as $open => $close ) - { - if ( $open == $HIGHLIGHTING_ON ) - { + } else { + foreach ($this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters) { + foreach ($delimiters as $open => $close) { + if ($open == $HIGHLIGHTING_ON) { // Found the closing tag break(2); } @@ -1171,22 +1468,18 @@ // We check code from our current position BACKWARDS. This is so // the ending string for highlighting can be included in the block $check = substr($code, $i - strlen($close) + 1, strlen($close)); - if ( $check == $close ) - { + if ($check == $close) { $HIGHLIGHTING_ON = ''; // Add the string to the rest of the string for this part $parts[$k][1] = ( isset($parts[$k][1]) ) ? $parts[$k][1] . $char : $char; - ++$k; - $parts[$k][0] = ''; + $parts[++$k][0] = ''; $char = ''; } } $parts[$k][1] = ( isset($parts[$k][1]) ) ? $parts[$k][1] . $char : $char; } $HIGHLIGHTING_ON = ''; - } - else - { + } else { // Not strict mode - simply dump the source into // the array at index 1 (the first highlightable block) $parts = array( @@ -1200,324 +1493,314 @@ // Now we go through each part. We know that even-indexed parts are // code that shouldn't be highlighted, and odd-indexed parts should // be highlighted - foreach ( $parts as $key => $data ) - { + foreach ($parts as $key => $data) { $part = $data[1]; // If this block should be highlighted... - if ( $key % 2 ) - { - if ( $this->strict_mode ) - { + if ($key % 2) { + if ($this->strict_mode) { // Find the class key for this block of code - foreach ( $this->language_data['SCRIPT_DELIMITERS'] as $script_key => $script_data ) - { - foreach ( $script_data as $open => $close ) - { - if ( $data[0] == $open ) - { + foreach ($this->language_data['SCRIPT_DELIMITERS'] as $script_key => $script_data) { + foreach ($script_data as $open => $close) { + if ($data[0] == $open) { break(2); } } } - if ( $this->language_data['STYLES']['SCRIPT'][$script_key] != '' && $this->lexic_permissions['SCRIPT'] ) - { + if ($this->language_data['STYLES']['SCRIPT'][$script_key] != '' && + $this->lexic_permissions['SCRIPT']) { // Add a span element around the source to // highlight the overall source block - if ( !$this->use_classes && $this->language_data['STYLES']['SCRIPT'][$script_key] != '' ) - { + if (!$this->use_classes && + $this->language_data['STYLES']['SCRIPT'][$script_key] != '') { $attributes = ' style="' . $this->language_data['STYLES']['SCRIPT'][$script_key] . '"'; - } - else - { + } else { $attributes = ' class="sc' . $script_key . '"'; } $result .= ""; } } - if ( !$this->strict_mode || $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key] ) - { + if (!$this->strict_mode || $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key]) { // Now, highlight the code in this block. This code // is really the engine of GeSHi (along with the method // parse_non_string_part). $length = strlen($part); - for ( $i = 0; $i < $length; $i++ ) - { + for ($i = 0; $i < $length; $i++) { // Get the next char $char = substr($part, $i, 1); + $hq = isset($this->language_data['HARDQUOTE']) ? $this->language_data['HARDQUOTE'][0] : false; // Is this char the newline and line numbers being used? - if ( ($this->line_numbers != GESHI_NO_LINE_NUMBERS || count($this->highlight_extra_lines) > 0) && $char == "\n" ) - { + if (($this->line_numbers != GESHI_NO_LINE_NUMBERS + || count($this->highlight_extra_lines) > 0) + && $char == "\n") { // If so, is there a string open? If there is, we should end it before // the newline and begin it again (so when
  • s are put in the source // remains XHTML compliant) - // NOTE TO SELF: This opens up possibility of config files specifying + // note to self: This opens up possibility of config files specifying // that languages can/cannot have multiline strings??? - if ( $STRING_OPEN ) - { - if ( !$this->use_classes ) - { + if ($STRING_OPEN) { + if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"'; - } - else - { + } else { $attributes = ' class="st0"'; } $char = '' . $char . ""; } - } - // Is this a match of a string delimiter? - elseif ( $char == $STRING_OPEN ) - { - if ( ($this->lexic_permissions['ESCAPE_CHAR'] && $ESCAPE_CHAR_OPEN) || ($this->lexic_permissions['STRINGS'] && !$ESCAPE_CHAR_OPEN) ) - { + } elseif ($char == $STRING_OPEN) { + // A match of a string delimiter + if (($this->lexic_permissions['ESCAPE_CHAR'] && $ESCAPE_CHAR_OPEN) || + ($this->lexic_permissions['STRINGS'] && !$ESCAPE_CHAR_OPEN)) { $char .= ''; } - if ( !$ESCAPE_CHAR_OPEN ) - { + $escape_me = false; + if ($HARDQUOTE_OPEN) + { + if ($ESCAPE_CHAR_OPEN) + $escape_me = true; + else { + foreach ($this->language_data['HARDESCAPE'] as $hardesc) + if (substr($part, $i, strlen($hardesc)) == $hardesc) + { + $escape_me = true; + break; + } + } + } + if (!$ESCAPE_CHAR_OPEN) { $STRING_OPEN = ''; $CLOSE_STRING = true; } + if (!$escape_me) { + $HARDQUOTE_OPEN = false; + } $ESCAPE_CHAR_OPEN = false; - } - // Is this the start of a new string? - elseif ( in_array( $char, $this->language_data['QUOTEMARKS'] ) && ($STRING_OPEN == '') && $this->lexic_permissions['STRINGS'] ) - { + } elseif (in_array($char, $this->language_data['QUOTEMARKS']) && + ($STRING_OPEN == '') && $this->lexic_permissions['STRINGS']) { + // The start of a new string $STRING_OPEN = $char; - if ( !$this->use_classes ) - { + if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"'; - } - else - { + } else { $attributes = ' class="st0"'; } $char = "" . $char; $result .= $this->parse_non_string_part( $stuff_to_parse ); $stuff_to_parse = ''; - } - // Is this an escape char? - elseif ( ($char == $this->language_data['ESCAPE_CHAR']) && ($STRING_OPEN != '') ) - { - if ( !$ESCAPE_CHAR_OPEN ) - { + } elseif ( + $hq && + substr($part, $i, strlen($hq)) == $hq && + ($STRING_OPEN == '') && $this->lexic_permissions['STRINGS'] + ) + { + // The start of a hard quoted string + $STRING_OPEN = $this->language_data['HARDQUOTE'][1]; + if (!$this->use_classes) { + $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"'; + } else { + $attributes = ' class="st0"'; + } + $char = "" . $hq; + $i += strlen($hq) - 1; + $HARDQUOTE_OPEN = true; + $result .= $this->parse_non_string_part( $stuff_to_parse ); + $stuff_to_parse = ''; + } elseif ($char == $this->language_data['ESCAPE_CHAR'] && $STRING_OPEN != '') + { + // An escape character + if (!$ESCAPE_CHAR_OPEN) { + $ESCAPE_CHAR_OPEN = !$HARDQUOTE_OPEN; // true unless $HARDQUOTE_OPEN + if ($HARDQUOTE_OPEN) + foreach ($this->language_data['HARDESCAPE'] as $hard) + { + if (substr($part, $i, strlen($hard)) == $hard) + { $ESCAPE_CHAR_OPEN = true; - if ( $this->lexic_permissions['ESCAPE_CHAR'] ) - { - if ( !$this->use_classes ) - { + break; + } + } + if ($ESCAPE_CHAR_OPEN && $this->lexic_permissions['ESCAPE_CHAR']) { + if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][0] . '"'; - } - else - { + } else { $attributes = ' class="es0"'; } $char = "" . $char; + if (substr($code, $i + 1, 1) == "\n") { + // escaping a newline, what's the point in putting the span around + // the newline? It only causes hassles when inserting line numbers + $char .= ''; + $ESCAPE_CHAR_OPEN = false; + } } - } - else - { + } else { $ESCAPE_CHAR_OPEN = false; - if ( $this->lexic_permissions['ESCAPE_CHAR'] ) - { + if ($this->lexic_permissions['ESCAPE_CHAR']) { $char .= ''; } } - } - elseif ( $ESCAPE_CHAR_OPEN ) - { - if ( $this->lexic_permissions['ESCAPE_CHAR'] ) - { + } elseif ($ESCAPE_CHAR_OPEN) { + if ($this->lexic_permissions['ESCAPE_CHAR']) { $char .= ''; } $ESCAPE_CHAR_OPEN = false; $test_str = $char; - } - elseif ( $STRING_OPEN == '' ) - { + } elseif ($STRING_OPEN == '') { // Is this a multiline comment? - foreach ( $this->language_data['COMMENT_MULTI'] as $open => $close ) - { + foreach ($this->language_data['COMMENT_MULTI'] as $open => $close) { $com_len = strlen($open); $test_str = substr( $part, $i, $com_len ); $test_str_match = $test_str; - if ( $open == $test_str ) - { + if ($open == $test_str) { $COMMENT_MATCHED = true; - if ( $this->lexic_permissions['COMMENTS']['MULTI'] || $test_str == GESHI_START_IMPORTANT ) - { - if ( $test_str != GESHI_START_IMPORTANT ) - { - if ( !$this->use_classes ) - { + //@todo If remove important do remove here + if ($this->lexic_permissions['COMMENTS']['MULTI'] || + $test_str == GESHI_START_IMPORTANT) { + if ($test_str != GESHI_START_IMPORTANT) { + if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS']['MULTI'] . '"'; - } - else - { + } else { $attributes = ' class="coMULTI"'; } - $test_str = "" . htmlentities($test_str, ENT_COMPAT, $this->encoding); - } - else - { - if ( !$this->use_classes ) - { + $test_str = "" . @htmlspecialchars($test_str, ENT_COMPAT, $this->encoding); + } else { + if (!$this->use_classes) { $attributes = ' style="' . $this->important_styles . '"'; - } - else - { + } else { $attributes = ' class="imp"'; } // We don't include the start of the comment if it's an // "important" part $test_str = ""; } - } - else - { - $test_str = htmlentities($test_str, ENT_COMPAT, $this->encoding); + } else { + $test_str = @htmlspecialchars($test_str, ENT_COMPAT, $this->encoding); } $close_pos = strpos( $part, $close, $i + strlen($close) ); - if ( $close_pos === false ) - { + if ($close_pos === false) { $close_pos = strlen($part); } // Short-cut through all the multiline code - $rest_of_comment = htmlentities(substr($part, $i + $com_len, $close_pos - $i), ENT_COMPAT, $this->encoding); - if ( ($this->lexic_permissions['COMMENTS']['MULTI'] || $test_str_match == GESHI_START_IMPORTANT) && ($this->line_numbers != GESHI_NO_LINE_NUMBERS || count($this->highlight_extra_lines) > 0) ) - { + $rest_of_comment = @htmlspecialchars(substr($part, $i + $com_len, $close_pos - $i), ENT_COMPAT, $this->encoding); + if (($this->lexic_permissions['COMMENTS']['MULTI'] || + $test_str_match == GESHI_START_IMPORTANT) && + ($this->line_numbers != GESHI_NO_LINE_NUMBERS || + count($this->highlight_extra_lines) > 0)) { // strreplace to put close span and open span around multiline newlines $test_str .= str_replace("\n", "\n", $rest_of_comment); - } - else - { + } else { $test_str .= $rest_of_comment; } - if ( $this->lexic_permissions['COMMENTS']['MULTI'] || $test_str_match == GESHI_START_IMPORTANT ) - { + if ($this->lexic_permissions['COMMENTS']['MULTI'] || + $test_str_match == GESHI_START_IMPORTANT) { $test_str .= ''; } $i = $close_pos + $com_len - 1; // parse the rest - $result .= $this->parse_non_string_part( $stuff_to_parse ); + $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; break; } } // If we haven't matched a multiline comment, try single-line comments - if ( !$COMMENT_MATCHED ) - { - foreach ( $this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark ) - { + if (!$COMMENT_MATCHED) { + foreach ($this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark) { $com_len = strlen($comment_mark); - $test_str = substr( $part, $i, $com_len ); - if ( $this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] ) - { - $match = ( $comment_mark == $test_str ); + $test_str = substr($part, $i, $com_len); + if ($this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS]) { + $match = ($comment_mark == $test_str); + } else { + $match = (strtolower($comment_mark) == strtolower($test_str)); } - else - { - $match = ( strtolower($comment_mark) == strtolower($test_str) ); - } - if ( $match ) - { + if ($match) { $COMMENT_MATCHED = true; - if ( $this->lexic_permissions['COMMENTS'][$comment_key] ) - { - if ( !$this->use_classes ) - { + if ($this->lexic_permissions['COMMENTS'][$comment_key]) { + if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment_key] . '"'; - } - else - { + } else { $attributes = ' class="co' . $comment_key . '"'; } - $test_str = "" . htmlentities($this->change_case($test_str), ENT_COMPAT, $this->encoding); - } - else - { - $test_str = htmlentities($test_str, ENT_COMPAT, $this->encoding); + $test_str = "" . @htmlspecialchars($this->change_case($test_str), ENT_COMPAT, $this->encoding); + } else { + $test_str = @htmlspecialchars($test_str, ENT_COMPAT, $this->encoding); } - $close_pos = strpos( $part, "\n", $i ); - if ( $close_pos === false ) - { + $close_pos = strpos($part, "\n", $i); + $oops = false; + if ($close_pos === false) { $close_pos = strlen($part); + $oops = true; } - $test_str .= htmlentities(substr($part, $i + $com_len, $close_pos - $i - $com_len), ENT_COMPAT, $this->encoding); - if ( $this->lexic_permissions['COMMENTS'][$comment_key] ) - { + $test_str .= @htmlspecialchars(substr($part, $i + $com_len, $close_pos - $i - $com_len), ENT_COMPAT, $this->encoding); + if ($this->lexic_permissions['COMMENTS'][$comment_key]) { $test_str .= ""; } - $test_str .= "\n"; + // Take into account that the comment might be the last in the source + if (!$oops) { + $test_str .= "\n"; + } $i = $close_pos; // parse the rest - $result .= $this->parse_non_string_part( $stuff_to_parse ); + $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; break; } } } - } - // Otherwise, convert it to HTML form - elseif ( $STRING_OPEN != '' ) - { - $char = htmlentities($char, ENT_COMPAT, $this->encoding); + } elseif ($STRING_OPEN != '') { + // Otherwise, convert it to HTML form + if (strtolower($this->encoding) == 'utf-8') { + //only escape <128 (we don't want to break multibyte chars) + if (ord($char) < 128) { + $char = @htmlspecialchars($char, ENT_COMPAT, $this->encoding); + } + } else { + //encode everthing + $char = @htmlspecialchars($char, ENT_COMPAT, $this->encoding); + } } // Where are we adding this char? - if ( !$COMMENT_MATCHED ) - { - if ( ($STRING_OPEN == '') && !$CLOSE_STRING ) - { + if (!$COMMENT_MATCHED) { + if (($STRING_OPEN == '') && !$CLOSE_STRING) { $stuff_to_parse .= $char; - } - else - { + } else { $result .= $char; $CLOSE_STRING = false; } - } - else - { + } else { $result .= $test_str; $COMMENT_MATCHED = false; } } // Parse the last bit - $result .= $this->parse_non_string_part( $stuff_to_parse ); + $result .= $this->parse_non_string_part($stuff_to_parse); $stuff_to_parse = ''; - } - else - { - $result .= htmlentities($part, ENT_COMPAT, $this->encoding); + } else { + $result .= @htmlspecialchars($part, ENT_COMPAT, $this->encoding); } // Close the that surrounds the block - if ( $this->strict_mode && $this->lexic_permissions['SCRIPT'] ) - { + if ($this->strict_mode && $this->language_data['STYLES']['SCRIPT'][$script_key] != '' && + $this->lexic_permissions['SCRIPT']) { $result .= ''; } - } - // Else not a block to highlight - else - { - $result .= htmlentities($part, ENT_COMPAT, $this->encoding); + } else { + // Else not a block to highlight + $result .= @htmlspecialchars($part, ENT_COMPAT, $this->encoding); } } // Parse the last stuff (redundant?) - $result .= $this->parse_non_string_part( $stuff_to_parse ); + $result .= $this->parse_non_string_part($stuff_to_parse); // Lop off the very first and last spaces $result = substr($result, 1, strlen($result) - 1); // Are we still in a string? - if ( $STRING_OPEN ) - { + if ($STRING_OPEN) { $result .= ''; } @@ -1528,103 +1811,201 @@ } /** - * method: indent - * -------------- * Swaps out spaces and tabs for HTML indentation. Not needed if * the code is in a pre block... - */ - function indent ( $result ) - { + * + * @param string The source to indent + * @return string The source with HTML indenting applied + * @since 1.0.0 + * @access private + */ + function indent ($result) + { + /// Replace tabs with the correct number of spaces + if (false !== strpos($result, "\t")) { + $lines = explode("\n", $result); + foreach ($lines as $key => $line) { + if (false === strpos($line, "\t")) { + $lines[$key] = $line; + continue; + }//echo 'checking line ' . $key . '
    '; + + $pos = 0; + $tab_width = $this->tab_width; + $length = strlen($line); + $result_line = ''; + + //echo '
    line: ' . htmlspecialchars($line) . '
    '; + $IN_TAG = false; + for ($i = 0; $i < $length; $i++) { + $char = substr($line, $i, 1); + // Simple engine to work out whether we're in a tag. + // If we are we modify $pos. This is so we ignore HTML + // in the line and only workout the tab replacement + // via the actual content of the string + // This test could be improved to include strings in the + // html so that < or > would be allowed in user's styles + // (e.g. quotes: '<' '>'; or similar) + if ($IN_TAG && '>' == $char) { + $IN_TAG = false; + $result_line .= '>'; + ++$pos; + } elseif (!$IN_TAG && '<' == $char) { + $IN_TAG = true; + $result_line .= '<'; + ++$pos; + } elseif (!$IN_TAG && '&' == $char) { + //echo "matched & in line... "; + $substr = substr($line, $i + 3, 4); + //$substr_5 = substr($line, 5, 1); + $posi = strpos($substr, ';'); + if (false !== $posi) { + //echo "found entity at $posi\n"; + $pos += $posi + 3; + } + $result_line .= '&'; + } elseif (!$IN_TAG && "\t" == $char) { + $str = ''; + // OPTIMISE - move $strs out. Make an array: + // $tabs = array( + // 1 => ' ', + // 2 => '  ', + // 3 => '   ' etc etc + // to use instead of building a string every time + $strs = array(0 => ' ', 1 => ' '); + //echo "building (pos=$pos i=$i) (" . ($i - $pos) . ") " . ($tab_width - (($i - $pos) % $tab_width)) . " spaces\n"; + for ($k = 0; $k < ($tab_width - (($i - $pos) % $tab_width)); $k++) $str .= $strs[$k % 2]; + $result_line .= $str; + //$pos--; + $pos++; + //$pos -= $tab_width-1; + + if (false === strpos($line, "\t", $i + 1)) { + //$lines[$key] = $result_line; + //echo 'got here'; + $result_line .= substr($line, $i + 1); + break; + } + } elseif ( $IN_TAG ) { + ++$pos; + $result_line .= $char; + } else { + $result_line .= $char; + //++$pos; + } + } + $lines[$key] = $result_line; + } + $result = implode("\n", $lines); + } + // Other whitespace $result = str_replace(' ', '  ', $result); $result = str_replace(' ', '  ', $result); $result = str_replace("\n ", "\n ", $result); - $result = str_replace("\t", $this->get_tab_replacement(), $result); - if ( $this->line_numbers == GESHI_NO_LINE_NUMBERS ) - { + + if ($this->line_numbers == GESHI_NO_LINE_NUMBERS) { $result = nl2br($result); } return $result; } /** - * method: change_case - * ------------------- * Changes the case of a keyword for those languages where a change is asked for + * + * @param string The keyword to change the case of + * @return string The keyword with its case changed + * @since 1.0.0 + * @access private */ - function change_case ( $instr ) + function change_case ($instr) { - if ( $this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_UPPER ) - { + if ($this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_UPPER) { return strtoupper($instr); - } - elseif ( $this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_LOWER ) - { + } elseif ($this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_LOWER) { return strtolower($instr); } return $instr; } - /** - * method: add_url_to_keyword - * -------------------------- * Adds a url to a keyword where needed. - * Added in 1.0.2 - */ - function add_url_to_keyword ( $keyword, $group, $start_or_end ) - { - if ( isset($this->language_data['URLS'][$group]) && $this->language_data['URLS'][$group] != '' && substr($keyword, 0, 5) != '</' ) - { + * + * @param string The keyword to add the URL HTML to + * @param int What group the keyword is from + * @param boolean Whether to get the HTML for the start or end + * @return The HTML for either the start or end of the HTML <a> tag + * @since 1.0.2 + * @access private + * @todo Get rid of ender + */ + function add_url_to_keyword ($keyword, $group, $start_or_end) + { + if (isset($this->language_data['URLS'][$group]) && + $this->language_data['URLS'][$group] != '' && + substr($keyword, 0, 5) != '</') { // There is a base group for this keyword - - if ( $start_or_end == 'BEGIN' ) - { + if ($start_or_end == 'BEGIN') { // HTML workaround... not good form (tm) but should work for 1.0.X - $keyword = ( substr($keyword, 0, 4) == '<' ) ? substr($keyword, 4) : $keyword; - $keyword = ( substr($keyword, -4) == '>' ) ? substr($keyword, 0, strlen($keyword) - 4) : $keyword; - if ( $keyword != '' ) - { - $keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword); - return '<|UR1|"' . str_replace(array('{FNAME}', '.'), array(htmlentities($keyword, ENT_COMPAT, $this->encoding), ''), $this->language_data['URLS'][$group]) . '">'; + if ($keyword != '') { + // Old system: strtolower + //$keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword); + // New system: get keyword from language file to get correct case + foreach ($this->language_data['KEYWORDS'][$group] as $word) { + if (strtolower($word) == strtolower($keyword)) { + break; + } + } + $word = ( substr($word, 0, 4) == '<' ) ? substr($word, 4) : $word; + $word = ( substr($word, -4) == '>' ) ? substr($word, 0, strlen($word) - 4) : $word; + if (!$word) return ''; + + return '<|UR1|"' . + str_replace( + array('{FNAME}', '.'), + array(@htmlspecialchars($word, ENT_COMPAT, $this->encoding), ''), + $this->language_data['URLS'][$group] + ) . '">'; } return ''; - } - else - { + // HTML fix. Again, dirty hackage... + } elseif (!($this->language == 'html4strict' && '>' == $keyword)) { return ''; } } } - /** - * method: parse_non_string_part - * ----------------------------- * Takes a string that has no strings or comments in it, and highlights * stuff like keywords, numbers and methods. + * + * @param string The string to parse for keyword, numbers etc. + * @since 1.0.0 + * @access private + * @todo BUGGY! Why? Why not build string and return? */ - function parse_non_string_part ( &$stuff_to_parse ) + function parse_non_string_part (&$stuff_to_parse) { - $stuff_to_parse = ' ' . quotemeta(htmlentities($stuff_to_parse, ENT_COMPAT, $this->encoding)); + $stuff_to_parse = ' ' . @htmlspecialchars($stuff_to_parse, ENT_COMPAT, $this->encoding); + $stuff_to_parse_pregquote = preg_quote($stuff_to_parse, '/'); // These vars will disappear in the future $func = '$this->change_case'; $func2 = '$this->add_url_to_keyword'; - // // Regular expressions // - foreach ( $this->language_data['REGEXPS'] as $key => $regexp ) - { - if ( $this->lexic_permissions['REGEXPS'][$key] ) - { - if ( is_array($regexp) ) - { - $stuff_to_parse = preg_replace( "#" . $regexp[GESHI_SEARCH] . "#{$regexp[GESHI_MODIFIERS]}", "{$regexp[GESHI_BEFORE]}<|!REG3XP$key!>{$regexp[GESHI_REPLACE]}|>{$regexp[GESHI_AFTER]}", $stuff_to_parse); - } - else - { - $stuff_to_parse = preg_replace( "#(" . $regexp . ")#", "<|!REG3XP$key!>\\1|>", $stuff_to_parse); + foreach ($this->language_data['REGEXPS'] as $key => $regexp) { + if ($this->lexic_permissions['REGEXPS'][$key]) { + if (is_array($regexp)) { + $stuff_to_parse = preg_replace( + "/" . + str_replace('/', '\/', $regexp[GESHI_SEARCH]) . + "/{$regexp[GESHI_MODIFIERS]}", + "{$regexp[GESHI_BEFORE]}<|!REG3XP$key!>{$regexp[GESHI_REPLACE]}|>{$regexp[GESHI_AFTER]}", + $stuff_to_parse + ); + } else { + $stuff_to_parse = preg_replace( "/(" . str_replace('/', '\/', $regexp) . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse); } } } @@ -1635,46 +2016,51 @@ // almost exactly the same thing, except the second one prevents a number // being highlighted twice (eg 5) // Put /NUM!/ in for the styles, which gets replaced at the end. + // + // NEW ONE: Brice Bernard + // $stuff_to_parse = preg_replace('/([^(\\w|#|\\\|"|\')])(\\d+)/', '\\1<|/NUM!/>\\2|>', $stuff_to_parse); + //$stuff_to_parse = preg_replace('/([-+]?\\b(?:[0-9]*\\.)?[0-9]+\\b)/', '<|/NUM!/>\\1|>', $stuff_to_parse); // - if ( $this->lexic_permissions['NUMBERS'] && preg_match('#[0-9]#', $stuff_to_parse ) ) - { - $stuff_to_parse = preg_replace('#([^a-zA-Z0-9\#])([0-9]+)([^a-zA-Z0-9])#', "\\1<|/NUM!/>\\2|>\\3", $stuff_to_parse); - $stuff_to_parse = preg_replace('#([^a-zA-Z0-9\#>])([0-9]+)([^a-zA-Z0-9])#', "\\1<|/NUM!/>\\2|>\\3", $stuff_to_parse); + if ($this->lexic_permissions['NUMBERS'] && preg_match('#[0-9]#', $stuff_to_parse )) { + //$stuff_to_parse = preg_replace('#([^a-zA-Z0-9_\#])([0-9]+)([^a-zA-Z0-9])#', "\\1<|/NUM!/>\\2|>\\3", $stuff_to_parse); + //$stuff_to_parse = preg_replace('#([^a-zA-Z0-9_\#>])([0-9]+)([^a-zA-Z0-9])#', "\\1<|/NUM!/>\\2|>\\3", $stuff_to_parse); + $stuff_to_parse = preg_replace('/([-+]?\\b(?:[0-9]*\\.)?[0-9]+\\b)/', '<|/NUM!/>\\1|>', $stuff_to_parse); } // Highlight keywords // if there is a couple of alpha symbols there *might* be a keyword - if ( preg_match('#[a-zA-Z]{2,}#', $stuff_to_parse) ) - { - foreach ( $this->language_data['KEYWORDS'] as $k => $keywordset ) - { - if ( $this->lexic_permissions['KEYWORDS'][$k] ) - { - foreach ( $keywordset as $keyword ) - { - $keyword = quotemeta($keyword); + if (preg_match('#[a-zA-Z]{2,}#', $stuff_to_parse)) { + foreach ($this->language_data['KEYWORDS'] as $k => $keywordset) { + if ($this->lexic_permissions['KEYWORDS'][$k]) { + foreach ($keywordset as $keyword) { + $keyword = preg_quote($keyword, '/'); // // This replacement checks the word is on it's own (except if brackets etc // are next to it), then highlights it. We don't put the color=" for the span // in just yet - otherwise languages with the keywords "color" or "or" have // a fit. // - if ( false !== stristr($stuff_to_parse, $keyword ) ) - { + if (false !== stristr($stuff_to_parse_pregquote, $keyword )) { $stuff_to_parse .= ' '; // Might make a more unique string for putting the number in soon // Basically, we don't put the styles in yet because then the styles themselves will // get highlighted if the language has a CSS keyword in it (like CSS, for example ;)) $styles = "/$k/"; - $keyword = quotemeta($keyword); - if ( $this->language_data['CASE_SENSITIVE'][$k] ) - { - $stuff_to_parse = preg_replace("#([^a-zA-Z0-9\$_\|\.\#;>])($keyword)([^a-zA-Z0-9_<\|%\-&])#e", "'\\1' . $func2('\\2', '$k', 'BEGIN') . '<|$styles>' . $func('\\2') . '|>' . $func2('\\2', '$k', 'END') . '\\3'", $stuff_to_parse); - } - else - { + if ($this->language_data['CASE_SENSITIVE'][$k]) { + $stuff_to_parse = preg_replace( + "/([^a-zA-Z0-9\$_\|\#;>|^])($keyword)(?=[^a-zA-Z0-9_<\|%\-&])/e", + "'\\1' . $func2('\\2', '$k', 'BEGIN') . '<|$styles>' . $func('\\2') . '|>' . $func2('\\2', '$k', 'END')", + $stuff_to_parse + ); + } else { // Change the case of the word. - $stuff_to_parse = preg_replace("#([^a-zA-Z0-9\$_\|\.\#;>])($keyword)([^a-zA-Z0-9_<\|%\-&])#ie", "'\\1' . $func2('\\2', '$k', 'BEGIN') . '<|$styles>' . $func('\\2') . '|>' . $func2('\\2', '$k', 'END') . '\\3'", $stuff_to_parse); + // hackage again... must... release... 1.2... + if ('smarty' == $this->language) { $hackage = '\/'; } else { $hackage = ''; } + $stuff_to_parse = preg_replace( + "/([^a-zA-Z0-9\$_\|\#;>$hackage|^])($keyword)(?=[^a-zA-Z0-9_<\|%\-&])/ie", + "'\\1' . $func2('\\2', '$k', 'BEGIN') . '<|$styles>' . $func('\\2') . '|>' . $func2('\\2', '$k', 'END')", + $stuff_to_parse + ); } $stuff_to_parse = substr($stuff_to_parse, 0, strlen($stuff_to_parse) - 1); } @@ -1686,26 +2072,19 @@ // // Now that's all done, replace /[number]/ with the correct styles // - foreach ( $this->language_data['KEYWORDS'] as $k => $kws ) - { - if ( !$this->use_classes ) - { + foreach ($this->language_data['KEYWORDS'] as $k => $kws) { + if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['KEYWORDS'][$k] . '"'; - } - else - { + } else { $attributes = ' class="kw' . $k . '"'; } $stuff_to_parse = str_replace("/$k/", $attributes, $stuff_to_parse); } // Put number styles in - if ( !$this->use_classes && $this->lexic_permissions['NUMBERS'] ) - { + if (!$this->use_classes && $this->lexic_permissions['NUMBERS']) { $attributes = ' style="' . $this->language_data['STYLES']['NUMBERS'][0] . '"'; - } - else - { + } else { $attributes = ' class="nu0"'; } $stuff_to_parse = str_replace('/NUM!/', $attributes, $stuff_to_parse); @@ -1713,21 +2092,15 @@ // // Highlight methods and fields in objects // - if ( $this->lexic_permissions['METHODS'] && $this->language_data['OOLANG'] ) - { - foreach ( $this->language_data['OBJECT_SPLITTERS'] as $key => $splitter ) - { - if ( false !== stristr($stuff_to_parse, $this->language_data['OBJECT_SPLITTERS'][$key]) ) - { - if ( !$this->use_classes ) - { + if ($this->lexic_permissions['METHODS'] && $this->language_data['OOLANG']) { + foreach ($this->language_data['OBJECT_SPLITTERS'] as $key => $splitter) { + if (false !== stristr($stuff_to_parse, $splitter)) { + if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['METHODS'][$key] . '"'; - } - else - { + } else { $attributes = ' class="me' . $key . '"'; } - $stuff_to_parse = preg_replace("#(" . quotemeta($this->language_data['OBJECT_SPLITTERS'][$key]) . "[\s]*)([a-zA-Z\*\(][a-zA-Z0-9_\*]*)#", "\\1<|$attributes>\\2|>", $stuff_to_parse); + $stuff_to_parse = preg_replace("/(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], 1) . "[\s]*)([a-zA-Z\*\(][a-zA-Z0-9_\*]*)/", "\\1<|$attributes>\\2|>", $stuff_to_parse); } } } @@ -1738,11 +2111,9 @@ // TODO: Fix lexic permissions not converting entities if shouldn't // be highlighting regardless // - if ( $this->lexic_permissions['BRACKETS'] ) - { + if ($this->lexic_permissions['BRACKETS']) { $code_entities_match = array('[', ']', '(', ')', '{', '}'); - if ( !$this->use_classes ) - { + if (!$this->use_classes) { $code_entities_replace = array( '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">[|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">]|>', @@ -1751,9 +2122,7 @@ '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">{|>', '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">}|>', ); - } - else - { + } else { $code_entities_replace = array( '<| class="br0">[|>', '<| class="br0">]|>', @@ -1769,16 +2138,11 @@ // // Add class/style for regexps // - foreach ( $this->language_data['REGEXPS'] as $key => $regexp ) - { - if ( $this->lexic_permissions['REGEXPS'][$key] ) - { - if ( !$this->use_classes ) - { + foreach ($this->language_data['REGEXPS'] as $key => $regexp) { + if ($this->lexic_permissions['REGEXPS'][$key]) { + if (!$this->use_classes) { $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"'; - } - else - { + } else { $attributes = ' class="re' . $key . '"'; } $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse); @@ -1788,19 +2152,13 @@ // Replace with . for urls $stuff_to_parse = str_replace('', '.', $stuff_to_parse); // Replace <|UR1| with link_styles[GESHI_LINK]) ) - { - if ( $this->use_classes ) - { + if (isset($this->link_styles[GESHI_LINK])) { + if ($this->use_classes) { $stuff_to_parse = str_replace('<|UR1|', 'link_target . ' href=', $stuff_to_parse); - } - else - { + } else { $stuff_to_parse = str_replace('<|UR1|', 'link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse); } - } - else - { + } else { $stuff_to_parse = str_replace('<|UR1|', 'link_target . ' href=', $stuff_to_parse); } @@ -1815,11 +2173,14 @@ } /** - * method: set_time - * ---------------- * Sets the time taken to parse the code + * + * @param microtime The time when parsing started + * @param microtime The time when parsing ended + * @since 1.0.2 + * @access private */ - function set_time ( $start_time, $end_time ) + function set_time ($start_time, $end_time) { $start = explode(' ', $start_time); $end = explode(' ', $end_time); @@ -1827,9 +2188,10 @@ } /** - * method: get_time - * ---------------- * Gets the time taken to parse the code + * + * @return double The time taken to parse the code + * @since 1.0.2 */ function get_time () { @@ -1837,334 +2199,288 @@ } /** - * method: load_language - * --------------------- * Gets language information and stores it for later use + * + * @access private + * @todo Needs to load keys for lexic permissions for keywords, regexps etc */ - function load_language () + function load_language ($file_name) { - $file_name = $this->language_path . $this->language . '.php'; - if ( !is_readable($file_name)) - { - $this->error = GESHI_ERROR_NO_SUCH_LANG; - return; - } - require($file_name); + $language_data = array(); + require $file_name; // Perhaps some checking might be added here later to check that // $language data is a valid thing but maybe not $this->language_data = $language_data; // Set strict mode if should be set - if ( $this->language_data['STRICT_MODE_APPLIES'] == GESHI_ALWAYS ) - { + if ($this->language_data['STRICT_MODE_APPLIES'] == GESHI_ALWAYS) { $this->strict_mode = true; } // Set permissions for all lexics to true // so they'll be highlighted by default + foreach ($this->language_data['KEYWORDS'] as $key => $words) { + $this->lexic_permissions['KEYWORDS'][$key] = true; + } + foreach ($this->language_data['COMMENT_SINGLE'] as $key => $comment) { + $this->lexic_permissions['COMMENTS'][$key] = true; + } + foreach ($this->language_data['REGEXPS'] as $key => $regexp) { + $this->lexic_permissions['REGEXPS'][$key] = true; + } $this->enable_highlighting(); // Set default class for CSS $this->overall_class = $this->language; } /** - * method: get_tab_replacement - * --------------------------- - * Gets the replacement string for tabs in the source code. Useful for - * HTML highlighting, where tabs don't mean anything to a browser. - */ - function get_tab_replacement () - { - $i = 0; - $result = ''; - while ( $i < $this->tab_width ) - { - $i++; - if ( $i % 2 == 0 ) - { - $result .= ' '; - } - else - { - $result .= ' '; - } - } - return $result; - } - - /** - * method: finalise - * ---------------- * Takes the parsed code and various options, and creates the HTML * surrounding it to make it look nice. - */ - function finalise ( $parsed_code ) - { - // Remove end parts of important declarations - // This is BUGGY!! My fault for bad code: fix coming in 1.2 - if ( $this->enable_important_blocks && (strstr($parsed_code, htmlentities(GESHI_START_IMPORTANT, ENT_COMPAT, $this->encoding)) === false) ) - { - $parsed_code = str_replace(htmlentities(GESHI_END_IMPORTANT, ENT_COMPAT, $this->encoding), '', $parsed_code); - } - - // Add HTML whitespace stuff if we're using the
    header - if ( $this->header_type == GESHI_HEADER_DIV ) - { - $parsed_code = $this->indent($parsed_code); - } - - // If we're using line numbers, we insert
  • s and appropriate - // markup to style them (otherwise we don't need to do anything) - if ( $this->line_numbers != GESHI_NO_LINE_NUMBERS ) - { - // If we're using the
     header, we shouldn't add newlines because
    -			// the 
     will line-break them (and the 
  • s already do this for us) - $ls = ( $this->header_type != GESHI_HEADER_PRE ) ? "\n" : ''; - // Get code into lines - $code = explode("\n", $parsed_code); - // Set vars to defaults for following loop - $parsed_code = ''; - $i = 0; - // Foreach line... - foreach ( $code as $line ) - { - $line = ( $line ) ? $line : ' '; - // If this is a "special line"... - if ( $this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $i % $this->line_nth_row == ($this->line_nth_row - 1) ) - { - // Set the attributes to style the line - if ( $this->use_classes ) - { - $attr = ' class="li2"'; - $def_attr = ' class="de2"'; - } - else - { - $attr = ' style="' . $this->line_style2 . '"'; - // This style "covers up" the special styles set for special lines - // so that styles applied to special lines don't apply to the actual - // code on that line - $def_attr = ' style="' . $this->code_style . '"'; - } - // Span or div? - $start = ""; - $end = '
  • '; - } - else - { - if ( $this->use_classes ) - { - $def_attr = ' class="de1"'; - } - else - { - $def_attr = ' style="' . $this->code_style . '"'; - } - // Reset everything - $attr = ''; - // Span or div? - $start = ""; - $end = '
    '; - } - - ++$i; - // Are we supposed to use ids? If so, add them - if ( $this->add_ids ) - { - $attr .= " id=\"{$this->overall_id}-{$i}\""; - } - if ( $this->use_classes && in_array($i, $this->highlight_extra_lines) ) - { - $attr .= " class=\"ln-xtra\""; - } - if ( !$this->use_classes && in_array($i, $this->highlight_extra_lines) ) - { - $attr .= " style=\"{$this->highlight_extra_lines_style}\""; - } - - // Add in the line surrounded by appropriate list HTML - $parsed_code .= "$start$line$end
  • $ls"; - } - } - else - { - // No line numbers, but still need to handle highlighting lines extra. - // Have to use divs so the full width of the code is highlighted - $code = explode("\n", $parsed_code); - $parsed_code = ''; - $i = 0; - foreach ( $code as $line ) - { - // Make lines have at least one space in them if they're empty - $line = ( $line ) ? $line : ' '; - if ( in_array(++$i, $this->highlight_extra_lines) ) - { - if ( $this->use_classes ) - { - //$id = ( $this->overall_id != '' ) ? $this->overall_id . "-$i" : $this->overall_class . "-$i"; - $parsed_code .= '
    '; - } - else - { - $parsed_code .= "
    highlight_extra_lines_style}\">"; - } - $parsed_code .= $line . "
    \n"; - } - else - { - $parsed_code .= $line . "\n"; - } - } - } - - return $this->header() . chop($parsed_code) . $this->footer(); - } - + * + * @param string The code already parsed + * @return string The code nicely finalised + * @since 1.0.0 + * @access private + */ + function finalise ($parsed_code) + { + // Remove end parts of important declarations + // This is BUGGY!! My fault for bad code: fix coming in 1.2 + // @todo Remove this crap + if ($this->enable_important_blocks && + (strstr($parsed_code, @htmlspecialchars(GESHI_START_IMPORTANT, ENT_COMPAT, $this->encoding)) === false)) { + $parsed_code = str_replace(@htmlspecialchars(GESHI_END_IMPORTANT, ENT_COMPAT, $this->encoding), '', $parsed_code); + } + + // Add HTML whitespace stuff if we're using the
    header + if ($this->header_type != GESHI_HEADER_PRE) { + $parsed_code = $this->indent($parsed_code); + } + + // If we're using line numbers, we insert
  • s and appropriate + // markup to style them (otherwise we don't need to do anything) + if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { + // If we're using the
     header, we shouldn't add newlines because
    +            // the 
     will line-break them (and the 
  • s already do this for us) + $ls = ($this->header_type != GESHI_HEADER_PRE) ? "\n" : ''; + // Get code into lines + $code = explode("\n", $parsed_code); + // Set vars to defaults for following loop + $parsed_code = ''; + $i = 0; + // Foreach line... + foreach ($code as $line) { + $line = ( $line ) ? $line : ' '; + // If this is a "special line"... + if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && + $i % $this->line_nth_row == ($this->line_nth_row - 1)) { + // Set the attributes to style the line + if ($this->use_classes) { + $attr = ' class="li2"'; + $def_attr = ' class="de2"'; + } else { + $attr = ' style="' . $this->line_style2 . '"'; + // This style "covers up" the special styles set for special lines + // so that styles applied to special lines don't apply to the actual + // code on that line + $def_attr = ' style="' . $this->code_style . '"'; + } + // Span or div? + $start = ""; + $end = '
  • '; + } else { + if ($this->use_classes) { + $attr = ' class="li1"'; + $def_attr = ' class="de1"'; + } else { + $attr = ' style="' . $this->line_style1 . '"'; + $def_attr = ' style="' . $this->code_style . '"'; + } + $start = ""; + $end = '
    '; + } + + ++$i; + // Are we supposed to use ids? If so, add them + if ($this->add_ids) { + $attr .= " id=\"{$this->overall_id}-{$i}\""; + } + if ($this->use_classes && in_array($i, $this->highlight_extra_lines)) { + $attr .= " class=\"ln-xtra\""; + } + if (!$this->use_classes && in_array($i, $this->highlight_extra_lines)) { + $attr .= " style=\"{$this->highlight_extra_lines_style}\""; + } + + // Add in the line surrounded by appropriate list HTML + $parsed_code .= "$start$line$end$ls"; + } + } else { + // No line numbers, but still need to handle highlighting lines extra. + // Have to use divs so the full width of the code is highlighted + $code = explode("\n", $parsed_code); + $parsed_code = ''; + $i = 0; + foreach ($code as $line) + { + // Make lines have at least one space in them if they're empty + $line = ($line) ? $line : ' '; + if (in_array(++$i, $this->highlight_extra_lines)) { + if ($this->use_classes) { + $parsed_code .= '
    '; + } else { + $parsed_code .= "
    highlight_extra_lines_style}\">"; + } + $parsed_code .= $line . "
    \n"; + } else { + $parsed_code .= $line . "\n"; + } + } + } + + // purge some unnecessary stuff + $parsed_code = preg_replace('#]+>(\s*)#', '\\1', $parsed_code); + $parsed_code = preg_replace('#]+>(\s*)
    #', '\\1', $parsed_code); + + if ($this->header_type == GESHI_HEADER_PRE) { + // enforce line numbers when using pre + $parsed_code = str_replace('
  • ', '
  •  
  • ', $parsed_code); + } + + return $this->header() . chop($parsed_code) . $this->footer(); + } /** - * method: header - * -------------- * Creates the header for the code block (with correct attributes) + * + * @return string The header for the code block + * @since 1.0.0 + * @access private */ function header () { // Get attributes needed $attributes = $this->get_attributes(); - if ( $this->use_classes ) - { - $ol_attributes = ''; - } - else - { - $ol_attributes = ' style="margin: 0;"'; - } + $ol_attributes = ''; - if ( $this->line_numbers_start != 1 ) - { + if ($this->line_numbers_start != 1) { $ol_attributes .= ' start="' . $this->line_numbers_start . '"'; } // Get the header HTML $header = $this->format_header_content(); + if (GESHI_HEADER_NONE == $this->header_type) { + if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { + return "$header"; + } + return $header; + } + // Work out what to return and do it - if ( $this->line_numbers != GESHI_NO_LINE_NUMBERS ) - { - if ( $this->header_type == GESHI_HEADER_PRE ) - { + if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { + if ($this->header_type == GESHI_HEADER_PRE) { return "$header"; - } - elseif ( $this->header_type == GESHI_HEADER_DIV ) - { + } elseif ($this->header_type == GESHI_HEADER_DIV) { return "$header"; } - } - else - { - if ( $this->header_type == GESHI_HEADER_PRE ) - { + } else { + if ($this->header_type == GESHI_HEADER_PRE) { return "$header"; - } - elseif ( $this->header_type == GESHI_HEADER_DIV ) - { + } elseif ($this->header_type == GESHI_HEADER_DIV) { return "$header"; } } } - /** - * method: format_header_content - * ----------------------------- * Returns the header content, formatted for output + * + * @return string The header content, formatted for output + * @since 1.0.2 + * @access private */ function format_header_content () { $header = $this->header_content; - if ( $header ) - { - if ( $this->header_type == GESHI_HEADER_PRE ) - { + if ($header) { + if ($this->header_type == GESHI_HEADER_PRE) { $header = str_replace("\n", '', $header); } $header = $this->replace_keywords($header); - if ( $this->use_classes ) - { + if ($this->use_classes) { $attr = ' class="head"'; - } - else - { + } else { $attr = " style=\"{$this->header_content_style}\""; } return "$header"; } } - /** - * method: footer - * -------------- - * Returns the footer for the code block. Ending newline removed in 1.0.2 + * Returns the footer for the code block. + * + * @return string The footer for the code block + * @since 1.0.0 + * @access private */ function footer () { $footer_content = $this->format_footer_content(); - if ( $this->header_type == GESHI_HEADER_DIV ) - { - if ( $this->line_numbers != GESHI_NO_LINE_NUMBERS ) - { + if (GESHI_HEADER_NONE == $this->header_type) { + return ($this->line_numbers != GESHI_NO_LINE_NUMBERS) ? '' . $footer_content + : $footer_content; + } + + if ($this->header_type == GESHI_HEADER_DIV) { + if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$footer_content"; } return "$footer_content"; - } - else - { - if ( $this->line_numbers != GESHI_NO_LINE_NUMBERS ) - { + } else { + if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) { return "$footer_content"; } return "$footer_content"; } } - /** - * method: format_footer_content - * ----------------------------- * Returns the footer content, formatted for output + * + * @return string The footer content, formatted for output + * @since 1.0.2 + * @access private */ function format_footer_content () { $footer = $this->footer_content; - if ( $footer ) - { - if ( $this->header_type == GESHI_HEADER_PRE ) - { + if ($footer) { + if ($this->header_type == GESHI_HEADER_PRE) { $footer = str_replace("\n", '', $footer);; } $footer = $this->replace_keywords($footer); - if ( $this->use_classes ) - { + if ($this->use_classes) { $attr = ' class="foot"'; - } - else - { - $attr = " style=\"{$this->footer_content_style}\">"; + } else { + $attr = " style=\"{$this->footer_content_style}\""; } return "$footer"; } } - /** - * method: replace_keywords - * ---------------------- * Replaces certain keywords in the header and footer with * certain configuration values + * + * @param string The header or footer content to do replacement on + * @return string The header or footer with replaced keywords + * @since 1.0.2 + * @access private */ - function replace_keywords ( $instr ) + function replace_keywords ($instr) { $keywords = $replacements = array(); @@ -2175,65 +2491,63 @@ $replacements[] = $this->language; $keywords[] = ''; - $replacements[] = '1.0.4'; + $replacements[] = GESHI_VERSION; return str_replace($keywords, $replacements, $instr); } /** - * method: get_attributes - * ---------------------- * Gets the CSS attributes for this code + * + * @return The CSS attributes for this code + * @since 1.0.0 + * @access private + * @todo Document behaviour change - class is outputted regardless of whether we're using classes or not. + * Same with style */ function get_attributes () { $attributes = ''; - if ( $this->overall_class != '' && $this->use_classes ) - { + if ($this->overall_class != '') { $attributes .= " class=\"{$this->overall_class}\""; } - if ( $this->overall_id != '' ) - { + if ($this->overall_id != '') { $attributes .= " id=\"{$this->overall_id}\""; } - if ( $this->overall_style != '' && !$this->use_classes ) - { + if ($this->overall_style != '') { $attributes .= ' style="' . $this->overall_style . '"'; } return $attributes; } - /** - * method: get_stylesheet - * ---------------------- * Returns a stylesheet for the highlighted code. If $economy mode * is true, we only return the stylesheet declarations that matter for * this code block instead of the whole thing + * + * @param boolean Whether to use economy mode or not + * @return string A stylesheet built on the data for the current language + * @since 1.0.0 */ - function get_stylesheet ( $economy_mode = true ) + function get_stylesheet ($economy_mode = true) { // If there's an error, chances are that the language file // won't have populated the language data file, so we can't // risk getting a stylesheet... - if ( $this->error ) - { + if ($this->error) { return ''; } // First, work out what the selector should be. If there's an ID, // that should be used, the same for a class. Otherwise, a selector // of '' means that these styles will be applied anywhere - $selector = ( $this->overall_id != '' ) ? "#{$this->overall_id} " : ''; - $selector = ( $selector == '' && $this->overall_class != '' ) ? ".{$this->overall_class} " : $selector; + $selector = ($this->overall_id != '') ? "#{$this->overall_id} " : ''; + $selector = ($selector == '' && $this->overall_class != '') ? ".{$this->overall_class} " : $selector; // Header of the stylesheet - if ( !$economy_mode ) - { + if (!$economy_mode) { $stylesheet = "/**\n * GeSHi Dynamically Generated Stylesheet\n * --------------------------------------\n * Dynamically generated stylesheet for {$this->language}\n * CSS class: {$this->overall_class}, CSS id: {$this->overall_id}\n * GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter)\n */\n"; - } - else - { + } else { $stylesheet = '/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */' . "\n"; } @@ -2241,141 +2555,109 @@ // (
      s have margins that should be destroyed so all layout is // controlled by the set_overall_style method, which works on the //
       or 
      container). Additionally, set default styles for lines - if ( !$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS ) - { - $stylesheet .= "$selector, {$selector}ol, {$selector}ol li {margin: 0;}\n"; + if (!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) { + //$stylesheet .= "$selector, {$selector}ol, {$selector}ol li {margin: 0;}\n"; $stylesheet .= "$selector.de1, $selector.de2 {{$this->code_style}}\n"; } // Add overall styles - if ( !$economy_mode || $this->overall_style != '' ) - { + if (!$economy_mode || $this->overall_style != '') { $stylesheet .= "$selector {{$this->overall_style}}\n"; } // Add styles for links - foreach ( $this->link_styles as $key => $style ) - { - if ( !$economy_mode || $key == GESHI_LINK && $style != '' ) - { + foreach ($this->link_styles as $key => $style) { + if (!$economy_mode || $key == GESHI_LINK && $style != '') { $stylesheet .= "{$selector}a:link {{$style}}\n"; } - if ( !$economy_mode || $key == GESHI_HOVER && $style != '' ) - { + if (!$economy_mode || $key == GESHI_HOVER && $style != '') { $stylesheet .= "{$selector}a:hover {{$style}}\n"; } - if ( !$economy_mode || $key == GESHI_ACTIVE && $style != '' ) - { + if (!$economy_mode || $key == GESHI_ACTIVE && $style != '') { $stylesheet .= "{$selector}a:active {{$style}}\n"; } - if ( !$economy_mode || $key == GESHI_VISITED && $style != '' ) - { + if (!$economy_mode || $key == GESHI_VISITED && $style != '') { $stylesheet .= "{$selector}a:visited {{$style}}\n"; } } // Header and footer - if ( !$economy_mode || $this->header_content_style != '' ) - { + if (!$economy_mode || $this->header_content_style != '') { $stylesheet .= "$selector.head {{$this->header_content_style}}\n"; } - if ( !$economy_mode || $this->footer_content_style != '' ) - { + if (!$economy_mode || $this->footer_content_style != '') { $stylesheet .= "$selector.foot {{$this->footer_content_style}}\n"; } // Styles for important stuff - if ( !$economy_mode || $this->important_styles != '' ) - { + if (!$economy_mode || $this->important_styles != '') { $stylesheet .= "$selector.imp {{$this->important_styles}}\n"; } - // Styles for lines being highlighted extra - if ( !$economy_mode || count($this->highlight_extra_lines) ) - { - /*foreach ( $this->highlight_extra_lines as $line ) - { - $id = ( $this->overall_id != '' ) ? $this->overall_id . "-$line" : $this->overall_class . "-$line"; - $stylesheet .= "$selector#$id,"; - }*/ + if (!$economy_mode || count($this->highlight_extra_lines)) { $stylesheet .= "$selector.ln-xtra {{$this->highlight_extra_lines_style}}\n"; } - // Simple line number styles - if ( !$economy_mode || ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->line_style1 != '') ) - { + if (!$economy_mode || ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->line_style1 != '')) { $stylesheet .= "{$selector}li {{$this->line_style1}}\n"; } // If there is a style set for fancy line numbers, echo it out - if ( !$economy_mode || ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $this->line_style2 != '') ) - { + if (!$economy_mode || ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $this->line_style2 != '')) { $stylesheet .= "{$selector}li.li2 {{$this->line_style2}}\n"; } - - foreach ( $this->language_data['STYLES']['KEYWORDS'] as $group => $styles ) - { - if ( !$economy_mode || !($economy_mode && (!$this->lexic_permissions['KEYWORDS'][$group] || $styles == '')) ) - { + foreach ($this->language_data['STYLES']['KEYWORDS'] as $group => $styles) { + if (!$economy_mode || !($economy_mode && (!$this->lexic_permissions['KEYWORDS'][$group] || $styles == ''))) { $stylesheet .= "$selector.kw$group {{$styles}}\n"; } } - foreach ( $this->language_data['STYLES']['COMMENTS'] as $group => $styles ) - { - if ( !$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && !$this->lexic_permissions['COMMENTS'][$group]) ) - { + foreach ($this->language_data['STYLES']['COMMENTS'] as $group => $styles) { + if (!$economy_mode || !($economy_mode && $styles == '') && + !($economy_mode && !$this->lexic_permissions['COMMENTS'][$group])) { $stylesheet .= "$selector.co$group {{$styles}}\n"; } } - foreach ( $this->language_data['STYLES']['ESCAPE_CHAR'] as $group => $styles ) - { - if ( !$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && !$this->lexic_permissions['ESCAPE_CHAR']) ) - { + foreach ($this->language_data['STYLES']['ESCAPE_CHAR'] as $group => $styles) { + if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && + !$this->lexic_permissions['ESCAPE_CHAR'])) { $stylesheet .= "$selector.es$group {{$styles}}\n"; } } - foreach ( $this->language_data['STYLES']['SYMBOLS'] as $group => $styles ) - { - if ( !$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && !$this->lexic_permissions['BRACKETS']) ) - { + foreach ($this->language_data['STYLES']['SYMBOLS'] as $group => $styles) { + if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && + !$this->lexic_permissions['BRACKETS'])) { $stylesheet .= "$selector.br$group {{$styles}}\n"; } } - foreach ( $this->language_data['STYLES']['STRINGS'] as $group => $styles ) - { - if ( !$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && !$this->lexic_permissions['STRINGS']) ) - { + foreach ($this->language_data['STYLES']['STRINGS'] as $group => $styles) { + if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && + !$this->lexic_permissions['STRINGS'])) { $stylesheet .= "$selector.st$group {{$styles}}\n"; } } - foreach ( $this->language_data['STYLES']['NUMBERS'] as $group => $styles ) - { - if ( !$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && !$this->lexic_permissions['NUMBERS']) ) - { + foreach ($this->language_data['STYLES']['NUMBERS'] as $group => $styles) { + if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && + !$this->lexic_permissions['NUMBERS'])) { $stylesheet .= "$selector.nu$group {{$styles}}\n"; } } - foreach ( $this->language_data['STYLES']['METHODS'] as $group => $styles ) - { - if ( !$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && !$this->lexic_permissions['METHODS']) ) - { + foreach ($this->language_data['STYLES']['METHODS'] as $group => $styles) { + if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && + !$this->lexic_permissions['METHODS'])) { $stylesheet .= "$selector.me$group {{$styles}}\n"; } } - foreach ( $this->language_data['STYLES']['SCRIPT'] as $group => $styles ) - { - if ( !$economy_mode || !($economy_mode && $styles == '') /*&& !($economy_mode && !$this->lexic_permissions['SCRIPT'])*/ ) - { + foreach ($this->language_data['STYLES']['SCRIPT'] as $group => $styles) { + if (!$economy_mode || !($economy_mode && $styles == '')) { $stylesheet .= "$selector.sc$group {{$styles}}\n"; } } - foreach ( $this->language_data['STYLES']['REGEXPS'] as $group => $styles ) - { - if ( !$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && !$this->lexic_permissions['REGEXPS'][$group]) ) - { + foreach ($this->language_data['STYLES']['REGEXPS'] as $group => $styles) { + if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode && + !$this->lexic_permissions['REGEXPS'][$group])) { $stylesheet .= "$selector.re$group {{$styles}}\n"; } } @@ -2386,27 +2668,31 @@ } // End Class GeSHi -if ( !function_exists('geshi_highlight') ) -{ +if (!function_exists('geshi_highlight')) { /** - * function: geshi_highlight - * ------------------------- - * Easy way to highlight stuff. Behaves just like highlight_string - */ - function geshi_highlight ( $string, $language, $path, $return = false ) + * Easy way to highlight stuff. Behaves just like highlight_string + * + * @param string The code to highlight + * @param string The language to highlight the code in + * @param string The path to the language files. You can leave this blank if you need + * as from version 1.0.7 the path should be automatically detected + * @param boolean Whether to return the result or to echo + * @return string The code highlighted (if $return is true) + * @since 1.0.2 + */ + function geshi_highlight ($string, $language, $path, $return = false) { $geshi = new GeSHi($string, $language, $path); - $geshi->set_header_type(GESHI_HEADER_DIV); - if ( $return ) - { - return str_replace('
      ', '', str_replace('
      ', '', $geshi->parse_code())); + $geshi->set_header_type(GESHI_HEADER_NONE); + if ($return) { + return '' . $geshi->parse_code() . ''; } - echo str_replace('
      ', '', str_replace('
      ', '', $geshi->parse_code())); - if ( $geshi->error() ) - { + echo '' . $geshi->parse_code() . ''; + if ($geshi->error()) { return false; } return true; } } -?> \ No newline at end of file + +?> diff -urN joomla-1.0.7/mambots/content/geshi.php joomla-1.0.10/mambots/content/geshi.php --- joomla-1.0.7/mambots/content/geshi.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/geshi.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ text, 'pre>' ) === false ) { + return true; + } + // define the regular expression for the bot $regex = "#(.*?)
      #s"; @@ -63,12 +68,6 @@ $text = str_replace('<', '<', $text); $text = str_replace('>', '>', $text); -/* - // Replace 2 spaces with "  " so non-tabbed code indents without making huge long lines. - $text = str_replace(" ", "  ", $text); - // now Replace 2 spaces with "  " to catch odd #s of spaces. - $text = str_replace(" ", "  ", $text); -*/ // Replace tabs with "   " so tabbed code indents sorta right without making huge long lines. //$text = str_replace("\t", "   ", $text); $text = str_replace( "\t", ' ', $text ); diff -urN joomla-1.0.7/mambots/content/legacybots.php joomla-1.0.10/mambots/content/legacybots.php --- joomla-1.0.7/mambots/content/legacybots.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/legacybots.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ \ No newline at end of file diff -urN joomla-1.0.7/mambots/content/moscode.php joomla-1.0.10/mambots/content/moscode.php --- joomla-1.0.7/mambots/content/moscode.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/moscode.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ {moscode}...some code...{/moscode} */ function botMosCode( $published, &$row, &$params, $page=0 ) { + // simple performance check to determine whether bot should process further + if ( strpos( $row->text, 'moscode' ) === false ) { + return true; + } + // define the regular expression for the bot $regex = "#{moscode}(.*?){/moscode}#s"; diff -urN joomla-1.0.7/mambots/content/mosemailcloak.php joomla-1.0.10/mambots/content/mosemailcloak.php --- joomla-1.0.7/mambots/content/mosemailcloak.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/mosemailcloak.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); + // simple performance check to determine whether bot should process further + if ( strpos( $row->text, '@' ) === false ) { + return true; + } + + // check if param query has previously been processed + if ( !isset($_MAMBOTS->_content_mambot_params['mosemailcloak']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'mosemailcloak'" + . "\n AND folder = 'content'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_content_mambot_params['mosemailcloak'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_content_mambot_params['mosemailcloak']; + $botParams = new mosParameters( $mambot->params ); $mode = $botParams->def( 'mode', 1 ); - $search = "([[:alnum:]_\.\-]+)(\@[[:alnum:]\.\-]+\.+)([[:alnum:]\.\-]+)"; - $search_text = "([[:alnum:][:space:][:punct:]][^<>]+)"; + // any@email.address.com + $search_email = "([[:alnum:]_\.\-]+)(\@[[:alnum:]\.\-]+\.+)([[:alnum:]\.\-]+)"; + // any@email.address.com?subject=anyText + $search_email_msg = "([[:alnum:]_\.\-]+)(\@[[:alnum:]\.\-]+\.+)([[:alnum:]\.\-]+)([[:alnum:][:space:][:punct:]][^\"<>]+)"; + // anyText + $search_text = "([[:alnum:][:space:][:punct:]][^<>]+)"; // search for derivativs of link code
      email@amail.com - // extra handling for inclusion of title and target attributes either side of href attribute - $searchlink = "()". $search .""; - while( eregi( $searchlink, $row->text, $regs ) ) { + $pattern = botMosEmailCloak_searchPattern( $search_email, $search_email ); + while( eregi( $pattern, $row->text, $regs ) ) { $mail = $regs[2] . $regs[3] . $regs[4]; $mail_text = $regs[5] . $regs[6] . $regs[7]; // check to see if mail text is different from mail addy if ( $mail_text ) { - $replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text ); + $replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text ); } else { - $replacement = mosHTML::emailCloaking( $mail, $mode ); + $replacement = mosHTML::emailCloaking( $mail, $mode ); } // replace the found address with the js cloacked email @@ -62,20 +78,52 @@ } // search for derivativs of link code anytext - // extra handling for inclusion of title and target attributes either side of href attribute - $searchlink = "(". $search_text .""; - while( eregi( $searchlink, $row->text, $regs ) ) { + $pattern = botMosEmailCloak_searchPattern( $search_email, $search_text ); + while( eregi( $pattern, $row->text, $regs ) ) { $mail = $regs[2] . $regs[3] . $regs[4]; $mail_text = $regs[5]; - $replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text, 0 ); + $replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text, 0 ); // replace the found address with the js cloacked email $row->text = str_replace( $regs[0], $replacement, $row->text ); } + // search for derivativs of link code email@amail.com + $pattern = botMosEmailCloak_searchPattern( $search_email_msg, $search_email ); + while( eregi( $pattern, $row->text, $regs ) ) { + $mail = $regs[2] . $regs[3] . $regs[4] . $regs[5]; + $mail_text = $regs[6] . $regs[7]. $regs[8]; + //needed for handling of Body parameter + $mail = str_replace( '&', '&', $mail ); + + // check to see if mail text is different from mail addy + if ( $mail_text ) { + $replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text ); + } else { + $replacement = mosHTML::emailCloaking( $mail, $mode ); + } + + // replace the found address with the js cloacked email + $row->text = str_replace( $regs[0], $replacement, $row->text ); + } + + // search for derivativs of link code anytext + $pattern = botMosEmailCloak_searchPattern( $search_email_msg, $search_text ); + while( eregi( $pattern, $row->text, $regs ) ) { + $mail = $regs[2] . $regs[3] . $regs[4] . $regs[5]; + $mail_text = $regs[6]; + //needed for handling of Body parameter + $mail = str_replace( '&', '&', $mail ); + + $replacement = mosHTML::emailCloaking( $mail, $mode, $mail_text, 0 ); + + // replace the found address with the js cloacked email + $row->text = str_replace( $regs[0], $replacement, $row->text ); + } + // search for plain text email@amail.com - while( eregi( $search, $row->text, $regs ) ) { + while( eregi( $search_email, $row->text, $regs ) ) { $mail = $regs[0]; $replacement = mosHTML::emailCloaking( $mail, $mode ); @@ -84,4 +132,11 @@ $row->text = str_replace( $regs[0], $replacement, $row->text ); } } + +function botMosEmailCloak_searchPattern ( $link, $text ) { + // anyText + $pattern = "(". $text .""; + + return $pattern; +} ?> \ No newline at end of file diff -urN joomla-1.0.7/mambots/content/mosimage.php joomla-1.0.10/mambots/content/mosimage.php --- joomla-1.0.7/mambots/content/mosimage.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/mosimage.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ text, 'mosimage' ) === false ) { + return true; + } // expression to search for $regex = '/{mosimage\s*.*?}/i'; @@ -47,16 +52,24 @@ // mambot only processes if there are any instances of the mambot in the text if ( $count ) { - // load mambot params info - $query = "SELECT id" - . "\n FROM #__mambots" - . "\n WHERE element = 'mosimage'" - . "\n AND folder = 'content'" - ; - $database->setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); + // check if param query has previously been processed + if ( !isset($_MAMBOTS->_content_mambot_params['mosimage']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'mosimage'" + . "\n AND folder = 'content'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_content_mambot_params['mosimage'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_content_mambot_params['mosimage']; + $botParams = new mosParameters( $mambot->params ); $botParams->def( 'padding' ); @@ -115,7 +128,7 @@ // $attrib[3] border if ( !isset($attrib[3]) || !$attrib[3] ) { - $attrib[3] = '0'; + $attrib[3] = 0; } // $attrib[4] caption @@ -162,25 +175,54 @@ $image .=' hspace="6" alt="'. $attrib[2] .'" title="'. $attrib[2] .'" border="'. $border .'" />'; // assemble caption - if caption detected - if ( $attrib[4] ) { - $caption = '
      '; + $caption = ''; + if ( $attrib[4] ) { + $caption = '
      def( 'margin' ) .'px; padding: '. $params->def( 'padding' ) .'px;'. $width .'" align="center">'; + // initialize variables + $margin = ''; + $padding = ''; + $float = ''; + $border_width = ''; + $style = ''; + if ( $params->def( 'margin' ) ) { + $margin = ' margin: '. $params->def( 'margin' ).'px;'; + } + if ( $params->def( 'padding' ) ) { + $padding = ' padding: '. $params->def( 'padding' ).'px;'; + } + if ( $attrib[1] ) { + $float = ' float: '. $attrib[1] .';'; + } + if ( $attrib[3] ) { + $border_width = ' border-width: '. $attrib[3] .'px;'; + } + + if ( $params->def( 'margin' ) || $params->def( 'padding' ) || $attrib[1] || $attrib[3] ) { + $style = ' style="'. $border_width . $float . $margin . $padding . $width .'"'; + } + + $img = '
      '; // display caption in top position - if ( $attrib[5] == 'top' ) { + if ( $attrib[5] == 'top' && $caption ) { $img .= $caption; } $img .= $image; // display caption in bottom position - if ( $attrib[5] == 'bottom' ) { + if ( $attrib[5] == 'bottom' && $caption ) { $img .= $caption; } $img .='
      '; @@ -188,7 +230,6 @@ $img = $image; } - $images[] = $img; } } diff -urN joomla-1.0.7/mambots/content/mosimage.xml joomla-1.0.10/mambots/content/mosimage.xml --- joomla-1.0.7/mambots/content/mosimage.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/mosimage.xml 2006-06-25 16:54:37.000000000 -0400 @@ -14,6 +14,6 @@ - + diff -urN joomla-1.0.7/mambots/content/mosloadposition.php joomla-1.0.10/mambots/content/mosloadposition.php --- joomla-1.0.7/mambots/content/mosloadposition.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/mosloadposition.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ text, 'mosloadposition' ) === false ) { + return true; + } + // expression to search for $regex = '/{mosloadposition\s*.*?}/i'; @@ -39,16 +44,24 @@ // mambot only processes if there are any instances of the mambot in the text if ( $count ) { - // load mambot params info - $query = "SELECT id" - . "\n FROM #__mambots" - . "\n WHERE element = 'mosloadposition'" - . "\n AND folder = 'content'" - ; - $database->setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); + // check if param query has previously been processed + if ( !isset($_MAMBOTS->_content_mambot_params['mosloadposition']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'mosloadposition'" + . "\n AND folder = 'content'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_content_mambot_params['mosloadposition'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_content_mambot_params['mosloadposition']; + $botParams = new mosParameters( $mambot->params ); $style = $botParams->def( 'style', -2 ); diff -urN joomla-1.0.7/mambots/content/mospaging.php joomla-1.0.10/mambots/content/mospaging.php --- joomla-1.0.7/mambots/content/mospaging.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/mospaging.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ text, 'mospagebreak' ) === false ) { + return true; + } + // expression to search for $regex = '/{(mospagebreak)\s*(.*?)}/i'; @@ -54,16 +59,24 @@ // we have found at least one mambot, therefore at least 2 pages if ($n > 1) { - // load mambot params info - $query = "SELECT id" - . "\n FROM #__mambots" - . "\n WHERE element = 'mospaging'" - . "\n AND folder = 'content'" - ; - $database->setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); + // check if param query has previously been processed + if ( !isset($_MAMBOTS->_content_mambot_params['mospaging']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'mospaging'" + . "\n AND folder = 'content'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_content_mambot_params['mospaging'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_content_mambot_params['mospaging']; + $botParams = new mosParameters( $mambot->params ); $title = $botParams->def( 'title', 1 ); @@ -77,7 +90,8 @@ parse_str( html_entity_decode( $matches[0][2] ), $args ); if ( @$args['heading'] ) { - $row->page_title = $args['heading']; + //$row->page_title = $args['heading']; + $row->page_title = ''; } else { $row->page_title = ''; } @@ -85,7 +99,7 @@ parse_str( html_entity_decode( $matches[$page-1][2] ), $args ); if ( @$args['title'] ) { - $row->page_title = stripslashes( $args['title'] ); + $row->page_title = ': '. stripslashes( $args['title'] ); } } } @@ -143,11 +157,11 @@ $heading = $row->title; // allows customization of first page title by checking for `heading` attribute in first bot if ( @$matches[0][2] ) { - parse_str( html_entity_decode( $matches[0][2] ), $args2 ); + parse_str( html_entity_decode( $matches[0][2] ), $args ); if ( @$args['heading'] ) { $heading = $args['heading']; - $row->title .= ': '. $heading; + $row->title .= ' - '. $heading; } } diff -urN joomla-1.0.7/mambots/content/mossef.php joomla-1.0.10/mambots/content/mossef.php --- joomla-1.0.7/mambots/content/mossef.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/mossef.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ */ function botMosSef( $published, &$row, &$params, $page=0 ) { - + global $mosConfig_sef; + // check whether mambot has been unpublished if ( !$published ) { return true; } + // check whether SEF is off + if ( !$mosConfig_sef ) { + return true; + } + + // simple performance check to determine whether bot should process further + if ( strpos( $row->text, 'href="' ) === false ) { + return true; + } + // define the regular expression for the bot $regex = "#href=\"(.*?)\"#s"; @@ -37,18 +48,52 @@ return true; } + /** * Replaces the matched tags * @param array An array of matches (see preg_match_all) * @return string */ function botMosSef_replacer( &$matches ) { - if ( substr($matches[1],0,1)=="#" ) { - // anchor - $temp = split("index.php", $_SERVER['REQUEST_URI']); - return "href=\"".sefRelToAbs("index.php".@$temp[1]).$matches[1]."\""; + // original text that might be replaced + $original = 'href="'. $matches[1] .'"'; + + // array list of non http/https URL schemes + $url_schemes = explode( ', ', _URL_SCHEMES ); + + foreach ( $url_schemes as $url ) { + // disable bot from being applied to specific URL Scheme tag + if ( strpos( $matches[1], $url ) !== false ) { + return $original; + } + } + + if ( strpos( $matches[1], 'index.php?option' ) !== false ) { + // links containing 'index.php?option + // convert url to SEF link + $link = sefRelToAbs( $matches[1] ); + // reconstruct html output + $replace = 'href="'. $link .'"'; + + return $replace; + } else if ( strpos( $matches[1], '#' ) === 0 ) { + // special handling for anchor only links + $url = $_SERVER['REQUEST_URI']; + $url = explode( '?option', $url ); + + if (is_array($url) && isset($url[1])) { + $link = 'index.php?option'. $url[1] . $matches[1]; + } else { + $link = $matches[1]; + } + // convert url to SEF link + $link = sefRelToAbs( $link ); + // reconstruct html output + $replace = 'href="'. $link .'"'; + + return $replace; } else { - return "href=\"".sefRelToAbs($matches[1])."\""; + return $original; } } ?> \ No newline at end of file diff -urN joomla-1.0.7/mambots/content/mosvote.php joomla-1.0.10/mambots/content/mosvote.php --- joomla-1.0.7/mambots/content/mosvote.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/content/mosvote.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ registerFunction( 'onBeforeDisplayContent', 'botVoting' ); function botVoting( &$row, &$params, $page=0 ) { - global $Itemid; + global $Itemid, $task; $id = $row->id; $option = 'com_content'; - $task = mosGetParam( $_REQUEST, 'task', '' ); $html = ''; if ($params->get( 'rating' ) && !$params->get( 'popup' )){ diff -urN joomla-1.0.7/mambots/editors/none.php joomla-1.0.10/mambots/editors/none.php --- joomla-1.0.7/mambots/editors/none.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/none.php 2006-06-25 16:54:36.000000000 -0400 @@ -1,6 +1,6 @@ '; + $buttons[] = ''.$result[1].''; } } $buttons = implode( "", $buttons ); - + + $width = $width . 'px'; + $height = $height . 'px'; + return <<$content +
      $buttons EOD; } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/license.txt joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/license.txt --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/license.txt 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/license.txt 1969-12-31 19:00:00.000000000 -0500 @@ -1,437 +0,0 @@ - GNU LIBRARY GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the library GPL. It is - numbered 2 because it goes with version 2 of the ordinary GPL.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Library General Public License, applies to some -specially designated Free Software Foundation software, and to any -other libraries whose authors decide to use it. You can use it for -your libraries, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if -you distribute copies of the library, or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link a program with the library, you must provide -complete object files to the recipients so that they can relink them -with the library, after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - Our method of protecting your rights has two steps: (1) copyright -the library, and (2) offer you this license which gives you legal -permission to copy, distribute and/or modify the library. - - Also, for each distributor's protection, we want to make certain -that everyone understands that there is no warranty for this free -library. If the library is modified by someone else and passed on, we -want its recipients to know that what they have is not the original -version, so that any problems introduced by others will not reflect on -the original authors' reputations. -. - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that companies distributing free -software will individually obtain patent licenses, thus in effect -transforming the program into proprietary software. To prevent this, -we have made it clear that any patent must be licensed for everyone's -free use or not licensed at all. - - Most GNU software, including some libraries, is covered by the ordinary -GNU General Public License, which was designed for utility programs. This -license, the GNU Library General Public License, applies to certain -designated libraries. This license is quite different from the ordinary -one; be sure to read it in full, and don't assume that anything in it is -the same as in the ordinary license. - - The reason we have a separate public license for some libraries is that -they blur the distinction we usually make between modifying or adding to a -program and simply using it. Linking a program with a library, without -changing the library, is in some sense simply using the library, and is -analogous to running a utility program or application program. However, in -a textual and legal sense, the linked executable is a combined work, a -derivative of the original library, and the ordinary General Public License -treats it as such. - - Because of this blurred distinction, using the ordinary General -Public License for libraries did not effectively promote software -sharing, because most developers did not use the libraries. We -concluded that weaker conditions might promote sharing better. - - However, unrestricted linking of non-free programs would deprive the -users of those programs of all benefit from the free status of the -libraries themselves. This Library General Public License is intended to -permit developers of non-free programs to use free libraries, while -preserving your freedom as a user of such programs to change the free -libraries that are incorporated in them. (We have not seen how to achieve -this as regards changes in header files, but we have achieved it as regards -changes in the actual functions of the Library.) The hope is that this -will lead to faster development of free libraries. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, while the latter only -works together with the library. - - Note that it is possible for a library to be covered by the ordinary -General Public License rather than by this special one. -. - GNU LIBRARY GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library which -contains a notice placed by the copyright holder or other authorized -party saying it may be distributed under the terms of this Library -General Public License (also called "this License"). Each licensee is -addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. -. - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. -. - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. -. - 6. As an exception to the Sections above, you may also compile or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - c) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - d) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the source code distributed need not include anything that is normally -distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. -. - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. -. - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Library General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. -. - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/_template/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/_template/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/_template/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/_template/editor_plugin.js 2006-06-25 16:54:24.000000000 -0400 @@ -1,118 +1 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('template', 'en'); // <- Add a comma separated list of all supported languages - -/**** - * Steps for creating a plugin from this template: - * - * 1. Change all "template" to the name of your plugin. - * 2. Remove all the callbacks in this file that you don't need. - * 3. Remove the popup.htm file if you don't need any popups. - * 4. Add your custom logic to the callbacks you needed. - * 5. Write documentation in a readme.txt file on how to use the plugin. - * 6. Upload it under the "Plugins" section at sourceforge. - * - ****/ - -/** - * Gets executed when a editor instance is initialized - */ -function TinyMCE_template_initInstance(inst) { - // You can take out plugin specific parameters - alert("Initialization parameter:" + tinyMCE.getParam("template_someparam", false)); -} - -/** - * Gets executed when a editor needs to generate a button. - */ -function TinyMCE_template_getControlHTML(control_name) { - switch (control_name) { - case "template": - return ''; - } - - return ""; -} - -/** - * Gets executed when a command is called. - */ -function TinyMCE_template_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - // Remember to have the "mce" prefix for commands so they don't intersect with built in ones in the browser. - case "mceTemplate": - // Show UI/Popup - if (user_interface) { - // Open a popup window and send in some custom data in a window argument - var template = new Array(); - - template['file'] = '../../plugins/template/popup.htm'; // Relative to theme - template['width'] = 300; - template['height'] = 200; - - tinyMCE.openWindow(template, {editor_id : editor_id, some_custom_arg : "somecustomdata"}); - - // Let TinyMCE know that something was modified - tinyMCE.triggerNodeChange(false); - } else { - // Do a command this gets called from the template popup - alert("execCommand: mceTemplate gets called from popup."); - } - - return true; - } - - // Pass to next handler in chain - return false; -} - -/** - * Gets executed when the selection/cursor position was changed. - */ -function TinyMCE_template_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - // Deselect template button - tinyMCE.switchClassSticky(editor_id + '_template', 'mceButtonNormal'); - - // Select template button if parent node is a strong or b - if (node.parentNode.nodeName == "STRONG" || node.parentNode.nodeName == "B") - tinyMCE.switchClassSticky(editor_id + '_template', 'mceButtonSelected'); - - return true; -} - -/** - * Gets executed when contents is inserted / retrived. - */ -function TinyMCE_template_cleanup(type, content) { - switch (type) { - case "get_from_editor": - alert("[FROM] Value HTML string: " + content); - - // Do custom cleanup code here - - break; - - case "insert_to_editor": - alert("[TO] Value HTML string: " + content); - - // Do custom cleanup code here - - break; - - case "get_from_editor_dom": - alert("[FROM] Value DOM Element " + content.innerHTML); - - // Do custom cleanup code here - - break; - - case "insert_to_editor_dom": - alert("[TO] Value DOM Element: " + content.innerHTML); - - // Do custom cleanup code here - - break; - } - - return content; -} +tinyMCE.importPluginLanguagePack('template','en,tr,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl');var TinyMCE_TemplatePlugin={getInfo:function(){return{longname:'Template plugin',author:'Your name',authorurl:'http://www.yoursite.com',infourl:'http://www.yoursite.com/docs/template.html',version:"1.0"};},initInstance:function(inst){alert("Initialization parameter:"+tinyMCE.getParam("template_someparam",false));inst.addShortcut('ctrl','t','lang_template_desc','mceTemplate');},getControlHTML:function(cn){switch(cn){case"template":return tinyMCE.getButtonHTML(cn,'lang_template_desc','{$pluginurl}/images/template.gif','mceTemplate',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceTemplate":if(user_interface){var template=new Array();template['file']='../../plugins/template/popup.htm';template['width']=300;template['height']=200;tinyMCE.openWindow(template,{editor_id:editor_id,some_custom_arg:"somecustomdata"});tinyMCE.triggerNodeChange(false);}else{alert("execCommand: mceTemplate gets called from popup.");}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node.parentNode.nodeName=="STRONG"||node.parentNode.nodeName=="B"){tinyMCE.switchClass(editor_id+'_template','mceButtonSelected');return true;}tinyMCE.switchClass(editor_id+'_template','mceButtonNormal');},setupContent:function(editor_id,body,doc){},onChange:function(inst){},handleEvent:function(e){top.status="template plugin event: "+e.type;return true;},cleanup:function(type,content,inst){switch(type){case"get_from_editor":alert("[FROM] Value HTML string: "+content);break;case"insert_to_editor":alert("[TO] Value HTML string: "+content);break;case"get_from_editor_dom":alert("[FROM] Value DOM Element "+content.innerHTML);break;case"insert_to_editor_dom":alert("[TO] Value DOM Element: "+content.innerHTML);break;}return content;},_someInternalFunction:function(a,b){return 1;}};tinyMCE.addPlugin("template",TinyMCE_TemplatePlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/_template/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/_template/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/_template/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/_template/editor_plugin_src.js 2006-06-25 16:54:24.000000000 -0400 @@ -1,5 +1,14 @@ +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.12 $ + * $Date: 2006/02/22 20:06:23 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + /* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('template', 'en,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl'); // <- Add a comma separated list of all supported languages +tinyMCE.importPluginLanguagePack('template', 'en,tr,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl'); // <- Add a comma separated list of all supported languages /**** * Steps for creating a plugin from this template: @@ -13,120 +22,217 @@ * ****/ -/** - * Information about the plugin. - */ -function TinyMCE_template_getInfo() { - return { - longname : 'Template plugin', - author : 'Your name', - authorurl : 'http://www.yoursite.com', - infourl : 'http://www.yoursite.com/docs/template.html', - version : "1.0" - }; -}; - -/** - * Gets executed when a editor instance is initialized - */ -function TinyMCE_template_initInstance(inst) { - // You can take out plugin specific parameters - alert("Initialization parameter:" + tinyMCE.getParam("template_someparam", false)); -} - -/** - * Gets executed when a editor needs to generate a button. - */ -function TinyMCE_template_getControlHTML(control_name) { - switch (control_name) { - case "template": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceTemplate\', true);return false;'; - return '
      '; - } - - return ""; -} - -/** - * Gets executed when a command is called. - */ -function TinyMCE_template_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - // Remember to have the "mce" prefix for commands so they don't intersect with built in ones in the browser. - case "mceTemplate": - // Show UI/Popup - if (user_interface) { - // Open a popup window and send in some custom data in a window argument - var template = new Array(); - - template['file'] = '../../plugins/template/popup.htm'; // Relative to theme - template['width'] = 300; - template['height'] = 200; - - tinyMCE.openWindow(template, {editor_id : editor_id, some_custom_arg : "somecustomdata"}); - - // Let TinyMCE know that something was modified - tinyMCE.triggerNodeChange(false); - } else { - // Do a command this gets called from the template popup - alert("execCommand: mceTemplate gets called from popup."); - } - +// Singleton class +var TinyMCE_TemplatePlugin = { + /** + * Returns information about the plugin as a name/value array. + * The current keys are longname, author, authorurl, infourl and version. + * + * @returns Name/value array containing information about the plugin. + * @type Array + */ + getInfo : function() { + return { + longname : 'Template plugin', + author : 'Your name', + authorurl : 'http://www.yoursite.com', + infourl : 'http://www.yoursite.com/docs/template.html', + version : "1.0" + }; + }, + + /** + * Gets executed when a TinyMCE editor instance is initialized. + * + * @param {TinyMCE_Control} Initialized TinyMCE editor control instance. + */ + initInstance : function(inst) { + // You can take out plugin specific parameters + alert("Initialization parameter:" + tinyMCE.getParam("template_someparam", false)); + + // Register custom keyboard shortcut + inst.addShortcut('ctrl', 't', 'lang_template_desc', 'mceTemplate'); + }, + + /** + * Returns the HTML code for a specific control or empty string if this plugin doesn't have that control. + * A control can be a button, select list or any other HTML item to present in the TinyMCE user interface. + * The variable {$editor_id} will be replaced with the current editor instance id and {$pluginurl} will be replaced + * with the URL of the plugin. Language variables such as {$lang_somekey} will also be replaced with contents from + * the language packs. + * + * @param {string} cn Editor control/button name to get HTML for. + * @return HTML code for a specific control or empty string. + * @type string + */ + getControlHTML : function(cn) { + switch (cn) { + case "template": + return tinyMCE.getButtonHTML(cn, 'lang_template_desc', '{$pluginurl}/images/template.gif', 'mceTemplate', true); + } + + return ""; + }, + + /** + * Executes a specific command, this function handles plugin commands. + * + * @param {string} editor_id TinyMCE editor instance id that issued the command. + * @param {HTMLElement} element Body or root element for the editor instance. + * @param {string} command Command name to be executed. + * @param {string} user_interface True/false if a user interface should be presented. + * @param {mixed} value Custom value argument, can be anything. + * @return true/false if the command was executed by this plugin or not. + * @type + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + // Remember to have the "mce" prefix for commands so they don't intersect with built in ones in the browser. + case "mceTemplate": + // Show UI/Popup + if (user_interface) { + // Open a popup window and send in some custom data in a window argument + var template = new Array(); + + template['file'] = '../../plugins/template/popup.htm'; // Relative to theme + template['width'] = 300; + template['height'] = 200; + + tinyMCE.openWindow(template, {editor_id : editor_id, some_custom_arg : "somecustomdata"}); + + // Let TinyMCE know that something was modified + tinyMCE.triggerNodeChange(false); + } else { + // Do a command this gets called from the template popup + alert("execCommand: mceTemplate gets called from popup."); + } + + return true; + } + + // Pass to next handler in chain + return false; + }, + + /** + * Gets called ones the cursor/selection in a TinyMCE instance changes. This is useful to enable/disable + * button controls depending on where the user are and what they have selected. This method gets executed + * alot and should be as performance tuned as possible. + * + * @param {string} editor_id TinyMCE editor instance id that was changed. + * @param {HTMLNode} node Current node location, where the cursor is in the DOM tree. + * @param {int} undo_index The current undo index, if this is -1 custom undo/redo is disabled. + * @param {int} undo_levels The current undo levels, if this is -1 custom undo/redo is disabled. + * @param {boolean} visual_aid Is visual aids enabled/disabled ex: dotted lines on tables. + * @param {boolean} any_selection Is there any selection at all or is there only a cursor. + */ + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + // Select template button if parent node is a strong or b + if (node.parentNode.nodeName == "STRONG" || node.parentNode.nodeName == "B") { + tinyMCE.switchClass(editor_id + '_template', 'mceButtonSelected'); return true; - } + } - // Pass to next handler in chain - return false; -} - -/** - * Gets executed when the selection/cursor position was changed. - */ -function TinyMCE_template_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - // Deselect template button - tinyMCE.switchClassSticky(editor_id + '_template', 'mceButtonNormal'); - - // Select template button if parent node is a strong or b - if (node.parentNode.nodeName == "STRONG" || node.parentNode.nodeName == "B") - tinyMCE.switchClassSticky(editor_id + '_template', 'mceButtonSelected'); - - return true; -} - -/** - * Gets executed when contents is inserted / retrived. - */ -function TinyMCE_template_cleanup(type, content) { - switch (type) { - case "get_from_editor": - alert("[FROM] Value HTML string: " + content); - - // Do custom cleanup code here - - break; - - case "insert_to_editor": - alert("[TO] Value HTML string: " + content); - - // Do custom cleanup code here - - break; - - case "get_from_editor_dom": - alert("[FROM] Value DOM Element " + content.innerHTML); - - // Do custom cleanup code here - - break; - - case "insert_to_editor_dom": - alert("[TO] Value DOM Element: " + content.innerHTML); - - // Do custom cleanup code here - - break; + // Deselect template button + tinyMCE.switchClass(editor_id + '_template', 'mceButtonNormal'); + }, + + /** + * Gets called when a TinyMCE editor instance gets filled with content on startup. + * + * @param {string} editor_id TinyMCE editor instance id that was filled with content. + * @param {HTMLElement} body HTML body element of editor instance. + * @param {HTMLDocument} doc HTML document instance. + */ + setupContent : function(editor_id, body, doc) { + }, + + /** + * Gets called when the contents of a TinyMCE area is modified, in other words when a undo level is + * added. + * + * @param {TinyMCE_Control} inst TinyMCE editor area control instance that got modified. + */ + onChange : function(inst) { + }, + + /** + * Gets called when TinyMCE handles events such as keydown, mousedown etc. TinyMCE + * doesn't listen on all types of events so custom event handling may be required for + * some purposes. + * + * @param {Event} e HTML editor event reference. + * @return true - pass to next handler in chain, false - stop chain execution + * @type boolean + */ + handleEvent : function(e) { + // Display event type in statusbar + top.status = "template plugin event: " + e.type; + + return true; // Pass to next handler + }, + + /** + * Gets called when HTML contents is inserted or retrived from a TinyMCE editor instance. + * The type parameter contains what type of event that was performed and what format the content is in. + * Possible valuses for type is get_from_editor, insert_to_editor, get_from_editor_dom, insert_to_editor_dom. + * + * @param {string} type Cleanup event type. + * @param {mixed} content Editor contents that gets inserted/extracted can be a string or DOM element. + * @param {TinyMCE_Control} inst TinyMCE editor instance control that performes the cleanup. + * @return New content or the input content depending on action. + * @type string + */ + cleanup : function(type, content, inst) { + switch (type) { + case "get_from_editor": + alert("[FROM] Value HTML string: " + content); + + // Do custom cleanup code here + + break; + + case "insert_to_editor": + alert("[TO] Value HTML string: " + content); + + // Do custom cleanup code here + + break; + + case "get_from_editor_dom": + alert("[FROM] Value DOM Element " + content.innerHTML); + + // Do custom cleanup code here + + break; + + case "insert_to_editor_dom": + alert("[TO] Value DOM Element: " + content.innerHTML); + + // Do custom cleanup code here + + break; + } + + return content; + }, + + // Private plugin internal methods + + /** + * This is just a internal plugin method, prefix all internal methods with a _ character. + * The prefix is needed so they doesn't collide with future TinyMCE callback functions. + * + * @param {string} a Some arg1. + * @param {string} b Some arg2. + * @return Some return. + * @type string + */ + _someInternalFunction : function(a, b) { + return 1; } +}; - return content; -} +// Adds the plugin class to the list of available TinyMCE plugins +tinyMCE.addPlugin("template", TinyMCE_TemplatePlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/css/advhr.css 2006-06-25 16:54:24.000000000 -0400 @@ -0,0 +1,23 @@ +input.radio { + border: 1px none #000000; + background-color: transparent; + vertical-align: middle; +} + +.panel_wrapper div.current { + height: 80px; +} + +#width { + width: 50px; + vertical-align: middle; +} + +#width2 { + width: 50px; + vertical-align: middle; +} + +#size { + width: 100px; +} diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/css/index.html joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/css/index.html --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/css/index.html 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/css/index.html 2006-06-25 16:54:24.000000000 -0400 @@ -0,0 +1 @@ + \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin.js 2006-06-25 16:54:24.000000000 -0400 @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('advhr','en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_advhr_getInfo(){return{longname:'Advanced HR',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_advhr_getControlHTML(control_name){switch(control_name){case "advhr":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvancedHr\');return false;';return '';}return "";}function TinyMCE_advhr_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceAdvancedHr":var template=new Array();template['file']='../../plugins/advhr/rule.htm';template['width']=270;template['height']=180;template['width']+=tinyMCE.getLang('lang_advhr_delta_width',0);template['height']+=tinyMCE.getLang('lang_advhr_delta_height',0);var size="",width="",noshade="";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="hr"){tinyMCE.hrElement=tinyMCE.selectedElement;if(tinyMCE.hrElement){size=tinyMCE.hrElement.getAttribute('size')?tinyMCE.hrElement.getAttribute('size'):"";width=tinyMCE.hrElement.getAttribute('width')?tinyMCE.hrElement.getAttribute('width'):"";noshade=tinyMCE.hrElement.getAttribute('noshade')?tinyMCE.hrElement.getAttribute('noshade'):"";}tinyMCE.openWindow(template,{editor_id:editor_id,size:size,width:width,noshade:noshade,mceDo:'update'});}else{if(tinyMCE.isMSIE){tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,'
      ');}else{tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",size:size,width:width,noshade:noshade,mceDo:'insert'});}}return true;}return false;}function TinyMCE_advhr_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){tinyMCE.switchClassSticky(editor_id+'_advhr','mceButtonNormal');if(node==null)return;do{if(node.nodeName.toLowerCase()=="hr")tinyMCE.switchClassSticky(editor_id+'_advhr','mceButtonSelected');}while((node=node.parentNode));return true;} \ No newline at end of file +tinyMCE.importPluginLanguagePack('advhr','en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_AdvancedHRPlugin={getInfo:function(){return{longname:'Advanced HR',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion}},getControlHTML:function(cn){switch(cn){case"advhr":return tinyMCE.getButtonHTML(cn,'lang_insert_advhr_desc','{$pluginurl}/images/advhr.gif','mceAdvancedHr');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvancedHr":var template=new Array();template['file']='../../plugins/advhr/rule.htm';template['width']=250;template['height']=160;template['width']+=tinyMCE.getLang('lang_advhr_delta_width',0);template['height']+=tinyMCE.getLang('lang_advhr_delta_height',0);var size="",width="",noshade="";if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="hr"){tinyMCE.hrElement=tinyMCE.selectedElement;if(tinyMCE.hrElement){size=tinyMCE.hrElement.getAttribute('size')?tinyMCE.hrElement.getAttribute('size'):"";width=tinyMCE.hrElement.getAttribute('width')?tinyMCE.hrElement.getAttribute('width'):"";noshade=tinyMCE.hrElement.getAttribute('noshade')?tinyMCE.hrElement.getAttribute('noshade'):"";}tinyMCE.openWindow(template,{editor_id:editor_id,size:size,width:width,noshade:noshade,mceDo:'update'});}else{if(tinyMCE.isMSIE){tinyMCE.execInstanceCommand(editor_id,'mceInsertContent',false,'
      ');}else{tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",size:size,width:width,noshade:noshade,mceDo:'insert'});}}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="HR"){tinyMCE.switchClass(editor_id+'_advhr','mceButtonSelected');return true;}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_advhr','mceButtonNormal');return true;}};tinyMCE.addPlugin("advhr",TinyMCE_AdvancedHRPlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/editor_plugin_src.js 2006-06-25 16:54:24.000000000 -0400 @@ -1,75 +1,92 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('advhr', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk'); +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.19 $ + * $Date: 2006/02/10 16:29:37 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ -function TinyMCE_advhr_getInfo() { - return { - longname : 'Advanced HR', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('advhr', 'en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk'); -function TinyMCE_advhr_getControlHTML(control_name) { - switch (control_name) { - case "advhr": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvancedHr\');return false;'; - return ''; - } +var TinyMCE_AdvancedHRPlugin = { + getInfo : function() { + return { + longname : 'Advanced HR', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advhr.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + } + }, + + getControlHTML : function(cn) { + switch (cn) { + case "advhr": + return tinyMCE.getButtonHTML(cn, 'lang_insert_advhr_desc', '{$pluginurl}/images/advhr.gif', 'mceAdvancedHr'); + } + + return ""; + }, + + /** + * Executes the mceAdvanceHr command. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceAdvancedHr": + var template = new Array(); + + template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme + template['width'] = 250; + template['height'] = 160; + + template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0); + + var size = "", width = "", noshade = ""; + if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr") { + tinyMCE.hrElement = tinyMCE.selectedElement; + + if (tinyMCE.hrElement) { + size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : ""; + width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : ""; + noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : ""; + } + + tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'}); + } else { + if (tinyMCE.isMSIE) { + tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'
      '); + } else { + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'}); + } + } + + return true; + } + + // Pass to next handler in chain + return false; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + if (node == null) + return; + + do { + if (node.nodeName == "HR") { + tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonSelected'); + return true; + } + } while ((node = node.parentNode)); - return ""; -} + tinyMCE.switchClass(editor_id + '_advhr', 'mceButtonNormal'); -/** - * Executes the mceAdvanceHr command. - */ -function TinyMCE_advhr_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mceAdvancedHr": - var template = new Array(); - - template['file'] = '../../plugins/advhr/rule.htm'; // Relative to theme - template['width'] = 270; - template['height'] = 180; - - template['width'] += tinyMCE.getLang('lang_advhr_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_advhr_delta_height', 0); - - var size = "", width = "", noshade = ""; - if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "hr"){ - tinyMCE.hrElement = tinyMCE.selectedElement; - if (tinyMCE.hrElement) { - size = tinyMCE.hrElement.getAttribute('size') ? tinyMCE.hrElement.getAttribute('size') : ""; - width = tinyMCE.hrElement.getAttribute('width') ? tinyMCE.hrElement.getAttribute('width') : ""; - noshade = tinyMCE.hrElement.getAttribute('noshade') ? tinyMCE.hrElement.getAttribute('noshade') : ""; - } - tinyMCE.openWindow(template, {editor_id : editor_id, size : size, width : width, noshade : noshade, mceDo : 'update'}); - } else { - if (tinyMCE.isMSIE) { - tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false,'
      '); - } else { - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", size : size, width : width, noshade : noshade, mceDo : 'insert'}); - } - } - - return true; - } - // Pass to next handler in chain - return false; -} - -function TinyMCE_advhr_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - tinyMCE.switchClassSticky(editor_id + '_advhr', 'mceButtonNormal'); - - if (node == null) - return; - - do { - if (node.nodeName.toLowerCase() == "hr") - tinyMCE.switchClassSticky(editor_id + '_advhr', 'mceButtonSelected'); - } while ((node = node.parentNode)); + return true; + } +}; - return true; -} \ No newline at end of file +tinyMCE.addPlugin("advhr", TinyMCE_AdvancedHRPlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/jscripts/rule.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/jscripts/rule.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/jscripts/rule.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/jscripts/rule.js 2006-06-25 16:54:24.000000000 -0400 @@ -2,7 +2,7 @@ var formObj = document.forms[0]; formObj.width.value = tinyMCE.getWindowArg('width'); formObj.size.value = tinyMCE.getWindowArg('size'); - formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('mceDo')); + formObj.insert.value = tinyMCE.getLang('lang_' + tinyMCE.getWindowArg('mceDo'),'Insert',true); if (tinyMCE.getWindowArg('noshade')) { formObj.noshade.checked = true; } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/langs/en.js 2006-06-25 16:54:24.000000000 -0400 @@ -1,7 +1,7 @@ // UK lang variables tinyMCE.addToLang('',{ -insert_advhr_desc : 'Insert / edit Horizontale Rule', +insert_advhr_desc : 'Horizontale rule', insert_advhr_width : 'Width', insert_advhr_size : 'Height', insert_advhr_noshade : 'No shadow' diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advhr/rule.htm 2006-06-25 16:54:24.000000000 -0400 @@ -1,40 +1,36 @@ - {$lang_insert_link_title} + {$lang_insert_advhr_desc} - + + -
      - - - - -
      + + + +
      +
      +
      - - - - + - - + - + - - - - -
      {$lang_insert_advhr_desc}
      {$lang_insert_advhr_width}: - - +
      {$lang_insert_advhr_size}:
      -
      + +
      +
      + +
      +
      + +
      + +
      + +
      +
      + diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advimage/css/advimage.css 2006-06-25 16:54:24.000000000 -0400 @@ -17,7 +17,7 @@ } .checkbox { - border: 0px; + border: 0; } .panel_wrapper div.current { @@ -25,11 +25,11 @@ } #prev { - margin:0px; + margin: 0; border: 1px solid black; width: 99%; - height:150px; + height: 150px; overflow: auto; } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advimage/editor_plugin.js 2006-06-25 16:54:24.000000000 -0400 @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('advimage','en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_advimage_getInfo(){return{longname:'Advanced image',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advimage.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_advimage_getControlHTML(control_name){switch(control_name){case "image":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvImage\');return false;';return '';}return "";}function TinyMCE_advimage_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceAdvImage":var template=new Array();template['file']='../../plugins/advimage/image.htm';template['width']=480;template['height']=380;template['width']+=tinyMCE.getLang('lang_advimage_delta_width',0);template['height']+=tinyMCE.getLang('lang_advimage_delta_height',0);var inst=tinyMCE.getInstanceById(editor_id);var elm=inst.getFocusElement();if(elm!=null&&tinyMCE.getAttrib(elm,'class').indexOf('mceItem')!=-1)return true;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;}return false;}function TinyMCE_advimage_cleanup(type,content){switch(type){case "insert_to_editor_dom":var imgs=content.getElementsByTagName("img");for(var i=0;i'; - } + var inst = tinyMCE.getInstanceById(editor_id); + var elm = inst.getFocusElement(); - return ""; -} + if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1) + return true; -function TinyMCE_advimage_execCommand(editor_id, element, command, user_interface, value) { - switch (command) { - case "mceAdvImage": - var template = new Array(); - - template['file'] = '../../plugins/advimage/image.htm'; - template['width'] = 480; - template['height'] = 380; - - // Language specific width and height addons - template['width'] += tinyMCE.getLang('lang_advimage_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_advimage_delta_height', 0); + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); - var inst = tinyMCE.getInstanceById(editor_id); - var elm = inst.getFocusElement(); - - if (elm != null && tinyMCE.getAttrib(elm, 'class').indexOf('mceItem') != -1) return true; + } - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); + return false; + }, - return true; - } + cleanup : function(type, content) { + switch (type) { + case "insert_to_editor_dom": + var imgs = content.getElementsByTagName("img"); + for (var i=0; i/g, '&gr;'); + value = value.replace(/>/g, '>'); return ' ' + attrib + '="' + value + '"'; } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin.js 2006-06-25 16:54:22.000000000 -0400 @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('advlink','en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_advlink_getInfo(){return{longname:'Advanced link',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advlink.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_advlink_getControlHTML(control_name){switch(control_name){case "link":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvLink\');return false;';return '';}return "";}function TinyMCE_advlink_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceAdvLink":var anySelection=false;var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();if(tinyMCE.selectedElement)anySelection=(tinyMCE.selectedElement.nodeName.toLowerCase()=="img")||(selectedText&&selectedText.length>0);if(anySelection||(focusElm!=null&&focusElm.nodeName=="A")){var template=new Array();template['file']='../../plugins/advlink/link.htm';template['width']=480;template['height']=400;template['width']+=tinyMCE.getLang('lang_advlink_delta_width',0);template['height']+=tinyMCE.getLang('lang_advlink_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});}return true;}return false;}function TinyMCE_advlink_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){tinyMCE.switchClassSticky(editor_id+'_advlink','mceButtonDisabled',true);if(node==null)return;if(any_selection)tinyMCE.switchClassSticky(editor_id+'_advlink','mceButtonNormal',false);do{if(node.nodeName=="A"&&tinyMCE.getAttrib(node,'href')!="")tinyMCE.switchClassSticky(editor_id+'_advlink','mceButtonSelected',false);}while((node=node.parentNode));return true;} \ No newline at end of file +tinyMCE.importPluginLanguagePack('advlink','en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk,da');var TinyMCE_AdvancedLinkPlugin={getInfo:function(){return{longname:'Advanced link',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_advlink.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){inst.addShortcut('ctrl','k','lang_advlink_desc','mceAdvLink');},getControlHTML:function(cn){switch(cn){case"link":return tinyMCE.getButtonHTML(cn,'lang_link_desc','{$themeurl}/images/link.gif','mceAdvLink');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceAdvLink":var anySelection=false;var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();var selectedText=inst.selection.getSelectedText();if(tinyMCE.selectedElement)anySelection=(tinyMCE.selectedElement.nodeName.toLowerCase()=="img")||(selectedText&&selectedText.length>0);if(anySelection||(focusElm!=null&&focusElm.nodeName=="A")){var template=new Array();template['file']='../../plugins/advlink/link.htm';template['width']=480;template['height']=400;template['width']+=tinyMCE.getLang('lang_advlink_delta_width',0);template['height']+=tinyMCE.getLang('lang_advlink_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="A"&&tinyMCE.getAttrib(node,'href')!=""){tinyMCE.switchClass(editor_id+'_advlink','mceButtonSelected');return true;}}while((node=node.parentNode));if(any_selection){tinyMCE.switchClass(editor_id+'_advlink','mceButtonNormal');return true;}tinyMCE.switchClass(editor_id+'_advlink','mceButtonDisabled');return true;}};tinyMCE.addPlugin("advlink",TinyMCE_AdvancedLinkPlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/editor_plugin_src.js 2006-06-25 16:54:22.000000000 -0400 @@ -1,69 +1,90 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('advlink', 'en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk'); - -function TinyMCE_advlink_getInfo() { - return { - longname : 'Advanced link', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advlink.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.24 $ + * $Date: 2006/02/10 16:29:38 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ -function TinyMCE_advlink_getControlHTML(control_name) { - switch (control_name) { - case "link": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceAdvLink\');return false;'; - return ''; - } - - return ""; -} - -function TinyMCE_advlink_execCommand(editor_id, element, command, user_interface, value) { - switch (command) { - case "mceAdvLink": - var anySelection = false; - var inst = tinyMCE.getInstanceById(editor_id); - var focusElm = inst.getFocusElement(); - - if (tinyMCE.selectedElement) - anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0); - - if (anySelection || (focusElm != null && focusElm.nodeName == "A")) { - var template = new Array(); - - template['file'] = '../../plugins/advlink/link.htm'; - template['width'] = 480; - template['height'] = 400; - - // Language specific width and height addons - template['width'] += tinyMCE.getLang('lang_advlink_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_advlink_delta_height', 0); +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('advlink', 'en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,cy,es,is,zh_tw,zh_tw_utf8,sk,da'); - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); +var TinyMCE_AdvancedLinkPlugin = { + getInfo : function() { + return { + longname : 'Advanced link', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_advlink.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + initInstance : function(inst) { + inst.addShortcut('ctrl', 'k', 'lang_advlink_desc', 'mceAdvLink'); + }, + + getControlHTML : function(cn) { + switch (cn) { + case "link": + return tinyMCE.getButtonHTML(cn, 'lang_link_desc', '{$themeurl}/images/link.gif', 'mceAdvLink'); + } + + return ""; + }, + + execCommand : function(editor_id, element, command, user_interface, value) { + switch (command) { + case "mceAdvLink": + var anySelection = false; + var inst = tinyMCE.getInstanceById(editor_id); + var focusElm = inst.getFocusElement(); + var selectedText = inst.selection.getSelectedText(); + + if (tinyMCE.selectedElement) + anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0); + + if (anySelection || (focusElm != null && focusElm.nodeName == "A")) { + var template = new Array(); + + template['file'] = '../../plugins/advlink/link.htm'; + template['width'] = 480; + template['height'] = 400; + + // Language specific width and height addons + template['width'] += tinyMCE.getLang('lang_advlink_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_advlink_delta_height', 0); + + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); + } + + return true; + } + + return false; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + if (node == null) + return; + + do { + if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "") { + tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonSelected'); + return true; } + } while ((node = node.parentNode)); + if (any_selection) { + tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonNormal'); return true; - } - - return false; -} - -function TinyMCE_advlink_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - tinyMCE.switchClassSticky(editor_id + '_advlink', 'mceButtonDisabled', true); + } - if (node == null) - return; + tinyMCE.switchClass(editor_id + '_advlink', 'mceButtonDisabled'); - if (any_selection) - tinyMCE.switchClassSticky(editor_id + '_advlink', 'mceButtonNormal', false); - - do { - if (node.nodeName == "A" && tinyMCE.getAttrib(node, 'href') != "") - tinyMCE.switchClassSticky(editor_id + '_advlink', 'mceButtonSelected', false); - } while ((node = node.parentNode)); + return true; + } +}; - return true; -} +tinyMCE.addPlugin("advlink", TinyMCE_AdvancedLinkPlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/jscripts/functions.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/jscripts/functions.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/jscripts/functions.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/jscripts/functions.js 2006-06-25 16:54:22.000000000 -0400 @@ -146,7 +146,8 @@ if (onclick.indexOf('return false;') != -1) { formObj.popupreturn.checked = true; onclick = onclick.replace('return false;', ''); - } + } else + formObj.popupreturn.checked = false; var onClickData = parseLink(onclick); @@ -355,6 +356,9 @@ // tinyMCE.debug(onclick); formObj.onclick.value = onclick; + + if (formObj.href.value == "") + formObj.href.value = url; } function setAttrib(elm, attrib, value) { @@ -416,7 +420,7 @@ // Create new anchor elements if (elm == null) { if (tinyMCE.isSafari) - tinyMCEPopup.execCommand("mceInsertContent", false, '' + inst.getSelectedHTML() + ''); + tinyMCEPopup.execCommand("mceInsertContent", false, '' + inst.selection.getSelectedHTML() + ''); else tinyMCEPopup.execCommand("createlink", false, "#mce_temp_url#"); @@ -460,11 +464,11 @@ var target = getSelectValue(formObj, 'targetlist'); // Make anchors absolute - if (href.charAt(0) == '#') + if (href.charAt(0) == '#' && tinyMCE.getParam('convert_urls')) href = tinyMCE.settings['document_base_url'] + href; setAttrib(elm, 'href', convertURL(href, elm)); - setAttrib(elm, 'mce_href', href); + //setAttrib(elm, 'mce_href', href); setAttrib(elm, 'title'); setAttrib(elm, 'target', target == '_self' ? '' : target); setAttrib(elm, 'id'); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/advlink/link.htm 2006-06-25 16:54:22.000000000 -0400 @@ -126,7 +126,7 @@ - + diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin.js 2006-06-25 16:54:22.000000000 -0400 @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('autosave','en,sv,cs,he,nb,hu,de,da,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl,pt_br');function TinyMCE_autosave_getInfo(){return{longname:'Auto save',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_autosave_beforeUnloadHandler(){var msg=tinyMCE.getLang("lang_autosave_unload_msg");var anyDirty=false;for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(inst.isDirty())return msg;}return;}window.onbeforeunload=TinyMCE_autosave_beforeUnloadHandler; \ No newline at end of file +tinyMCE.importPluginLanguagePack('autosave','en,tr,sv,cs,he,nb,hu,de,da,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl,pt_br');var TinyMCE_AutoSavePlugin={getInfo:function(){return{longname:'Auto save',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},_beforeUnloadHandler:function(){var n,inst,anyDirty=false,msg=tinyMCE.getLang("lang_autosave_unload_msg");if(tinyMCE.getParam("fullscreen_is_enabled"))return;for(n in tinyMCE.instances){inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(inst.isDirty())return msg;}return;}};window.onbeforeunload=TinyMCE_AutoSavePlugin._beforeUnloadHandler;tinyMCE.addPlugin("autosave",TinyMCE_AutoSavePlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/autosave/editor_plugin_src.js 2006-06-25 16:54:22.000000000 -0400 @@ -1,30 +1,48 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('autosave', 'en,sv,cs,he,nb,hu,de,da,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl,pt_br'); - -function TinyMCE_autosave_getInfo() { - return { - longname : 'Auto save', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.11 $ + * $Date: 2006/03/22 12:21:21 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ -function TinyMCE_autosave_beforeUnloadHandler() { - var msg = tinyMCE.getLang("lang_autosave_unload_msg"); +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('autosave', 'en,tr,sv,cs,he,nb,hu,de,da,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,pl,pt_br'); - var anyDirty = false; - for (var n in tinyMCE.instances) { - var inst = tinyMCE.instances[n]; - if (!tinyMCE.isInstance(inst)) - continue; +var TinyMCE_AutoSavePlugin = { + getInfo : function() { + return { + longname : 'Auto save', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + // Private plugin internal methods + + _beforeUnloadHandler : function() { + var n, inst, anyDirty = false, msg = tinyMCE.getLang("lang_autosave_unload_msg"); + + if (tinyMCE.getParam("fullscreen_is_enabled")) + return; + + for (n in tinyMCE.instances) { + inst = tinyMCE.instances[n]; + + if (!tinyMCE.isInstance(inst)) + continue; + + if (inst.isDirty()) + return msg; + } - if (inst.isDirty()) - return msg; + return; } +}; - return; -} +window.onbeforeunload = TinyMCE_AutoSavePlugin._beforeUnloadHandler; -window.onbeforeunload = TinyMCE_autosave_beforeUnloadHandler; +tinyMCE.addPlugin("autosave", TinyMCE_AutoSavePlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/cleanup/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/cleanup/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/cleanup/editor_plugin_src.js 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/cleanup/editor_plugin_src.js 2006-06-25 16:54:22.000000000 -0400 @@ -0,0 +1,12 @@ +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.10 $ + * $Date: 2006/02/10 16:29:38 $ + * + * Experimental plugin for new Cleanup routine, this logic will be moved into the core ones it's stable enougth. + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +/* Dummy file since cleanup is now moved to core */ diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/cleanup/index.html joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/cleanup/index.html --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/cleanup/index.html 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/cleanup/index.html 2006-06-25 16:54:22.000000000 -0400 @@ -0,0 +1 @@ + \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/css/contextmenu.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/css/contextmenu.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/css/contextmenu.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/css/contextmenu.css 2006-06-25 16:54:24.000000000 -0400 @@ -1,7 +1,7 @@ .contextMenuIEPopup { - padding: 0px; - margin: 0px; - border: 0px; + padding: 0; + margin: 0; + border: 0; overflow: hidden; } @@ -16,18 +16,14 @@ .contextMenuItem, .contextMenuItemOver { } -.contextMenuItemOver { - background-color: #B6BDD2; -} - .contextMenuSeparator { width: 100%; background-color: #D4D0C8; - border: 0px; + border: 0; } .contextMenuImage, .contextMenuItemDisabled { - border: 0px; + border: 0; } .contextMenuIcon { @@ -51,10 +47,28 @@ .contextMenuText { font-family: Tahoma, Verdana, Arial, Helvetica; font-size: 11px; - margin-left: 5px; - margin-right: 10px; + line-height: 20px; } .contextMenuItemDisabled { color: #AAAAAA; } + +.contextMenuText a { + display: block; + line-height: 20px; + width: 100%; + text-decoration: none; + color: black; + font-weight: normal; + margin: 0; + padding: 0; +} + +.contextMenuText a:hover { + background-color: #B6BDD2; + text-decoration: none !important; + font-weight: normal; + margin: 0; + padding: 0; +} diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin.js 2006-06-25 16:54:24.000000000 -0400 @@ -1 +1 @@ -if(!tinyMCE.settings['contextmenu_skip_plugin_css'])tinyMCE.loadCSS(tinyMCE.baseURL+"/plugins/contextmenu/css/contextmenu.css");var TinyMCE_contextmenu_contextMenu=null;function TinyMCE_contextmenu_getInfo(){return{longname:'Context menus',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_contextmenu_initInstance(inst){if(tinyMCE.isMSIE5_0&&tinyMCE.isOpera)return;tinyMCE.addEvent(inst.getDoc(),"click",TinyMCE_contextmenu_hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keypress",TinyMCE_contextmenu_hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keydown",TinyMCE_contextmenu_hideContextMenu);tinyMCE.addEvent(document,"click",TinyMCE_contextmenu_hideContextMenu);tinyMCE.addEvent(document,"keypress",TinyMCE_contextmenu_hideContextMenu);tinyMCE.addEvent(document,"keydown",TinyMCE_contextmenu_hideContextMenu);var contextMenu=new ContextMenu({commandhandler:"TinyMCE_contextmenu_commandHandler",spacer_image:tinyMCE.baseURL+"/plugins/contextmenu/images/spacer.gif"});TinyMCE_contextmenu_contextMenu=contextMenu;if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"contextmenu",function(e){TinyMCE_contextmenu_showContextMenu(tinyMCE.isMSIE?inst.contentWindow.event:e,inst);});}else tinyMCE.addEvent(inst.getDoc(),"contextmenu",TinyMCE_contextmenu_onContextMenu);}function TinyMCE_contextmenu_onContextMenu(e){var elm=tinyMCE.isMSIE?e.srcElement:e.target;var targetInst,body;if((body=tinyMCE.getParentElement(elm,"body"))!=null){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(body==inst.getBody()){targetInst=inst;break;}}return TinyMCE_contextmenu_showContextMenu(tinyMCE.isMSIE?targetInst.contentWindow.event:e,targetInst);}}function TinyMCE_contextmenu_showContextMenu(e,inst){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}var x,y,elm,contextMenu;var pos=tinyMCE.getAbsPosition(inst.iframeElement);x=tinyMCE.isMSIE?e.screenX:pos.absLeft+(e.pageX-inst.getBody().scrollLeft);y=tinyMCE.isMSIE?e.screenY:pos.absTop+(e.pageY-inst.getBody().scrollTop);elm=tinyMCE.isMSIE?e.srcElement:e.target;contextMenu=TinyMCE_contextmenu_contextMenu;contextMenu.inst=inst;window.setTimeout(function(){var theme=tinyMCE.getParam("theme");contextMenu.clearAll();var sel=inst.getSelectedText().length!=0||elm.nodeName=="IMG";contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_cut_desc","Cut","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_copy_desc","Copy","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_paste_desc","Paste","",false);elm=tinyMCE.getParentElement(elm,"img,table,td");if(elm){switch(elm.nodeName){case "IMG":contextMenu.addSeparator();if(tinyMCE.getAttrib(elm,'class').indexOf('mceItemFlash')==0)contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_flash_props","mceFlash");else contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/image.gif","$lang_image_props_desc",typeof(TinyMCE_advimage_getControlHTML)!="undefined"?"mceAdvImage":"mceImage");break;case "TABLE":case "TD":if(typeof(TinyMCE_table_getControlHTML)!="undefined"){var colspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"colspan");var rowspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_table_cut_row_desc","mceTableCutRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_table_copy_row_desc","mceTableCopyRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_before_desc","mceTablePasteRowBefore","",inst.tableRowClipboard==null);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_after_desc","mceTablePasteRowAfter","",inst.tableRowClipboard==null);contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_props_desc","mceInsertTable");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_cell_props.gif","$lang_table_cell_desc","mceTableCellProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete.gif","$lang_table_del","mceTableDelete");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_row_props.gif","$lang_table_row_desc","mceTableRowProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_before.gif","$lang_table_row_before_desc","mceTableInsertRowBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_after.gif","$lang_table_row_after_desc","mceTableInsertRowAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_row.gif","$lang_table_delete_row_desc","mceTableDeleteRow");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_before.gif","$lang_table_col_before_desc","mceTableInsertColBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_after.gif","$lang_table_col_after_desc","mceTableInsertColAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_col.gif","$lang_table_delete_col_desc","mceTableDeleteCol");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_split_cells.gif","$lang_table_split_cells_desc","mceTableSplitCells","",(colspan=="1"&&rowspan=="1"));contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_merge_cells.gif","$lang_table_merge_cells_desc","mceTableMergeCells","",false);}break;}}else{if(typeof(TinyMCE_table_getControlHTML)!="undefined"){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");}}contextMenu.show(x,y);},10);tinyMCE.cancelEvent(e);return false;}function TinyMCE_contextmenu_hideContextMenu(){TinyMCE_contextmenu_contextMenu.hide();}function TinyMCE_contextmenu_commandHandler(command,value){TinyMCE_contextmenu_contextMenu.hide();var ui=false;if(command=="mceInsertTable"||command=="mceTableCellProps"||command=="mceTableRowProps"||command=="mceTableMergeCells")ui=true;if(command=="Paste")value=null;TinyMCE_contextmenu_contextMenu.inst.execCommand(command,ui,value);}function ContextMenu(settings){function defParam(key,def_val){settings[key]=typeof(settings[key])!="undefined"?settings[key]:def_val;}var self=this;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="contextMenu";this.contextMenuDiv.setAttribute("class","contextMenu");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position='absolute';this.contextMenuDiv.style.zindex=1000;this.contextMenuDiv.style.left='0px';this.contextMenuDiv.style.top='0px';this.contextMenuDiv.unselectable="on";document.body.appendChild(this.contextMenuDiv);defParam("commandhandler","");defParam("spacer_image","images/spacer.gif");this.items=new Array();this.settings=settings;this.html="";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop=window.createPopup();doc=this.pop.document;doc.open();doc.write('');doc.close();}};ContextMenu.prototype.clearAll=function(){this.html="";this.contextMenuDiv.innerHTML="";};ContextMenu.prototype.addSeparator=function(){this.html+='';};ContextMenu.prototype.addItem=function(icon,title,command,value,disabled){if(title.charAt(0)=='$')title=tinyMCE.getLang(title.substring(1));var onMouseDown='';var html='';if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)onMouseDown='contextMenu.execCommand(\''+command+'\', \''+value+'\');return false;';else onMouseDown=this.settings['commandhandler']+'(\''+command+'\', \''+value+'\');return false;';if(icon=="")icon=this.settings['spacer_image'];if(!disabled)html+='';else html+='';html+='';html+='
      ';html+=title;html+='
      ';html+='';this.html+=html;};ContextMenu.prototype.show=function(x,y){if(this.html=="")return;var html='';html+='';html+=this.html;html+='
      ';this.contextMenuDiv.innerHTML=html;if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){var width,height;this.contextMenuDiv.style.display="block";width=this.contextMenuDiv.offsetWidth;height=this.contextMenuDiv.offsetHeight;this.contextMenuDiv.style.display="none";this.pop.document.body.innerHTML='
      '+html+"
      ";this.pop.document.tinyMCE=tinyMCE;this.pop.document.contextMenu=this;this.pop.show(x,y,width,height);}else{this.contextMenuDiv.style.left=x+'px';this.contextMenuDiv.style.top=y+'px';this.contextMenuDiv.style.display="block";}};ContextMenu.prototype.hide=function(){if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera)this.pop.hide();else this.contextMenuDiv.style.display="none";};ContextMenu.prototype.execCommand=function(command,value){eval(this.settings['commandhandler']+"(command, value);");}; \ No newline at end of file +if(!tinyMCE.settings['contextmenu_skip_plugin_css']){tinyMCE.loadCSS(tinyMCE.baseURL+"/plugins/contextmenu/css/contextmenu.css");}var TinyMCE_ContextMenuPlugin={_contextMenu:null,getInfo:function(){return{longname:'Context menus',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isMSIE5_0&&tinyMCE.isOpera)return;TinyMCE_ContextMenuPlugin._contextMenu=new TinyMCE_ContextMenu({commandhandler:"TinyMCE_ContextMenuPlugin._commandHandler",spacer_image:tinyMCE.baseURL+"/plugins/contextmenu/images/spacer.gif"});tinyMCE.addEvent(inst.getDoc(),"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(inst.getDoc(),"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"click",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keypress",TinyMCE_ContextMenuPlugin._hideContextMenu);tinyMCE.addEvent(document,"keydown",TinyMCE_ContextMenuPlugin._hideContextMenu);if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"contextmenu",function(e){TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?inst.contentWindow.event:e,inst);});}else tinyMCE.addEvent(inst.getDoc(),"contextmenu",TinyMCE_ContextMenuPlugin._onContextMenu);},_onContextMenu:function(e){var elm=tinyMCE.isMSIE?e.srcElement:e.target;var targetInst,body;if((body=tinyMCE.getParentElement(elm,"body"))!=null){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(body==inst.getBody()){targetInst=inst;break;}}return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE?targetInst.contentWindow.event:e,targetInst);}},_showContextMenu:function(e,inst){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}var x,y,elm,contextMenu;var pos=tinyMCE.getAbsPosition(inst.iframeElement);x=tinyMCE.isMSIE?e.screenX:pos.absLeft+(e.pageX-inst.getBody().scrollLeft);y=tinyMCE.isMSIE?e.screenY:pos.absTop+(e.pageY-inst.getBody().scrollTop);elm=tinyMCE.isMSIE?e.srcElement:e.target;contextMenu=this._contextMenu;contextMenu.inst=inst;window.setTimeout(function(){var theme=tinyMCE.getParam("theme");contextMenu.clearAll();var sel=inst.selection.getSelectedText().length!=0||elm.nodeName=="IMG";contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_cut_desc","Cut","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_copy_desc","Copy","",!sel);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_paste_desc","Paste","",false);if(sel||(elm?(elm.nodeName=='A')||(elm.nodeName=='IMG'):false)){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/link.gif","$lang_link_desc",inst.hasPlugin("advlink")?"mceAdvLink":"mceLink");contextMenu.addItem(tinyMCE.baseURL+"/themes/advanced/images/unlink.gif","$lang_unlink_desc","unlink","",(elm?(elm.nodeName!='A')&&(elm.nodeName!='IMG'):true));}elm=tinyMCE.getParentElement(elm,"img,table,td"+(inst.hasPlugin("advhr")?',hr':''));if(elm){switch(elm.nodeName){case"IMG":contextMenu.addSeparator();if(tinyMCE.getAttrib(elm,'class').indexOf('mceItemFlash')!=-1)contextMenu.addItem(tinyMCE.baseURL+"/plugins/flash/images/flash.gif","$lang_flash_props","mceFlash");else contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/image.gif","$lang_image_props_desc",inst.hasPlugin("advimage")?"mceAdvImage":"mceImage");break;case"HR":contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/advhr/images/advhr.gif","$lang_insert_advhr_desc","mceAdvancedHr");break;case"TABLE":case"TD":if(inst.hasPlugin("table")){var colspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"colspan");var rowspan=(elm.nodeName=="TABLE")?"":getAttrib(elm,"rowspan");colspan=colspan==""?"1":colspan;rowspan=rowspan==""?"1":rowspan;contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/cut.gif","$lang_table_cut_row_desc","mceTableCutRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/copy.gif","$lang_table_copy_row_desc","mceTableCopyRow");contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_before_desc","mceTablePasteRowBefore","",inst.tableRowClipboard==null);contextMenu.addItem(tinyMCE.baseURL+"/themes/"+theme+"/images/paste.gif","$lang_table_paste_row_after_desc","mceTablePasteRowAfter","",inst.tableRowClipboard==null);contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_props_desc","mceInsertTable");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_cell_props.gif","$lang_table_cell_desc","mceTableCellProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete.gif","$lang_table_del","mceTableDelete");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_row_props.gif","$lang_table_row_desc","mceTableRowProps");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_before.gif","$lang_table_row_before_desc","mceTableInsertRowBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_row_after.gif","$lang_table_row_after_desc","mceTableInsertRowAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_row.gif","$lang_table_delete_row_desc","mceTableDeleteRow");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_before.gif","$lang_table_col_before_desc","mceTableInsertColBefore");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_insert_col_after.gif","$lang_table_col_after_desc","mceTableInsertColAfter");contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_delete_col.gif","$lang_table_delete_col_desc","mceTableDeleteCol");contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_split_cells.gif","$lang_table_split_cells_desc","mceTableSplitCells","",(colspan=="1"&&rowspan=="1"));contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table_merge_cells.gif","$lang_table_merge_cells_desc","mceTableMergeCells","",false);}break;}}else{if(inst.hasPlugin("table")){contextMenu.addSeparator();contextMenu.addItem(tinyMCE.baseURL+"/plugins/table/images/table.gif","$lang_table_desc","mceInsertTable","insert");}}contextMenu.show(x,y);},10);tinyMCE.cancelEvent(e);return false;},_hideContextMenu:function(){if(TinyMCE_ContextMenuPlugin._contextMenu)TinyMCE_ContextMenuPlugin._contextMenu.hide();},_commandHandler:function(command,value){var cm=TinyMCE_ContextMenuPlugin._contextMenu;cm.hide();var ui=false;if(command=="mceInsertTable"||command=="mceTableCellProps"||command=="mceTableRowProps"||command=="mceTableMergeCells")ui=true;if(command=="Paste")value=null;if(tinyMCE.getParam("dialog_type")=="modal"&&tinyMCE.isMSIE){window.setTimeout(function(){cm.inst.execCommand(command,ui,value);},100);}else cm.inst.execCommand(command,ui,value);}};tinyMCE.addPlugin("contextmenu",TinyMCE_ContextMenuPlugin);function TinyMCE_ContextMenu(settings){function defParam(key,def_val){settings[key]=typeof(settings[key])!="undefined"?settings[key]:def_val;}var self=this;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.contextMenuDiv=document.createElement("div");this.contextMenuDiv.className="contextMenu";this.contextMenuDiv.setAttribute("class","contextMenu");this.contextMenuDiv.style.display="none";this.contextMenuDiv.style.position='absolute';this.contextMenuDiv.style.zindex=1000;this.contextMenuDiv.style.left='0';this.contextMenuDiv.style.top='0';this.contextMenuDiv.unselectable="on";document.body.appendChild(this.contextMenuDiv);defParam("commandhandler","");defParam("spacer_image","images/spacer.gif");this.items=new Array();this.settings=settings;this.html="";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop=window.createPopup();doc=this.pop.document;doc.open();doc.write('');doc.close();}};TinyMCE_ContextMenu.prototype={clearAll:function(){this.html="";this.contextMenuDiv.innerHTML="";},addSeparator:function(){this.html+='';},addItem:function(icon,title,command,value,disabled){if(title.charAt(0)=='$')title=tinyMCE.getLang(title.substring(1));var onMouseDown='';var html='';if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0)onMouseDown='contextMenu.execCommand(\''+command+'\', \''+value+'\');return false;';else onMouseDown=this.settings['commandhandler']+'(\''+command+'\', \''+value+'\');return false;';if(icon=="")icon=this.settings['spacer_image'];if(!disabled)html+='';else html+='';html+='';html+='
      ';html+=' ';html+=title;html+=' ';html+='
      ';html+='';this.html+=html;},show:function(x,y){var vp,width,height;if(this.html=="")return;var html='';html+='';html+=this.html;html+='
      ';this.contextMenuDiv.innerHTML=html;this.contextMenuDiv.style.display="block";width=this.contextMenuDiv.offsetWidth;height=this.contextMenuDiv.offsetHeight;this.contextMenuDiv.style.display="none";if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera){this.pop.document.body.innerHTML='
      '+html+"
      ";this.pop.document.tinyMCE=tinyMCE;this.pop.document.contextMenu=this;this.pop.show(x,y,width,height);}else{vp=this.getViewPort();this.contextMenuDiv.style.left=(x>vp.width-width?vp.width-width:x)+'px';this.contextMenuDiv.style.top=(y>vp.height-height?vp.height-height:y)+'px';this.contextMenuDiv.style.display="block";}},getViewPort:function(){return{width:document.documentElement.offsetWidth||document.body.offsetWidth,height:self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight};},hide:function(){if(tinyMCE.isMSIE&&!tinyMCE.isMSIE5_0&&!tinyMCE.isOpera)this.pop.hide();else this.contextMenuDiv.style.display="none";},execCommand:function(command,value){eval(this.settings['commandhandler']+"(command, value);");}}; \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js 2006-06-25 16:54:24.000000000 -0400 @@ -1,187 +1,221 @@ +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.31 $ + * $Date: 2006/05/03 10:46:41 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + /* Import plugin specific language pack */ -//tinyMCE.importPluginLanguagePack('contextmenu', 'en,zh_cn,cs,fa,fr_ca,fr,de,nb'); -if (!tinyMCE.settings['contextmenu_skip_plugin_css']) +//tinyMCE.importPluginLanguagePack('contextmenu', 'en,tr,zh_cn,cs,fa,fr_ca,fr,de,nb'); +if (!tinyMCE.settings['contextmenu_skip_plugin_css']) { tinyMCE.loadCSS(tinyMCE.baseURL + "/plugins/contextmenu/css/contextmenu.css"); - -// Global contextmenu class instance -var TinyMCE_contextmenu_contextMenu = null; - -function TinyMCE_contextmenu_getInfo() { - return { - longname : 'Context menus', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; - -function TinyMCE_contextmenu_initInstance(inst) { - // Is not working on MSIE 5.0 or Opera no contextmenu event - if (tinyMCE.isMSIE5_0 && tinyMCE.isOpera) - return; - - // Add hide event handles - tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_contextmenu_hideContextMenu); - tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_contextmenu_hideContextMenu); - tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_contextmenu_hideContextMenu); - tinyMCE.addEvent(document, "click", TinyMCE_contextmenu_hideContextMenu); - tinyMCE.addEvent(document, "keypress", TinyMCE_contextmenu_hideContextMenu); - tinyMCE.addEvent(document, "keydown", TinyMCE_contextmenu_hideContextMenu); - - var contextMenu = new ContextMenu({ - commandhandler : "TinyMCE_contextmenu_commandHandler", - spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif" - }); - - // Register global reference - TinyMCE_contextmenu_contextMenu = contextMenu; - - // Attach contextmenu event - if (tinyMCE.isGecko) { - tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_contextmenu_showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);}); - } else - tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_contextmenu_onContextMenu); } -function TinyMCE_contextmenu_onContextMenu(e) { - var elm = tinyMCE.isMSIE ? e.srcElement : e.target; - var targetInst, body; - - // Find instance - if ((body = tinyMCE.getParentElement(elm, "body")) != null) { - for (var n in tinyMCE.instances) { - var inst = tinyMCE.instances[n]; - if (!tinyMCE.isInstance(inst)) - continue; - - if (body == inst.getBody()) { - targetInst = inst; - break; +var TinyMCE_ContextMenuPlugin = { + // Private fields + _contextMenu : null, + + getInfo : function() { + return { + longname : 'Context menus', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_contextmenu.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + initInstance : function(inst) { + // Is not working on MSIE 5.0 or Opera no contextmenu event + if (tinyMCE.isMSIE5_0 && tinyMCE.isOpera) + return; + + TinyMCE_ContextMenuPlugin._contextMenu = new TinyMCE_ContextMenu({ + commandhandler : "TinyMCE_ContextMenuPlugin._commandHandler", + spacer_image : tinyMCE.baseURL + "/plugins/contextmenu/images/spacer.gif" + }); + + // Add hide event handles + tinyMCE.addEvent(inst.getDoc(), "click", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(inst.getDoc(), "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(inst.getDoc(), "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(document, "click", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(document, "keypress", TinyMCE_ContextMenuPlugin._hideContextMenu); + tinyMCE.addEvent(document, "keydown", TinyMCE_ContextMenuPlugin._hideContextMenu); + + // Attach contextmenu event + if (tinyMCE.isGecko) { + tinyMCE.addEvent(inst.getDoc(), "contextmenu", function(e) {TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? inst.contentWindow.event : e, inst);}); + } else + tinyMCE.addEvent(inst.getDoc(), "contextmenu", TinyMCE_ContextMenuPlugin._onContextMenu); + }, + + // Private plugin internal methods + + _onContextMenu : function(e) { + var elm = tinyMCE.isMSIE ? e.srcElement : e.target; + var targetInst, body; + + // Find instance + if ((body = tinyMCE.getParentElement(elm, "body")) != null) { + for (var n in tinyMCE.instances) { + var inst = tinyMCE.instances[n]; + if (!tinyMCE.isInstance(inst)) + continue; + + if (body == inst.getBody()) { + targetInst = inst; + break; + } } + + return TinyMCE_ContextMenuPlugin._showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst); } + }, - return TinyMCE_contextmenu_showContextMenu(tinyMCE.isMSIE ? targetInst.contentWindow.event : e, targetInst); - } -} + _showContextMenu : function(e, inst) { + function getAttrib(elm, name) { + return elm.getAttribute(name) ? elm.getAttribute(name) : ""; + } -function TinyMCE_contextmenu_showContextMenu(e, inst) { - function getAttrib(elm, name) { - return elm.getAttribute(name) ? elm.getAttribute(name) : ""; - } + var x, y, elm, contextMenu; + var pos = tinyMCE.getAbsPosition(inst.iframeElement); - var x, y, elm, contextMenu; - var pos = tinyMCE.getAbsPosition(inst.iframeElement); + x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft); + y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop); + elm = tinyMCE.isMSIE ? e.srcElement : e.target; - x = tinyMCE.isMSIE ? e.screenX : pos.absLeft + (e.pageX - inst.getBody().scrollLeft); - y = tinyMCE.isMSIE ? e.screenY : pos.absTop + (e.pageY - inst.getBody().scrollTop); - elm = tinyMCE.isMSIE ? e.srcElement : e.target; - contextMenu = TinyMCE_contextmenu_contextMenu; - contextMenu.inst = inst; - - // Mozilla needs some time - window.setTimeout(function () { - var theme = tinyMCE.getParam("theme"); - - contextMenu.clearAll(); - var sel = inst.getSelectedText().length != 0 || elm.nodeName == "IMG"; - - // Default items - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel); - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel); - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false); - - // Get element - elm = tinyMCE.getParentElement(elm, "img,table,td"); - if (elm) { - switch (elm.nodeName) { - case "IMG": - contextMenu.addSeparator(); + contextMenu = this._contextMenu; + contextMenu.inst = inst; - // If flash - if (tinyMCE.getAttrib(elm, 'class').indexOf('mceItemFlash') == 0) - contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash"); - else - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", typeof(TinyMCE_advimage_getControlHTML) != "undefined" ? "mceAdvImage" : "mceImage"); - break; + // Mozilla needs some time + window.setTimeout(function () { + var theme = tinyMCE.getParam("theme"); - case "TABLE": - case "TD": - // Is table plugin loaded - if (typeof(TinyMCE_table_getControlHTML) != "undefined") { - var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan"); - var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan"); + contextMenu.clearAll(); + var sel = inst.selection.getSelectedText().length != 0 || elm.nodeName == "IMG"; - colspan = colspan == "" ? "1" : colspan; - rowspan = rowspan == "" ? "1" : rowspan; + // Default items + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_cut_desc", "Cut", "", !sel); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_copy_desc", "Copy", "", !sel); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_paste_desc", "Paste", "", false); - contextMenu.addSeparator(); - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow"); - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow"); - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null); - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null); - -/* contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyleft.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false); - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifycenter.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false); - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyright.gif", "$lang_justifyright_desc", "JustifyRight", "", false); - contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyfull.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/ - contextMenu.addSeparator(); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert"); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable"); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps"); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete.gif", "$lang_table_del", "mceTableDelete"); - contextMenu.addSeparator(); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps"); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_row_before_desc", "mceTableInsertRowBefore"); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_row_after_desc", "mceTableInsertRowAfter"); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow"); - contextMenu.addSeparator(); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_col_before_desc", "mceTableInsertColBefore"); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_col_after_desc", "mceTableInsertColAfter"); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol"); - contextMenu.addSeparator(); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1")); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false); - } - break; - } - } else { - // Add table specific - if (typeof(TinyMCE_table_getControlHTML) != "undefined") { + if (sel || (elm ? (elm.nodeName == 'A') || (elm.nodeName == 'IMG') : false)) { contextMenu.addSeparator(); - contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert"); + contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/link.gif", "$lang_link_desc", inst.hasPlugin("advlink") ? "mceAdvLink" : "mceLink"); + contextMenu.addItem(tinyMCE.baseURL + "/themes/advanced/images/unlink.gif", "$lang_unlink_desc", "unlink", "", (elm ? (elm.nodeName != 'A') && (elm.nodeName != 'IMG') : true)); } - } - contextMenu.show(x, y); - }, 10); + // Get element + elm = tinyMCE.getParentElement(elm, "img,table,td" + (inst.hasPlugin("advhr") ? ',hr' : '')); + if (elm) { + switch (elm.nodeName) { + case "IMG": + contextMenu.addSeparator(); - // Cancel default handeling - tinyMCE.cancelEvent(e); - return false; -} + // If flash + if (tinyMCE.getAttrib(elm, 'class').indexOf('mceItemFlash') != -1) + contextMenu.addItem(tinyMCE.baseURL + "/plugins/flash/images/flash.gif", "$lang_flash_props", "mceFlash"); + else + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/image.gif", "$lang_image_props_desc", inst.hasPlugin("advimage") ? "mceAdvImage" : "mceImage"); + break; -function TinyMCE_contextmenu_hideContextMenu() { - TinyMCE_contextmenu_contextMenu.hide(); -} + case "HR": + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/advhr/images/advhr.gif", "$lang_insert_advhr_desc", "mceAdvancedHr"); + break; -function TinyMCE_contextmenu_commandHandler(command, value) { - TinyMCE_contextmenu_contextMenu.hide(); + case "TABLE": + case "TD": + // Is table plugin loaded + if (inst.hasPlugin("table")) { + var colspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "colspan"); + var rowspan = (elm.nodeName == "TABLE") ? "" : getAttrib(elm, "rowspan"); + + colspan = colspan == "" ? "1" : colspan; + rowspan = rowspan == "" ? "1" : rowspan; + + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/cut.gif", "$lang_table_cut_row_desc", "mceTableCutRow"); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/copy.gif", "$lang_table_copy_row_desc", "mceTableCopyRow"); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_before_desc", "mceTablePasteRowBefore", "", inst.tableRowClipboard == null); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/paste.gif", "$lang_table_paste_row_after_desc", "mceTablePasteRowAfter", "", inst.tableRowClipboard == null); + + /* contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyleft.gif", "$lang_justifyleft_desc", "JustifyLeft", "", false); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifycenter.gif", "$lang_justifycenter_desc", "JustifyCenter", "", false); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyright.gif", "$lang_justifyright_desc", "JustifyRight", "", false); + contextMenu.addItem(tinyMCE.baseURL + "/themes/" + theme + "/images/justifyfull.gif", "$lang_justifyfull_desc", "JustifyFull", "", false);*/ + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_props_desc", "mceInsertTable"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_cell_props.gif", "$lang_table_cell_desc", "mceTableCellProps"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete.gif", "$lang_table_del", "mceTableDelete"); + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_row_props.gif", "$lang_table_row_desc", "mceTableRowProps"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_before.gif", "$lang_table_row_before_desc", "mceTableInsertRowBefore"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_row_after.gif", "$lang_table_row_after_desc", "mceTableInsertRowAfter"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_row.gif", "$lang_table_delete_row_desc", "mceTableDeleteRow"); + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_before.gif", "$lang_table_col_before_desc", "mceTableInsertColBefore"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_insert_col_after.gif", "$lang_table_col_after_desc", "mceTableInsertColAfter"); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_delete_col.gif", "$lang_table_delete_col_desc", "mceTableDeleteCol"); + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_split_cells.gif", "$lang_table_split_cells_desc", "mceTableSplitCells", "", (colspan == "1" && rowspan == "1")); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table_merge_cells.gif", "$lang_table_merge_cells_desc", "mceTableMergeCells", "", false); + } + break; + } + } else { + // Add table specific + if (inst.hasPlugin("table")) { + contextMenu.addSeparator(); + contextMenu.addItem(tinyMCE.baseURL + "/plugins/table/images/table.gif", "$lang_table_desc", "mceInsertTable", "insert"); + } + } - // UI must be true on these - var ui = false; - if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells") - ui = true; + contextMenu.show(x, y); + }, 10); - if (command == "Paste") - value = null; + // Cancel default handeling + tinyMCE.cancelEvent(e); + return false; + }, + + _hideContextMenu : function() { + if (TinyMCE_ContextMenuPlugin._contextMenu) + TinyMCE_ContextMenuPlugin._contextMenu.hide(); + }, + + _commandHandler : function(command, value) { + var cm = TinyMCE_ContextMenuPlugin._contextMenu; + + cm.hide(); + + // UI must be true on these + var ui = false; + if (command == "mceInsertTable" || command == "mceTableCellProps" || command == "mceTableRowProps" || command == "mceTableMergeCells") + ui = true; + + if (command == "Paste") + value = null; + + if (tinyMCE.getParam("dialog_type") == "modal" && tinyMCE.isMSIE) { + // Cell properties will generate access denied error is this isn't done?! + window.setTimeout(function() { + cm.inst.execCommand(command, ui, value); + }, 100); + } else + cm.inst.execCommand(command, ui, value); + } +}; - TinyMCE_contextmenu_contextMenu.inst.execCommand(command, ui, value); -} +tinyMCE.addPlugin("contextmenu", TinyMCE_ContextMenuPlugin); // Context menu class -function ContextMenu(settings) { +function TinyMCE_ContextMenu(settings) { // Default value function function defParam(key, def_val) { settings[key] = typeof(settings[key]) != "undefined" ? settings[key] : def_val; @@ -198,8 +232,8 @@ this.contextMenuDiv.style.display = "none"; this.contextMenuDiv.style.position = 'absolute'; this.contextMenuDiv.style.zindex = 1000; - this.contextMenuDiv.style.left = '0px'; - this.contextMenuDiv.style.top = '0px'; + this.contextMenuDiv.style.left = '0'; + this.contextMenuDiv.style.top = '0'; this.contextMenuDiv.unselectable = "on"; document.body.appendChild(this.contextMenuDiv); @@ -222,62 +256,64 @@ } }; -ContextMenu.prototype.clearAll = function() { - this.html = ""; - this.contextMenuDiv.innerHTML = ""; -}; +TinyMCE_ContextMenu.prototype = { + clearAll : function() { + this.html = ""; + this.contextMenuDiv.innerHTML = ""; + }, -ContextMenu.prototype.addSeparator = function() { - this.html += ''; -}; + addSeparator : function() { + this.html += ''; + }, -ContextMenu.prototype.addItem = function(icon, title, command, value, disabled) { - if (title.charAt(0) == '$') - title = tinyMCE.getLang(title.substring(1)); + addItem : function(icon, title, command, value, disabled) { + if (title.charAt(0) == '$') + title = tinyMCE.getLang(title.substring(1)); - var onMouseDown = ''; - var html = ''; + var onMouseDown = ''; + var html = ''; - if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0) - onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;'; - else - onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;'; + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0) + onMouseDown = 'contextMenu.execCommand(\'' + command + '\', \'' + value + '\');return false;'; + else + onMouseDown = this.settings['commandhandler'] + '(\'' + command + '\', \'' + value + '\');return false;'; - if (icon == "") - icon = this.settings['spacer_image']; + if (icon == "") + icon = this.settings['spacer_image']; - if (!disabled) - html += ''; - else - html += ''; + if (!disabled) + html += ''; + else + html += ''; - html += ''; - html += ''; + html += ''; - // Add to main - this.html += html; -}; + // Add to main + this.html += html; + }, -ContextMenu.prototype.show = function(x, y) { - if (this.html == "") - return; + show : function(x, y) { + var vp, width, height; - var html = ''; + if (this.html == "") + return; - html += ''; - html += this.html; - html += '
      '; + var html = ''; - this.contextMenuDiv.innerHTML = html; + html += ''; + html += this.html; + html += '
      '; - if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) { - var width, height; + this.contextMenuDiv.innerHTML = html; // Get dimensions this.contextMenuDiv.style.display = "block"; @@ -285,25 +321,36 @@ height = this.contextMenuDiv.offsetHeight; this.contextMenuDiv.style.display = "none"; - // Setup popup and show - this.pop.document.body.innerHTML = '
      ' + html + "
      "; - this.pop.document.tinyMCE = tinyMCE; - this.pop.document.contextMenu = this; - this.pop.show(x, y, width, height); - } else { - this.contextMenuDiv.style.left = x + 'px'; - this.contextMenuDiv.style.top = y + 'px'; - this.contextMenuDiv.style.display = "block"; - } -}; + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) { + // Setup popup and show + this.pop.document.body.innerHTML = '
      ' + html + "
      "; + this.pop.document.tinyMCE = tinyMCE; + this.pop.document.contextMenu = this; + this.pop.show(x, y, width, height); + } else { + vp = this.getViewPort(); + + this.contextMenuDiv.style.left = (x > vp.width - width ? vp.width - width : x) + 'px'; + this.contextMenuDiv.style.top = (y > vp.height - height ? vp.height - height : y) + 'px'; + this.contextMenuDiv.style.display = "block"; + } + }, -ContextMenu.prototype.hide = function() { - if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) - this.pop.hide(); - else - this.contextMenuDiv.style.display = "none"; -}; + getViewPort : function() { + return { + width : document.documentElement.offsetWidth || document.body.offsetWidth, + height : self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight + }; + }, + + hide : function() { + if (tinyMCE.isMSIE && !tinyMCE.isMSIE5_0 && !tinyMCE.isOpera) + this.pop.hide(); + else + this.contextMenuDiv.style.display = "none"; + }, -ContextMenu.prototype.execCommand = function(command, value) { - eval(this.settings['commandhandler'] + "(command, value);"); + execCommand : function(command, value) { + eval(this.settings['commandhandler'] + "(command, value);"); + } }; diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin.js 2006-06-25 16:54:20.000000000 -0400 @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('directionality','en,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');function TinyMCE_directionality_getInfo(){return{longname:'Directionality',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_directionality_getControlHTML(control_name){switch(control_name){case "ltr":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\');return false;';return '';case "rtl":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\');return false;';return '';}return "";}function TinyMCE_directionality_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceDirectionLTR":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","ltr");tinyMCE.triggerNodeChange(false);return true;case "mceDirectionRTL":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","rtl");tinyMCE.triggerNodeChange(false);return true;}return false;}function TinyMCE_directionality_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}tinyMCE.switchClassSticky(editor_id+'_ltr','mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_rtl','mceButtonNormal',false);if(node==null)return;var elm=tinyMCE.getParentElement(node,"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(!elm){tinyMCE.switchClassSticky(editor_id+'_ltr','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_rtl','mceButtonDisabled',true);return;}var dir=getAttrib(elm,"dir");if(dir=="ltr"||dir=="")tinyMCE.switchClassSticky(editor_id+'_ltr','mceButtonSelected',false);else tinyMCE.switchClassSticky(editor_id+'_rtl','mceButtonSelected',false);return true;} \ No newline at end of file +tinyMCE.importPluginLanguagePack('directionality','en,tr,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');var TinyMCE_DirectionalityPlugin={getInfo:function(){return{longname:'Directionality',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"ltr":return tinyMCE.getButtonHTML(cn,'lang_directionality_ltr_desc','{$pluginurl}/images/ltr.gif','mceDirectionLTR');case"rtl":return tinyMCE.getButtonHTML(cn,'lang_directionality_rtl_desc','{$pluginurl}/images/rtl.gif','mceDirectionRTL');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceDirectionLTR":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","ltr");tinyMCE.triggerNodeChange(false);return true;case"mceDirectionRTL":var inst=tinyMCE.getInstanceById(editor_id);var elm=tinyMCE.getParentElement(inst.getFocusElement(),"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(elm)elm.setAttribute("dir","rtl");tinyMCE.triggerNodeChange(false);return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";}if(node==null)return;var elm=tinyMCE.getParentElement(node,"p,div,td,h1,h2,h3,h4,h5,h6,pre,address");if(!elm){tinyMCE.switchClass(editor_id+'_ltr','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_rtl','mceButtonDisabled');return true;}tinyMCE.switchClass(editor_id+'_ltr','mceButtonNormal');tinyMCE.switchClass(editor_id+'_rtl','mceButtonNormal');var dir=getAttrib(elm,"dir");if(dir=="ltr"||dir=="")tinyMCE.switchClass(editor_id+'_ltr','mceButtonSelected');else tinyMCE.switchClass(editor_id+'_rtl','mceButtonSelected');return true;}};tinyMCE.addPlugin("directionality",TinyMCE_DirectionalityPlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/directionality/editor_plugin_src.js 2006-06-25 16:54:20.000000000 -0400 @@ -1,81 +1,92 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('directionality', 'en,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br'); - -function TinyMCE_directionality_getInfo() { - return { - longname : 'Directionality', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; - -function TinyMCE_directionality_getControlHTML(control_name) { - switch (control_name) { - case "ltr": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\');return false;'; - return ''; - - case "rtl": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\');return false;'; - return ''; - } - - return ""; -} - -function TinyMCE_directionality_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mceDirectionLTR": - var inst = tinyMCE.getInstanceById(editor_id); - var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); - - if (elm) - elm.setAttribute("dir", "ltr"); - - tinyMCE.triggerNodeChange(false); - return true; +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.16 $ + * $Date: 2006/02/10 21:34:28 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ - case "mceDirectionRTL": - var inst = tinyMCE.getInstanceById(editor_id); - var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); - - if (elm) - elm.setAttribute("dir", "rtl"); +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('directionality', 'en,tr,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br'); - tinyMCE.triggerNodeChange(false); +var TinyMCE_DirectionalityPlugin = { + getInfo : function() { + return { + longname : 'Directionality', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + getControlHTML : function(cn) { + switch (cn) { + case "ltr": + return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR'); + + case "rtl": + return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL'); + } + + return ""; + }, + + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceDirectionLTR": + var inst = tinyMCE.getInstanceById(editor_id); + var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); + + if (elm) + elm.setAttribute("dir", "ltr"); + + tinyMCE.triggerNodeChange(false); + return true; + + case "mceDirectionRTL": + var inst = tinyMCE.getInstanceById(editor_id); + var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); + + if (elm) + elm.setAttribute("dir", "rtl"); + + tinyMCE.triggerNodeChange(false); + return true; + } + + // Pass to next handler in chain + return false; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + function getAttrib(elm, name) { + return elm.getAttribute(name) ? elm.getAttribute(name) : ""; + } + + if (node == null) + return; + + var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); + if (!elm) { + tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled'); return true; - } + } - // Pass to next handler in chain - return false; -} - -function TinyMCE_directionality_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - function getAttrib(elm, name) { - return elm.getAttribute(name) ? elm.getAttribute(name) : ""; - } + tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonNormal', false); - tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonNormal', false); + var dir = getAttrib(elm, "dir"); + if (dir == "ltr" || dir == "") + tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected'); + else + tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected'); - if (node == null) - return; - - var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); - if (!elm) { - tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonDisabled', true); - tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonDisabled', true); - return; + return true; } +}; - var dir = getAttrib(elm, "dir"); - if (dir == "ltr" || dir == "") - tinyMCE.switchClassSticky(editor_id + '_ltr', 'mceButtonSelected', false); - else - tinyMCE.switchClassSticky(editor_id + '_rtl', 'mceButtonSelected', false); - - return true; -} +tinyMCE.addPlugin("directionality", TinyMCE_DirectionalityPlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin.js 2006-06-25 16:54:23.000000000 -0400 @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('emotions','en,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_emotions_getInfo(){return{longname:'Emotions',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_emotions_getControlHTML(control_name){switch(control_name){case "emotions":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceEmotion\');return false;';return '';}return "";}function TinyMCE_emotions_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=160;template['height']=160;template['width']+=tinyMCE.getLang('lang_emotions_delta_width',0);template['height']+=tinyMCE.getLang('lang_emotions_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;}return false;} \ No newline at end of file +tinyMCE.importPluginLanguagePack('emotions','en,tr,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_EmotionsPlugin={getInfo:function(){return{longname:'Emotions',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"emotions":return tinyMCE.getButtonHTML(cn,'lang_emotions_desc','{$pluginurl}/images/emotions.gif','mceEmotion');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceEmotion":var template=new Array();template['file']='../../plugins/emotions/emotions.htm';template['width']=160;template['height']=160;template['width']+=tinyMCE.getLang('lang_emotions_delta_width',0);template['height']+=tinyMCE.getLang('lang_emotions_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;}return false;}};tinyMCE.addPlugin('emotions',TinyMCE_EmotionsPlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/editor_plugin_src.js 2006-06-25 16:54:23.000000000 -0400 @@ -1,51 +1,65 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('emotions', 'en,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk'); - -function TinyMCE_emotions_getInfo() { - return { - longname : 'Emotions', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; - /** - * Returns the HTML contents of the emotions control. + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.23 $ + * $Date: 2006/02/10 16:29:38 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. */ -function TinyMCE_emotions_getControlHTML(control_name) { - switch (control_name) { - case "emotions": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceEmotion\');return false;'; - return ''; - } - return ""; -} +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('emotions', 'en,tr,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk'); -/** - * Executes the mceEmotion command. - */ -function TinyMCE_emotions_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mceEmotion": - var template = new Array(); - - template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme - template['width'] = 160; - template['height'] = 160; - - // Language specific width and height addons - template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0); +// Plucin static class +var TinyMCE_EmotionsPlugin = { + getInfo : function() { + return { + longname : 'Emotions', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_emotions.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + /** + * Returns the HTML contents of the emotions control. + */ + getControlHTML : function(cn) { + switch (cn) { + case "emotions": + return tinyMCE.getButtonHTML(cn, 'lang_emotions_desc', '{$pluginurl}/images/emotions.gif', 'mceEmotion'); + } + + return ""; + }, + + /** + * Executes the mceEmotion command. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceEmotion": + var template = new Array(); + + template['file'] = '../../plugins/emotions/emotions.htm'; // Relative to theme + template['width'] = 160; + template['height'] = 160; + + // Language specific width and height addons + template['width'] += tinyMCE.getLang('lang_emotions_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_emotions_delta_height', 0); - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); - return true; + return true; + } + + // Pass to next handler in chain + return false; } +}; - // Pass to next handler in chain - return false; -} +// Register plugin +tinyMCE.addPlugin('emotions', TinyMCE_EmotionsPlugin); Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/images/emotions.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/images/emotions.gif differ diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/jscripts/functions.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/jscripts/functions.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/jscripts/functions.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/emotions/jscripts/functions.js 2006-06-25 16:54:23.000000000 -0400 @@ -12,9 +12,9 @@ title = title.replace(/&/g, '&'); title = title.replace(/\"/g, '"'); title = title.replace(//g, '&gr;'); + title = title.replace(/>/g, '>'); - var html = '' + title + ''; + var html = '' + title + ''; tinyMCE.execCommand('mceInsertContent', false, html); tinyMCEPopup.close(); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/flash/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/flash/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/flash/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/flash/editor_plugin.js 2006-06-25 16:54:23.000000000 -0400 @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('flash','en,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk,pt_br');function TinyMCE_flash_getInfo(){return{longname:'Flash',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_flash.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_flash_initInstance(inst){if(!tinyMCE.settings['flash_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/flash/css/content.css");}function TinyMCE_flash_getControlHTML(control_name){switch(control_name){case "flash":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceFlash\');return false;';return '';}return "";}function TinyMCE_flash_parseAttributes(attribute_string){var attributeName="";var attributeValue="";var withInName;var withInValue;var attributes=new Array();var whiteSpaceRegExp=new RegExp('^[ \n\r\t]+','g');if(attribute_string==null||attribute_string.length<2)return null;withInName=withInValue=false;for(var i=0;i','gi'),'');content=content.replace(new RegExp('<[ ]*object','gi'),'','gi'),'');while((startPos=content.indexOf('',startPos);var attribs=TinyMCE_flash_parseAttributes(content.substring(startPos+6,endPos));embedList[embedList.length]=attribs;}var index=0;while((startPos=content.indexOf('=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+=''+content.substring(endPos);content+=contentAfter;index++;startPos++;}var index=0;while((startPos=content.indexOf('=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('>',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+=''+content.substring(endPos);content+=contentAfter;index++;startPos++;}break;case "get_from_editor":var startPos=-1;while((startPos=content.indexOf('',startPos);var attribs=TinyMCE_flash_parseAttributes(content.substring(startPos+4,endPos));if(attribs['class']!="mceItemFlash")continue;endPos+=2;var embedHTML='';var wmode=tinyMCE.getParam("flash_wmode","");var quality=tinyMCE.getParam("flash_quality","high");var menu=tinyMCE.getParam("flash_menu","false");embedHTML+='';embedHTML+='';embedHTML+='';embedHTML+='';embedHTML+='';embedHTML+='';chunkBefore=content.substring(0,startPos);chunkAfter=content.substring(endPos);content=chunkBefore+embedHTML+chunkAfter;}break;}return content;}function TinyMCE_flash_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){tinyMCE.switchClassSticky(editor_id+'_flash','mceButtonNormal');if(node==null)return;do{if(node.nodeName.toLowerCase()=="img"&&tinyMCE.getAttrib(node,'class').indexOf('mceItemFlash')==0)tinyMCE.switchClassSticky(editor_id+'_flash','mceButtonSelected');}while((node=node.parentNode));return true;} \ No newline at end of file +tinyMCE.importPluginLanguagePack('flash','en,tr,de,sv,zh_cn,cs,fa,fr_ca,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk,pt_br');var TinyMCE_FlashPlugin={getInfo:function(){return{longname:'Flash',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_flash.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(!tinyMCE.settings['flash_skip_plugin_css'])tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/flash/css/content.css");},getControlHTML:function(cn){switch(cn){case"flash":return tinyMCE.getButtonHTML(cn,'lang_flash_desc','{$pluginurl}/images/flash.gif','mceFlash');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceFlash":var name="",swffile="",swfwidth="",swfheight="",action="insert";var template=new Array();var inst=tinyMCE.getInstanceById(editor_id);var focusElm=inst.getFocusElement();template['file']='../../plugins/flash/flash.htm';template['width']=430;template['height']=175;template['width']+=tinyMCE.getLang('lang_flash_delta_width',0);template['height']+=tinyMCE.getLang('lang_flash_delta_height',0);if(focusElm!=null&&focusElm.nodeName.toLowerCase()=="img"){name=tinyMCE.getAttrib(focusElm,'class');if(name.indexOf('mceItemFlash')==-1)return true;swffile=tinyMCE.getAttrib(focusElm,'alt');if(tinyMCE.getParam('convert_urls'))swffile=eval(tinyMCE.settings['urlconverter_callback']+"(swffile, null, true);");swfwidth=tinyMCE.getAttrib(focusElm,'width');swfheight=tinyMCE.getAttrib(focusElm,'height');action="update";}tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",swffile:swffile,swfwidth:swfwidth,swfheight:swfheight,action:action});return true;}return false;},cleanup:function(type,content){switch(type){case"insert_to_editor_dom":if(tinyMCE.getParam('convert_urls')){var imgs=content.getElementsByTagName("img");for(var i=0;i','gi'),'');content=content.replace(new RegExp('<[ ]*object','gi'),'','gi'),'');while((startPos=content.indexOf('',startPos);var attribs=TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos+6,endPos));embedList[embedList.length]=attribs;}var index=0;while((startPos=content.indexOf('=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+=''+content.substring(endPos);content+=contentAfter;index++;startPos++;}var index=0;while((startPos=content.indexOf('=embedList.length)break;var attribs=embedList[index];endPos=content.indexOf('>',startPos);endPos+=9;var contentAfter=content.substring(endPos);content=content.substring(0,startPos);content+=''+content.substring(endPos);content+=contentAfter;index++;startPos++;}break;case"get_from_editor":var startPos=-1;while((startPos=content.indexOf('',startPos);var attribs=TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos+4,endPos));if(attribs['class']!="mceItemFlash")continue;endPos+=2;var embedHTML='';var wmode=tinyMCE.getParam("flash_wmode","");var quality=tinyMCE.getParam("flash_quality","high");var menu=tinyMCE.getParam("flash_menu","false");embedHTML+='';embedHTML+='';embedHTML+='';embedHTML+='';embedHTML+='';embedHTML+='';chunkBefore=content.substring(0,startPos);chunkAfter=content.substring(endPos);content=chunkBefore+embedHTML+chunkAfter;}break;}return content;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(node==null)return;do{if(node.nodeName=="IMG"&&tinyMCE.getAttrib(node,'class').indexOf('mceItemFlash')==0){tinyMCE.switchClass(editor_id+'_flash','mceButtonSelected');return true;}}while((node=node.parentNode));tinyMCE.switchClass(editor_id+'_flash','mceButtonNormal');return true;},_parseAttributes:function(attribute_string){var attributeName="";var attributeValue="";var withInName;var withInValue;var attributes=new Array();var whiteSpaceRegExp=new RegExp('^[ \n\r\t]+','g');if(attribute_string==null||attribute_string.length<2)return null;withInName=withInValue=false;for(var i=0;i'; - } - - return ""; -} - -function TinyMCE_flash_parseAttributes(attribute_string) { - var attributeName = ""; - var attributeValue = ""; - var withInName; - var withInValue; - var attributes = new Array(); - var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g'); - - if (attribute_string == null || attribute_string.length < 2) - return null; - - withInName = withInValue = false; - - for (var i=0; i','gi'),''); + content = content.replace(new RegExp('<[ ]*object','gi'),'','gi'),''); + + // Parse all embed tags + while ((startPos = content.indexOf('', startPos); + var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 6, endPos)); + embedList[embedList.length] = attribs; + } - if (tinyMCE.getParam('convert_urls')) - src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, null, true);"); + // Parse all object tags and replace them with images from the embed data + var index = 0; + while ((startPos = content.indexOf('= embedList.length) + break; + + var attribs = embedList[index]; + + // Find end of object + endPos = content.indexOf('', startPos); + endPos += 9; + + // Insert image + var contentAfter = content.substring(endPos); + content = content.substring(0, startPos); + content += '' + content.substring(endPos); + content += contentAfter; + index++; - imgs[i].setAttribute('alt', src); - imgs[i].setAttribute('title', src); + startPos++; } - } - break; - case "insert_to_editor": - var startPos = 0; - var embedList = new Array(); - - // Fix the embed and object elements - content = content.replace(new RegExp('<[ ]*embed','gi'),'','gi'),''); - content = content.replace(new RegExp('<[ ]*object','gi'),'','gi'),''); - - // Parse all embed tags - while ((startPos = content.indexOf('', startPos); - var attribs = TinyMCE_flash_parseAttributes(content.substring(startPos + 6, endPos)); - embedList[embedList.length] = attribs; - } + // Parse all embed tags and replace them with images from the embed data + var index = 0; + while ((startPos = content.indexOf('= embedList.length) + break; + + var attribs = embedList[index]; + + // Find end of embed + endPos = content.indexOf('>', startPos); + endPos += 9; + + // Insert image + var contentAfter = content.substring(endPos); + content = content.substring(0, startPos); + content += '' + content.substring(endPos); + content += contentAfter; + index++; - // Parse all object tags and replace them with images from the embed data - var index = 0; - while ((startPos = content.indexOf('= embedList.length) - break; - - var attribs = embedList[index]; - - // Find end of object - endPos = content.indexOf('', startPos); - endPos += 9; - - // Insert image - var contentAfter = content.substring(endPos); - content = content.substring(0, startPos); - content += '' + content.substring(endPos); - content += contentAfter; - index++; + startPos++; + } - startPos++; - } + break; - // Parse all embed tags and replace them with images from the embed data - var index = 0; - while ((startPos = content.indexOf('= embedList.length) - break; - - var attribs = embedList[index]; - - // Find end of embed - endPos = content.indexOf('>', startPos); - endPos += 9; - - // Insert image - var contentAfter = content.substring(endPos); - content = content.substring(0, startPos); - content += '' + content.substring(endPos); - content += contentAfter; - index++; + case "get_from_editor": + // Parse all img tags and replace them with object+embed + var startPos = -1; + + while ((startPos = content.indexOf('', startPos); + var attribs = TinyMCE_FlashPlugin._parseAttributes(content.substring(startPos + 4, endPos)); + + // Is not flash, skip it + if (attribs['class'] != "mceItemFlash") + continue; + + endPos += 2; + + var embedHTML = ''; + var wmode = tinyMCE.getParam("flash_wmode", ""); + var quality = tinyMCE.getParam("flash_quality", "high"); + var menu = tinyMCE.getParam("flash_menu", "false"); + + // Insert object + embed + embedHTML += ''; + embedHTML += ''; + embedHTML += ''; + embedHTML += ''; + embedHTML += ''; + embedHTML += ''; + + // Insert embed/object chunk + chunkBefore = content.substring(0, startPos); + chunkAfter = content.substring(endPos); + content = chunkBefore + embedHTML + chunkAfter; + } + break; + } - startPos++; + // Pass through to next handler in chain + return content; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + if (node == null) + return; + + do { + if (node.nodeName == "IMG" && tinyMCE.getAttrib(node, 'class').indexOf('mceItemFlash') == 0) { + tinyMCE.switchClass(editor_id + '_flash', 'mceButtonSelected'); + return true; } + } while ((node = node.parentNode)); - break; + tinyMCE.switchClass(editor_id + '_flash', 'mceButtonNormal'); - case "get_from_editor": - // Parse all img tags and replace them with object+embed - var startPos = -1; - while ((startPos = content.indexOf('', startPos); - var attribs = TinyMCE_flash_parseAttributes(content.substring(startPos + 4, endPos)); - - // Is not flash, skip it - if (attribs['class'] != "mceItemFlash") - continue; - - endPos += 2; - - var embedHTML = ''; - var wmode = tinyMCE.getParam("flash_wmode", ""); - var quality = tinyMCE.getParam("flash_quality", "high"); - var menu = tinyMCE.getParam("flash_menu", "false"); - - // Insert object + embed - embedHTML += ''; - embedHTML += ''; - embedHTML += ''; - embedHTML += ''; - embedHTML += ''; - embedHTML += ''; - - // Insert embed/object chunk - chunkBefore = content.substring(0, startPos); - chunkAfter = content.substring(endPos); - content = chunkBefore + embedHTML + chunkAfter; - } - break; - } + return true; + }, + + // Private plugin internal functions + + _parseAttributes : function(attribute_string) { + var attributeName = ""; + var attributeValue = ""; + var withInName; + var withInValue; + var attributes = new Array(); + var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g'); + + if (attribute_string == null || attribute_string.length < 2) + return null; + + withInName = withInValue = false; + + for (var i=0; i';}return "";}function TinyMCE_fullscreen_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceFullScreen":if(tinyMCE.getParam('fullscreen_is_enabled')){window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'),'mceSetContent',false,tinyMCE.getContent(editor_id));top.close();}else{tinyMCE.setWindowArg('editor_id',editor_id);var win=window.open(tinyMCE.baseURL+"/plugins/fullscreen/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);}return true;}return false;} \ No newline at end of file +tinyMCE.importPluginLanguagePack('fullscreen','en,tr,sv,cs,fr_ca,zh_cn,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br');var TinyMCE_FullScreenPlugin={getInfo:function(){return{longname:'Fullscreen',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_fullscreen.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"fullscreen":return tinyMCE.getButtonHTML(cn,'lang_fullscreen_desc','{$pluginurl}/images/fullscreen.gif','mceFullScreen');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceFullScreen":if(tinyMCE.getParam('fullscreen_is_enabled')){window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'),'mceSetContent',false,tinyMCE.getContent(editor_id));top.close();}else{tinyMCE.setWindowArg('editor_id',editor_id);var win=window.open(tinyMCE.baseURL+"/plugins/fullscreen/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{win.resizeTo(screen.availWidth,screen.availHeight);}catch(e){}}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){if(tinyMCE.getParam('fullscreen_is_enabled'))tinyMCE.switchClass(editor_id+'_fullscreen','mceButtonSelected');return true;}};tinyMCE.addPlugin("fullscreen",TinyMCE_FullScreenPlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/editor_plugin_src.js 2006-06-25 16:54:23.000000000 -0400 @@ -1,45 +1,63 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('fullscreen', 'en,sv,cs,fr_ca,zh_cn,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br'); - -function TinyMCE_fullscreen_getInfo() { - return { - longname : 'Fullscreen', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_fullscreen.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.16 $ + * $Date: 2006/03/14 17:33:39 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ -function TinyMCE_fullscreen_getControlHTML(control_name) { - switch (control_name) { - case "fullscreen": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceFullScreen\');return false;'; - return ''; - } +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('fullscreen', 'en,tr,sv,cs,fr_ca,zh_cn,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br'); - return ""; -} +var TinyMCE_FullScreenPlugin = { + getInfo : function() { + return { + longname : 'Fullscreen', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_fullscreen.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + getControlHTML : function(cn) { + switch (cn) { + case "fullscreen": + return tinyMCE.getButtonHTML(cn, 'lang_fullscreen_desc', '{$pluginurl}/images/fullscreen.gif', 'mceFullScreen'); + } + + return ""; + }, + + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceFullScreen": + if (tinyMCE.getParam('fullscreen_is_enabled')) { + // In fullscreen mode + window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'), 'mceSetContent', false, tinyMCE.getContent(editor_id)); + top.close(); + } else { + tinyMCE.setWindowArg('editor_id', editor_id); + + var win = window.open(tinyMCE.baseURL + "/plugins/fullscreen/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); + try { win.resizeTo(screen.availWidth, screen.availHeight); } catch (e) {} + } + + return true; + } + + // Pass to next handler in chain + return false; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + if (tinyMCE.getParam('fullscreen_is_enabled')) + tinyMCE.switchClass(editor_id + '_fullscreen', 'mceButtonSelected'); -function TinyMCE_fullscreen_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mceFullScreen": - if (tinyMCE.getParam('fullscreen_is_enabled')) { - // In fullscreen mode - window.opener.tinyMCE.execInstanceCommand(tinyMCE.getParam('fullscreen_editor_id'), 'mceSetContent', false, tinyMCE.getContent(editor_id)); - top.close(); - } else { - tinyMCE.setWindowArg('editor_id', editor_id); - - var win = window.open(tinyMCE.baseURL + "/plugins/fullscreen/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight); - } - - return true; + return true; } +}; - // Pass to next handler in chain - return false; -} - - +tinyMCE.addPlugin("fullscreen", TinyMCE_FullScreenPlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/fullscreen/fullscreen.htm 2006-06-25 16:54:23.000000000 -0400 @@ -29,6 +29,7 @@ patchCallback(settings, 'init_instance_callback'); patchCallback(settings, 'file_browser_callback'); patchCallback(settings, 'cleanup_callback'); + patchCallback(settings, 'execcommand_callback'); patchCallback(settings, 'oninit'); // Set options @@ -46,7 +47,7 @@ function setupContent(editor_id, body, doc) { var inst = tinyMCE.getInstanceById(editor_id); - var backInst = window.opener.tinyMCE.getInstanceById(tinyMCE.getParam('fullscreen_editor_id')); + var content = window.opener.tinyMCE.getContent(tinyMCE.getParam('fullscreen_editor_id')); // Setup title var divElm = document.createElement("div"); @@ -54,20 +55,37 @@ document.title = divElm.innerHTML; // Get content - inst.getBody().innerHTML = backInst.getBody().innerHTML; + inst.execCommand('mceSetContent', false, content); } function unloadHandler(e) { + moveContent(); + } + + function moveContent() { var doc = tinyMCE.isMSIE ? window.frames['mce_editor_0'].window.document : document.getElementById('mce_editor_0').contentDocument; window.opener.tinyMCE.setInnerHTML(window.opener.tinyMCE.selectedInstance.getBody(), doc.body.innerHTML); } // Add onunload tinyMCE.addEvent(window, "beforeunload", unloadHandler); + + function doParentSubmit() { + moveContent(); + + if (window.opener.tinyMCE.selectedInstance.formElement.form) + window.opener.tinyMCE.selectedInstance.formElement.form.submit(); + + window.close(); + + return false; + } - + +
      +
      diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin.js 1969-12-31 19:00:00.000000000 -0500 @@ -1 +0,0 @@ -tinyMCE.importPluginLanguagePack('iespell','cs,el,en,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl,da,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_iespell_getInfo(){return{longname:'IESpell',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_iespell_getControlHTML(control_name){if(control_name=="iespell"&&(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceIESpell\');return false;';return '';}return "";}function TinyMCE_iespell_execCommand(editor_id,element,command,user_interface,value){if(command=="mceIESpell"){try{var ieSpell=new ActiveXObject("ieSpell.ieSpellExtension");ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement);}catch(e){if(e.number==-2146827859){if(confirm(tinyMCE.getLang("lang_iespell_download","",true)))window.open('http://www.iespell.com/download.php','ieSpellDownload','');}else alert("Error Loading ieSpell: Exception "+e.number);}return true;}return false;} \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/editor_plugin_src.js 1969-12-31 19:00:00.000000000 -0500 @@ -1,49 +0,0 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('iespell', 'cs,el,en,fr_ca,it,ko,sv,zh_cn,fr,de,pl,pt_br,nl,da,he,nb,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk'); - -function TinyMCE_iespell_getInfo() { - return { - longname : 'IESpell', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_iespell.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; - -/** - * Returns the HTML contents of the iespell control. - */ -function TinyMCE_iespell_getControlHTML(control_name) { - // Is it the iespell control and is the brower MSIE. - if (control_name == "iespell" && (tinyMCE.isMSIE && !tinyMCE.isOpera)) { - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceIESpell\');return false;'; - return ''; - } - - return ""; -} - -/** - * Executes the mceIESpell command. - */ -function TinyMCE_iespell_execCommand(editor_id, element, command, user_interface, value) { - // Handle ieSpellCommand - if (command == "mceIESpell") { - try { - var ieSpell = new ActiveXObject("ieSpell.ieSpellExtension"); - ieSpell.CheckDocumentNode(tinyMCE.getInstanceById(editor_id).contentDocument.documentElement); - } catch (e) { - if (e.number == -2146827859) { - if (confirm(tinyMCE.getLang("lang_iespell_download", "", true))) - window.open('http://www.iespell.com/download.php', 'ieSpellDownload', ''); - } else - alert("Error Loading ieSpell: Exception " + e.number); - } - - return true; - } - - // Pass to next handler in chain - return false; -} \ No newline at end of file Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/images/Thumbs.db and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/images/Thumbs.db differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/images/iespell.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/images/iespell.gif differ diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/index.html joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/index.html --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/index.html 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/index.html 1969-12-31 19:00:00.000000000 -0500 @@ -1 +0,0 @@ - \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/langs/en.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/langs/en.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/iespell/langs/en.js 1969-12-31 19:00:00.000000000 -0500 @@ -1,7 +0,0 @@ -// UK lang variables - -tinyMCE.addToLang('',{ -iespell_desc : 'Run spell checking', -iespell_download : "ieSpell not detected. Click OK to go to download page." -}); - diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/css/inlinepopup.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/css/inlinepopup.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/css/inlinepopup.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/css/inlinepopup.css 2006-06-25 16:54:22.000000000 -0400 @@ -2,8 +2,8 @@ .mceWindow { position: absolute; - left: 0px; - top: 0px; + left: 0; + top: 0; border: 1px solid black; background-color: #D4D0C8; } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/inlinepopups/editor_plugin.js 2006-06-25 16:54:22.000000000 -0400 @@ -1 +1 @@ -function TinyMCE_inlinepopups_getInfo(){return{longname:'Inline Popups',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_inlinepopups.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};TinyMCE.prototype.orgOpenWindow=TinyMCE.prototype.openWindow;TinyMCE.prototype.openWindow=function(template,args){if(args['inline']!="yes"||tinyMCE.isOpera||tinyMCE.getParam("plugins").indexOf('inlinepopups')==-1){mcWindows.selectedWindow=null;args['mce_inside_iframe']=false;this.orgOpenWindow(template,args);return;}var url,resizable,scrollbars;args['mce_inside_iframe']=true;tinyMCE.windowArgs=args;if(template['file'].charAt(0)!='/'&&template['file'].indexOf('://')==-1)url=tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/"+template['file'];else url=template['file'];if(!(width=parseInt(template['width'])))width=320;if(!(height=parseInt(template['height'])))height=200;resizable=(args&&args['resizable'])?args['resizable']:"no";scrollbars=(args&&args['scrollbars'])?args['scrollbars']:"no";height+=18;for(var name in args){if(typeof(args[name])=='function')continue;url=tinyMCE.replaceVar(url,name,escape(args[name]));}var elm=document.getElementById(this.selectedInstance.editorId+'_parent');var pos=tinyMCE.getAbsPosition(elm);pos.absLeft+=Math.round((elm.firstChild.clientWidth/2)-(width/2));pos.absTop+=Math.round((elm.firstChild.clientHeight/2)-(height/2));mcWindows.open(url,mcWindows.idCounter++,"modal=yes,width="+width+",height="+height+",resizable="+resizable+",scrollbars="+scrollbars+",statusbar="+resizable+",left="+pos.absLeft+",top="+pos.absTop);};TinyMCE.prototype.orgCloseWindow=TinyMCE.prototype.closeWindow;TinyMCE.prototype.closeWindow=function(win){if(mcWindows.selectedWindow!=null)mcWindows.selectedWindow.close();else this.orgCloseWindow(win);};TinyMCE.prototype.setWindowTitle=function(win_ref,title){for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(typeof(win)=='function')continue;if(win_ref.name==win.id+"_iframe")window.frames[win.id+"_iframe"].document.getElementById(win.id+'_title').innerHTML=title;}};function MCWindows(){this.settings=new Array();this.windows=new Array();this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isGecko=navigator.userAgent.indexOf('Gecko')!=-1;this.isSafari=navigator.userAgent.indexOf('Safari')!=-1;this.isMac=navigator.userAgent.indexOf('Mac')!=-1;this.isMSIE5_0=this.isMSIE&&(navigator.userAgent.indexOf('MSIE 5.0')!=-1);this.action="none";this.selectedWindow=null;this.lastSelectedWindow=null;this.zindex=100;this.mouseDownScreenX=0;this.mouseDownScreenY=0;this.mouseDownLayerX=0;this.mouseDownLayerY=0;this.mouseDownWidth=0;this.mouseDownHeight=0;this.idCounter=0;};MCWindows.prototype.init=function(settings){this.settings=settings;if(this.isMSIE)this.addEvent(document,"mousemove",mcWindows.eventDispatcher);else this.addEvent(window,"mousemove",mcWindows.eventDispatcher);this.addEvent(document,"mouseup",mcWindows.eventDispatcher);this.doc=document;};MCWindows.prototype.getParam=function(name,default_value){var value=null;value=(typeof(this.settings[name])=="undefined")?default_value:this.settings[name];if(value=="true"||value=="false")return(value=="true");return value;};MCWindows.prototype.eventDispatcher=function(e){e=typeof(e)=="undefined"?window.event:e;if(mcWindows.selectedWindow==null)return;if(mcWindows.isGecko&&e.type=="mousedown"){var elm=e.currentTarget;for(var n in mcWindows.windows){var win=mcWindows.windows[n];if(win.headElement==elm||win.resizeElement==elm){win.focus();break;}}}switch(e.type){case "mousemove":mcWindows.selectedWindow.onMouseMove(e);break;case "mouseup":mcWindows.selectedWindow.onMouseUp(e);break;case "mousedown":mcWindows.selectedWindow.onMouseDown(e);break;case "focus":mcWindows.selectedWindow.onFocus(e);break;}};MCWindows.prototype.addEvent=function(obj,name,handler){if(this.isMSIE)obj.attachEvent("on"+name,handler);else obj.addEventListener(name,handler,true);};MCWindows.prototype.cancelEvent=function(e){if(this.isMSIE){e.returnValue=false;e.cancelBubble=true;}else e.preventDefault();};MCWindows.prototype.parseFeatures=function(opts){opts=opts.toLowerCase();opts=opts.replace(/;/g,",");opts=opts.replace(/[^0-9a-z=,]/g,"");var optionChunks=opts.split(',');var options=new Array();options['left']="10";options['top']="10";options['width']="300";options['height']="300";options['resizable']="yes";options['minimizable']="yes";options['maximizable']="yes";options['close']="yes";options['movable']="yes";options['statusbar']="yes";options['scrollbars']="auto";options['modal']="no";if(opts=="")return options;for(var i=0;i';html+='';html+='';html+='Wrapper iframe';html+='';html+='';html+='';html+='';html+='
      ';html+='
      ';html+='
      ';html+='
      ';html+='
      ';html+='
      ';if(features['statusbar']=="yes"){html+='
      ';if(features['resizable']=="yes"){if(this.isGecko)html+='
      ';else html+='
      ';}html+='
      ';}html+='
      ';html+='';html+='';this.createFloatingIFrame(id,features['left'],features['top'],features['width'],features['height'],html);};MCWindows.prototype.setDocumentLock=function(state){if(state){var elm=document.getElementById('mcWindowEventBlocker');if(elm==null){elm=document.createElement("div");elm.id="mcWindowEventBlocker";elm.style.position="absolute";elm.style.left="0px";elm.style.top="0px";document.body.appendChild(elm);}elm.style.display="none";var imgPath=this.getParam("images_path");var width=document.body.clientWidth;var height=document.body.clientHeight;elm.style.width=width;elm.style.height=height;elm.innerHTML='';elm.style.zIndex=mcWindows.zindex-1;elm.style.display="block";}else{var elm=document.getElementById('mcWindowEventBlocker');if(mcWindows.windows.length==0)elm.parentNode.removeChild(elm);else elm.style.zIndex=mcWindows.zindex-1;}};MCWindows.prototype.onLoad=function(name){var win=mcWindows.windows[name];var id="mcWindow_"+name;var wrapperIframe=window.frames[id+"_iframe"].frames[0];var wrapperDoc=window.frames[id+"_iframe"].document;var doc=window.frames[id+"_iframe"].document;var winDiv=document.getElementById("mcWindow_"+name+"_div");var realIframe=window.frames[id+"_iframe"].frames[0];win.id="mcWindow_"+name;win.winElement=winDiv;win.bodyElement=doc.getElementById(id+'_body');win.iframeElement=doc.getElementById(id+'_iframe');win.headElement=doc.getElementById(id+'_head');win.titleElement=doc.getElementById(id+'_title');win.resizeElement=doc.getElementById(id+'_resize');win.containerElement=doc.getElementById(id+'_container');win.left=win.features['left'];win.top=win.features['top'];win.frame=window.frames[id+'_iframe'].frames[0];win.wrapperFrame=window.frames[id+'_iframe'];win.wrapperIFrameElement=document.getElementById(id+"_iframe");mcWindows.addEvent(win.headElement,"mousedown",mcWindows.eventDispatcher);if(win.resizeElement!=null)mcWindows.addEvent(win.resizeElement,"mousedown",mcWindows.eventDispatcher);if(mcWindows.isMSIE){mcWindows.addEvent(realIframe.document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe.document,"mouseup",mcWindows.eventDispatcher);}else{mcWindows.addEvent(realIframe,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe,"mouseup",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe,"focus",mcWindows.eventDispatcher);}for(var i=0;i';html+='';html+='';html+='Wrapper iframe';html+='';html+='';html+='';html+='';html+='
      ';html+='
      ';html+='
      ';html+='
      ';html+='
      ';html+='
      ';if(features['statusbar']=="yes"){html+='
      ';if(features['resizable']=="yes"){if(this.isGecko)html+='
      ';else html+='
      ';}html+='
      ';}html+='
      ';html+='';html+='';this.createFloatingIFrame(id,features['left'],features['top'],features['width'],features['height'],html);};TinyMCE_Windows.prototype.setDocumentLock=function(state){if(state){var elm=document.getElementById('mcWindowEventBlocker');if(elm==null){elm=document.createElement("div");elm.id="mcWindowEventBlocker";elm.style.position="absolute";elm.style.left="0";elm.style.top="0";document.body.appendChild(elm);}elm.style.display="none";var imgPath=this.getParam("images_path");var width=document.body.clientWidth;var height=document.body.clientHeight;elm.style.width=width;elm.style.height=height;elm.innerHTML='';elm.style.zIndex=mcWindows.zindex-1;elm.style.display="block";}else{var elm=document.getElementById('mcWindowEventBlocker');if(mcWindows.windows.length==0)elm.parentNode.removeChild(elm);else elm.style.zIndex=mcWindows.zindex-1;}};TinyMCE_Windows.prototype.onLoad=function(name){var win=mcWindows.windows[name];var id="mcWindow_"+name;var wrapperIframe=window.frames[id+"_iframe"].frames[0];var wrapperDoc=window.frames[id+"_iframe"].document;var doc=window.frames[id+"_iframe"].document;var winDiv=document.getElementById("mcWindow_"+name+"_div");var realIframe=window.frames[id+"_iframe"].frames[0];win.id="mcWindow_"+name;win.winElement=winDiv;win.bodyElement=doc.getElementById(id+'_body');win.iframeElement=doc.getElementById(id+'_iframe');win.headElement=doc.getElementById(id+'_head');win.titleElement=doc.getElementById(id+'_title');win.resizeElement=doc.getElementById(id+'_resize');win.containerElement=doc.getElementById(id+'_container');win.left=win.features['left'];win.top=win.features['top'];win.frame=window.frames[id+'_iframe'].frames[0];win.wrapperFrame=window.frames[id+'_iframe'];win.wrapperIFrameElement=document.getElementById(id+"_iframe");mcWindows.addEvent(win.headElement,"mousedown",mcWindows.eventDispatcher);if(win.resizeElement!=null)mcWindows.addEvent(win.resizeElement,"mousedown",mcWindows.eventDispatcher);if(mcWindows.isMSIE){mcWindows.addEvent(realIframe.document,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe.document,"mouseup",mcWindows.eventDispatcher);}else{mcWindows.addEvent(realIframe,"mousemove",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe,"mouseup",mcWindows.eventDispatcher);mcWindows.addEvent(realIframe,"focus",mcWindows.eventDispatcher);}for(var i=0;i';case "inserttime":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceInsertTime\');return false;';return '';}return "";}function TinyMCE_insertdatetime_execCommand(editor_id,element,command,user_interface,value){function addZeros(value,len){value=""+value;if(value.length'; - - case "inserttime": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceInsertTime\');return false;'; - return ''; - } + case "inserttime": + return tinyMCE.getButtonHTML(cn, 'lang_inserttime_desc', '{$pluginurl}/images/inserttime.gif', 'mceInsertTime'); + } - return ""; -} + return ""; + }, -/** - * Executes the mceInsertDate command. - */ -function TinyMCE_insertdatetime_execCommand(editor_id, element, command, user_interface, value) { - /* Adds zeros infront of value */ - function addZeros(value, len) { - value = "" + value; - - if (value.length < len) { - for (var i=0; i<(len-value.length); i++) - value = "0" + value; + /** + * Executes the mceInsertDate command. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + /* Adds zeros infront of value */ + function addZeros(value, len) { + value = "" + value; + + if (value.length < len) { + for (var i=0; i<(len-value.length); i++) + value = "0" + value; + } + + return value; } - return value; - } + /* Returns the date object in the specified format */ + function getDateTime(date, format) { + format = tinyMCE.regexpReplace(format, "%D", "%m/%d/%y"); + format = tinyMCE.regexpReplace(format, "%r", "%I:%M:%S %p"); + format = tinyMCE.regexpReplace(format, "%Y", "" + date.getFullYear()); + format = tinyMCE.regexpReplace(format, "%y", "" + date.getYear()); + format = tinyMCE.regexpReplace(format, "%m", addZeros(date.getMonth()+1, 2)); + format = tinyMCE.regexpReplace(format, "%d", addZeros(date.getDate(), 2)); + format = tinyMCE.regexpReplace(format, "%H", "" + addZeros(date.getHours(), 2)); + format = tinyMCE.regexpReplace(format, "%M", "" + addZeros(date.getMinutes(), 2)); + format = tinyMCE.regexpReplace(format, "%S", "" + addZeros(date.getSeconds(), 2)); + format = tinyMCE.regexpReplace(format, "%I", "" + ((date.getHours() + 11) % 12 + 1)); + format = tinyMCE.regexpReplace(format, "%p", "" + (date.getHours() < 12 ? "AM" : "PM")); + format = tinyMCE.regexpReplace(format, "%B", "" + tinyMCE.getLang("lang_inserttime_months_long")[date.getMonth()]); + format = tinyMCE.regexpReplace(format, "%b", "" + tinyMCE.getLang("lang_inserttime_months_short")[date.getMonth()]); + format = tinyMCE.regexpReplace(format, "%A", "" + tinyMCE.getLang("lang_inserttime_day_long")[date.getDay()]); + format = tinyMCE.regexpReplace(format, "%a", "" + tinyMCE.getLang("lang_inserttime_day_short")[date.getDay()]); + format = tinyMCE.regexpReplace(format, "%%", "%"); - /* Returns the date object in the specified format */ - function getDateTime(date, format) { - format = tinyMCE.regexpReplace(format, "%D", "%m/%d/%y"); - format = tinyMCE.regexpReplace(format, "%r", "%I:%M:%S %p"); - format = tinyMCE.regexpReplace(format, "%Y", "" + date.getFullYear()); - format = tinyMCE.regexpReplace(format, "%y", "" + date.getYear()); - format = tinyMCE.regexpReplace(format, "%m", addZeros(date.getMonth()+1, 2)); - format = tinyMCE.regexpReplace(format, "%d", addZeros(date.getDate(), 2)); - format = tinyMCE.regexpReplace(format, "%H", "" + addZeros(date.getHours(), 2)); - format = tinyMCE.regexpReplace(format, "%M", "" + addZeros(date.getMinutes(), 2)); - format = tinyMCE.regexpReplace(format, "%S", "" + addZeros(date.getSeconds(), 2)); - format = tinyMCE.regexpReplace(format, "%I", "" + ((date.getHours() + 11) % 12 + 1)); - format = tinyMCE.regexpReplace(format, "%p", "" + (date.getHours() < 12 ? "AM" : "PM")); - format = tinyMCE.regexpReplace(format, "%B", "" + tinyMCE.getLang("lang_inserttime_months_long")[date.getMonth()]); - format = tinyMCE.regexpReplace(format, "%b", "" + tinyMCE.getLang("lang_inserttime_months_short")[date.getMonth()]); - format = tinyMCE.regexpReplace(format, "%A", "" + tinyMCE.getLang("lang_inserttime_day_long")[date.getDay()]); - format = tinyMCE.regexpReplace(format, "%a", "" + tinyMCE.getLang("lang_inserttime_day_short")[date.getDay()]); - format = tinyMCE.regexpReplace(format, "%%", "%"); + return format; + } - return format; - } + // Handle commands + switch (command) { + case "mceInsertDate": + tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_dateFormat", tinyMCE.getLang('lang_insertdate_def_fmt')))); + return true; + + case "mceInsertTime": + tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_timeFormat", tinyMCE.getLang('lang_inserttime_def_fmt')))); + return true; + } - // Handle commands - switch (command) { - case "mceInsertDate": - tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_dateFormat", tinyMCE.getLang('lang_insertdate_def_fmt')))); - return true; - - case "mceInsertTime": - tinyMCE.execInstanceCommand(editor_id, 'mceInsertContent', false, getDateTime(new Date(), tinyMCE.getParam("plugin_insertdate_timeFormat", tinyMCE.getLang('lang_inserttime_def_fmt')))); - return true; + // Pass to next handler in chain + return false; } +}; - // Pass to next handler in chain - return false; -} +tinyMCE.addPlugin("insertdatetime", TinyMCE_InsertDateTimePlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin.js 2006-06-25 16:54:24.000000000 -0400 @@ -0,0 +1 @@ +tinyMCE.importPluginLanguagePack('layer','en');var TinyMCE_LayerPlugin={getInfo:function(){return{longname:'Layer',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_layer.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){if(tinyMCE.isMSIE&&!tinyMCE.isOpera)inst.getDoc().execCommand('2D-Position');},handleEvent:function(e){var inst=tinyMCE.selectedInstance,self=TinyMCE_LayerPlugin;var w=inst.getWin(),le=inst._lastStyleElm,e;if(tinyMCE.isGecko){e=self._getParentLayer(inst.getFocusElement());if(e){if(!inst._lastStyleElm){e.style.overflow='auto';inst._lastStyleElm=e;}}else if(le){le=inst._lastStyleElm;le.style.width=le.scrollWidth+'px';le.style.height=le.scrollHeight+'px';le.style.overflow='';inst._lastStyleElm=null;}}return true;},handleVisualAid:function(el,deep,state,inst){var nl=inst.getDoc().getElementsByTagName("div"),i;for(i=0;i-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else{if(z[ci]>0)nl[ci].style.zIndex=z[ci]-1;}}else{for(i=0;iz[ci]){fi=i;break;}}if(fi>-1){nl[ci].style.zIndex=z[fi];nl[fi].style.zIndex=z[ci];}else nl[ci].style.zIndex=z[ci]+1;}inst.repaint();},_getParentLayer:function(n){return tinyMCE.getParentNode(n,function(n){return n.nodeType==1&&new RegExp('absolute|relative|static','gi').test(n.style.position);});},_insertLayer:function(){var inst=tinyMCE.selectedInstance;var e=tinyMCE.getParentElement(inst.getFocusElement());var p=tinyMCE.getAbsPosition(e);var d=inst.getDoc();var ne=d.createElement('div');var h=inst.selection.getSelectedHTML();ne.style.position='absolute';ne.style.left=p.absLeft+'px';ne.style.top=(p.absTop>20?p.absTop:20)+'px';ne.style.width='100px';ne.style.height='100px';ne.className='mceVisualAid';if(!h)h=tinyMCE.getLang('lang_layer_content');ne.innerHTML=h;d.body.appendChild(ne);},_toggleAbsolute:function(){var inst=tinyMCE.selectedInstance,self=TinyMCE_LayerPlugin;var le=self._getParentLayer(inst.getFocusElement());if(le==null)le=tinyMCE.getParentElement(inst.getFocusElement(),'div,p,img');if(le){if(le.style.position.toLowerCase()=="absolute"){le.style.position="";le.style.left="";le.style.top="";}else{le.style.position="absolute";if(le.style.left=="")le.style.left=20+'px';if(le.style.top=="")le.style.top=20+'px';if(le.style.width=="")le.style.width=le.width?(le.width+'px'):'100px';if(le.style.height=="")le.style.height=le.height?(le.height+'px'):'100px';tinyMCE.handleVisualAid(inst.getBody(),true,inst.visualAid,inst);}inst.repaint();tinyMCE.triggerNodeChange();}}};tinyMCE.addPlugin("layer",TinyMCE_LayerPlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/editor_plugin_src.js 2006-06-25 16:54:24.000000000 -0400 @@ -0,0 +1,252 @@ +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.2 $ + * $Date: 2006/05/03 14:12:12 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('layer', 'en'); + +var TinyMCE_LayerPlugin = { + getInfo : function() { + return { + longname : 'Layer', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_layer.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + initInstance : function(inst) { + if (tinyMCE.isMSIE && !tinyMCE.isOpera) + inst.getDoc().execCommand('2D-Position'); + }, + + handleEvent : function(e) { + var inst = tinyMCE.selectedInstance, self = TinyMCE_LayerPlugin; + var w = inst.getWin(), le = inst._lastStyleElm, e; + + if (tinyMCE.isGecko) { + e = self._getParentLayer(inst.getFocusElement()); + + if (e) { + if (!inst._lastStyleElm) { + e.style.overflow = 'auto'; + inst._lastStyleElm = e; + } + } else if (le) { + le = inst._lastStyleElm; + le.style.width = le.scrollWidth + 'px'; + le.style.height = le.scrollHeight + 'px'; + le.style.overflow = ''; + inst._lastStyleElm = null; + } + } + + return true; + }, + + handleVisualAid : function(el, deep, state, inst) { + var nl = inst.getDoc().getElementsByTagName("div"), i; + + for (i=0; i -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else { + if (z[ci] > 0) + nl[ci].style.zIndex = z[ci] - 1; + } + } else { + // Move forward + + // Try find a higher one + for (i=0; i z[ci]) { + fi = i; + break; + } + } + + if (fi > -1) { + nl[ci].style.zIndex = z[fi]; + nl[fi].style.zIndex = z[ci]; + } else + nl[ci].style.zIndex = z[ci] + 1; + } + + inst.repaint(); + }, + + _getParentLayer : function(n) { + return tinyMCE.getParentNode(n, function(n) { + return n.nodeType == 1 && new RegExp('absolute|relative|static', 'gi').test(n.style.position); + }); + }, + + _insertLayer : function() { + var inst = tinyMCE.selectedInstance; + var e = tinyMCE.getParentElement(inst.getFocusElement()); + var p = tinyMCE.getAbsPosition(e); + var d = inst.getDoc(); + var ne = d.createElement('div'); + var h = inst.selection.getSelectedHTML(); + + // Move div + ne.style.position = 'absolute'; + ne.style.left = p.absLeft + 'px'; + ne.style.top = (p.absTop > 20 ? p.absTop : 20) + 'px'; + ne.style.width = '100px'; + ne.style.height = '100px'; + ne.className = 'mceVisualAid'; + + if (!h) + h = tinyMCE.getLang('lang_layer_content'); + + ne.innerHTML = h; + + // Add it + d.body.appendChild(ne); + }, + + _toggleAbsolute : function() { + var inst = tinyMCE.selectedInstance, self = TinyMCE_LayerPlugin; + var le = self._getParentLayer(inst.getFocusElement()); + + if (le == null) + le = tinyMCE.getParentElement(inst.getFocusElement(), 'div,p,img'); + + if (le) { + if (le.style.position.toLowerCase() == "absolute") { + le.style.position = ""; + le.style.left = ""; + le.style.top = ""; + } else { + le.style.position = "absolute"; + + if (le.style.left == "") + le.style.left = 20 + 'px'; + + if (le.style.top == "") + le.style.top = 20 + 'px'; + + if (le.style.width == "") + le.style.width = le.width ? (le.width + 'px') : '100px'; + + if (le.style.height == "") + le.style.height = le.height ? (le.height + 'px') : '100px'; + + tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst); + } + + inst.repaint(); + tinyMCE.triggerNodeChange(); + } + } +}; + +tinyMCE.addPlugin("layer", TinyMCE_LayerPlugin); Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/images/absolute.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/images/absolute.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/images/backward.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/images/backward.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/images/forward.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/images/forward.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/images/insert_layer.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/images/insert_layer.gif differ diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/langs/en.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/langs/en.js 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/layer/langs/en.js 2006-06-25 16:54:24.000000000 -0400 @@ -0,0 +1,9 @@ +// UK lang variables + +tinyMCE.addToLang('layer',{ +insertlayer_desc : 'Insert new layer', +forward_desc : 'Move forward', +backward_desc : 'Move backward', +absolute_desc : 'Toggle absolute positioning', +content : 'New layer...' +}); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/noneditable/css/noneditable.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/noneditable/css/noneditable.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/noneditable/css/noneditable.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/noneditable/css/noneditable.css 2006-06-25 16:54:20.000000000 -0400 @@ -1,6 +1,6 @@ /* This is the CSS file for the noneditable elements plugin */ -.mceItemEditable { +.mceEditable { /*border: 1px dotted #0000cc;*/ -moz-user-focus: none; -moz-user-input: auto; @@ -8,7 +8,7 @@ -moz-user-select: text; } -.mceItemNonEditable { +.mceNonEditable { /*border: 1px dotted #cc0000;*/ -moz-user-focus: ignore; /*-moz-user-input: disabled;*/ diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/noneditable/editor_plugin.js 2006-06-25 16:54:20.000000000 -0400 @@ -1 +1 @@ -function TinyMCE_noneditable_getInfo(){return{longname:'Non editable elements',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_noneditable.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_noneditable_initInstance(inst){tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/plugins/noneditable/css/noneditable.css");if(tinyMCE.isMSIE5_0)tinyMCE.settings['plugins']=tinyMCE.settings['plugins'].replace(/noneditable/gi,'Noneditable');if(tinyMCE.isGecko){tinyMCE.addEvent(inst.getDoc(),"keyup",TinyMCE_noneditable_fixKeyUp);}}function TinyMCE_noneditable_fixKeyUp(e){var inst=tinyMCE.selectedInstance;var sel=inst.getSel();var rng=inst.getRng();var an=sel.anchorNode;if((e.keyCode==38||e.keyCode==37||e.keyCode==40||e.keyCode==39)&&(elm=TinyMCE_noneditable_isNonEditable(an))!=null){rng=inst.getDoc().createRange();rng.selectNode(elm);rng.collapse(true);sel.removeAllRanges();sel.addRange(rng);tinyMCE.cancelEvent(e);}}function TinyMCE_noneditable_selectAll(e){var inst=tinyMCE.selectedInstance;var sel=inst.getSel();var doc=inst.getDoc();if((elm=TinyMCE_noneditable_isNonEditable(sel.focusNode))!=null){inst.selectNode(elm,false);tinyMCE.cancelEvent(e);return;}if((elm=TinyMCE_noneditable_isNonEditable(sel.anchorNode))!=null){inst.selectNode(elm,false);tinyMCE.cancelEvent(e);return;}}function TinyMCE_noneditable_isNonEditable(elm){var editClass=tinyMCE.getParam("noneditable_editable_class","mceItemEditable");var nonEditClass=tinyMCE.getParam("noneditable_noneditable_class","mceItemNonEditable");if(!elm)return;do{var className=elm.className?elm.className:"";if(className.indexOf(editClass)!=-1)return null;if(className.indexOf(nonEditClass)!=-1)return elm;}while(elm=elm.parentNode);return null;}function TinyMCE_noneditable_cleanup(type,content,inst){switch(type){case "insert_to_editor_dom":var nodes=tinyMCE.getNodeTree(content,new Array(),1);var editClass=tinyMCE.getParam("noneditable_editable_class","mceItemEditable");var nonEditClass=tinyMCE.getParam("noneditable_noneditable_class","mceItemNonEditable");for(var i=0;i","gi"),'<$1class="$2$3$4" contenteditable="true"$5>');content=content.replace(new RegExp("<(.*?)class=\"(.*?)("+nonEditClass+")(.*?)\"(.*?)>","gi"),'<$1class="$2$3$4" contenteditable="false"$5>');}break;case "get_from_editor_dom":if(tinyMCE.getParam("noneditable_leave_contenteditable",false)){var nodes=tinyMCE.getNodeTree(content,new Array(),1);for(var i=0;i", "gi"), '<$1class="$2$3$4" contenteditable="true"$5>'); - content = content.replace(new RegExp("<(.*?)class=\"(.*?)(" + nonEditClass + ")(.*?)\"(.*?)>", "gi"), '<$1class="$2$3$4" contenteditable="false"$5>'); - } + for (var i=0; i0)tinyMCE.execCommand('mcePasteWord',false,html);tinyMCE.cancelEvent(e);return false;}return true;}function TinyMCE_paste_getControlHTML(control_name){switch(control_name){case "pastetext":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePasteText\', true);return false;';return '';case "pasteword":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePasteWord\', true);return false;';return '';case "selectall":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSelectAll\');return false;';return '';}return '';}function TinyMCE_paste_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mcePasteText":if(user_interface){if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&!tinyMCE.getParam('paste_use_dialog',false))TinyMCE_paste__insertText(clipboardData.getData("Text"),true);else{var template=new Array();template['file']='../../plugins/paste/pastetext.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",inline:"yes",mceDo:'insert'});}}else TinyMCE_paste__insertText(value['html'],value['linebreaks']);return true;case "mcePasteWord":if(user_interface){if((tinyMCE.isMSIE&&!tinyMCE.isOpera)&&!tinyMCE.getParam('paste_use_dialog',false)){var html=TinyMCE_paste__clipboardHTML();if(html&&html.length>0)TinyMCE_paste__insertWordContent(html);}else{var template=new Array();template['file']='../../plugins/paste/pasteword.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",inline:"yes",mceDo:'insert'});}}else TinyMCE_paste__insertWordContent(value);return true;case "mceSelectAll":tinyMCE.execInstanceCommand(editor_id,'selectall');return true;}return false;}function TinyMCE_paste__insertText(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(tinyMCE.getParam("paste_create_paragraphs",true)){var rl=tinyMCE.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i

      ","gi");content=tinyMCE.regexpReplace(content,"\r\r","

      ","gi");content=tinyMCE.regexpReplace(content,"\n\n","

      ","gi");if((pos=content.indexOf('

      '))!=-1){tinyMCE.execCommand("Delete");var node=tinyMCE.selectedInstance.getFocusElement();var breakElms=new Array();do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="

      ";before+=content.substring(0,pos);for(var i=0;i";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="

      ";content=before+content.substring(pos+7)+after;}}if(tinyMCE.getParam("paste_create_linebreaks",true)){content=tinyMCE.regexpReplace(content,"\r\n","
      ","gi");content=tinyMCE.regexpReplace(content,"\r","
      ","gi");content=tinyMCE.regexpReplace(content,"\n","
      ","gi");}}tinyMCE.execCommand("mceInsertRawHTML",false,content);}}function TinyMCE_paste__insertWordContent(content){if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);var rl=tinyMCE.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i(.*?)<\/p>','gi'),'

      $1

      ');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)
      ","gi"),"

      "+middot+"$1

      ");content=content.replace(new RegExp('','gi'),""+bull);content=content.replace(/<\/o:p>/gi,"");content=content.replace(new RegExp('
      ]*>/gi,"");content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(tinyMCE.getParam("paste_strip_class_attributes","all")){case "all":content=content.replace(/<(\w[^>]*)class=([^|>]*)([^>]*)/gi,"<$1$3");break;case "mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+TinyMCE_paste__reEscape(""+document.location)+'','gi'),'href="'+tinyMCE.settings['document_base_url']);content=content.replace(/<(\w[^>]*)lang=([^|>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/--page break--\s*

       <\/p>/gi,"");content=content.replace(/--page break--/gi,"");if(!tinyMCE.settings['force_p_newlines']){content=content.replace('','','gi');content=content.replace('

      ','

      ','gi');}if(!tinyMCE.isMSIE&&!tinyMCE.settings['force_p_newlines']){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(tinyMCE.getParam("paste_convert_middot_lists",true)){var div=document.createElement("div");div.innerHTML=content;var className=tinyMCE.getParam("paste_unindented_list_class","unIndentedList");while(TinyMCE_paste_convertMiddots(div,"--list--"));while(TinyMCE_paste_convertMiddots(div,middot,className));while(TinyMCE_paste_convertMiddots(div,bull));content=div.innerHTML;}if(tinyMCE.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/ <\/h[1-6]>/gi,'

        

      ');content=content.replace(//gi,'

      ');content=content.replace(/<\/h[1-6]>/gi,'

      ');content=content.replace(/ <\/b>/gi,'  ');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");tinyMCE.execCommand("mceInsertContent",false,content);tinyMCE.execCommand("mceCleanup");}}function TinyMCE_paste__reEscape(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i0)TinyMCE_PastePlugin._insertWordContent(html);}else{var template=new Array();template['file']='../../plugins/paste/pasteword.htm';template['width']=450;template['height']=400;var plain_text="";tinyMCE.openWindow(template,{editor_id:editor_id,plain_text:plain_text,resizable:"yes",scrollbars:"no",inline:"yes",mceDo:'insert'});}}else TinyMCE_PastePlugin._insertWordContent(value);return true;case"mceSelectAll":tinyMCE.execInstanceCommand(editor_id,'selectall');return true;}return false;},_handlePasteEvent:function(e){switch(e.type){case"paste":var html=TinyMCE_PastePlugin._clipboardHTML();var r,inst=tinyMCE.selectedInstance;if(inst&&(r=inst.getRng())&&r.text.length>0)tinyMCE.execCommand('delete');if(html&&html.length>0)tinyMCE.execCommand('mcePasteWord',false,html);tinyMCE.cancelEvent(e);return false;}return true;},_insertText:function(content,bLinebreaks){if(content&&content.length>0){if(bLinebreaks){if(tinyMCE.getParam("paste_create_paragraphs",true)){var rl=tinyMCE.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i

      ","gi");content=tinyMCE.regexpReplace(content,"\r\r","

      ","gi");content=tinyMCE.regexpReplace(content,"\n\n","

      ","gi");if((pos=content.indexOf('

      '))!=-1){tinyMCE.execCommand("Delete");var node=tinyMCE.selectedInstance.getFocusElement();var breakElms=new Array();do{if(node.nodeType==1){if(node.nodeName=="TD"||node.nodeName=="BODY")break;breakElms[breakElms.length]=node;}}while(node=node.parentNode);var before="",after="

      ";before+=content.substring(0,pos);for(var i=0;i";after+="<"+breakElms[(breakElms.length-1)-i].nodeName+">";}before+="

      ";content=before+content.substring(pos+7)+after;}}if(tinyMCE.getParam("paste_create_linebreaks",true)){content=tinyMCE.regexpReplace(content,"\r\n","
      ","gi");content=tinyMCE.regexpReplace(content,"\r","
      ","gi");content=tinyMCE.regexpReplace(content,"\n","
      ","gi");}}tinyMCE.execCommand("mceInsertRawHTML",false,content);}},_insertWordContent:function(content){if(content&&content.length>0){var bull=String.fromCharCode(8226);var middot=String.fromCharCode(183);var cb;if((cb=tinyMCE.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('before', content)");var rl=tinyMCE.getParam("paste_replace_list",'\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');for(var i=0;i(.*?)<\/p>','gi'),'

      $1

      ');}content=content.replace(new RegExp('tab-stops: list [0-9]+.0pt">','gi'),'">'+"--list--");content=content.replace(new RegExp(bull+"(.*?)
      ","gi"),"

      "+middot+"$1

      ");content=content.replace(new RegExp('','gi'),""+bull);content=content.replace(/<\/o:p>/gi,"");content=content.replace(new RegExp('
      ]*>/gi,"");if(tinyMCE.getParam("paste_remove_styles",true))content=content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)','gi'),"<$1$3");content=content.replace(/<\/?font[^>]*>/gi,"");switch(tinyMCE.getParam("paste_strip_class_attributes","all")){case"all":content=content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi,"<$1$3");break;case"mso":content=content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)','gi'),"<$1$3");break;}content=content.replace(new RegExp('href="?'+TinyMCE_PastePlugin._reEscape(""+document.location)+'','gi'),'href="'+tinyMCE.settings['document_base_url']);content=content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi,"<$1$3");content=content.replace(/<\\?\?xml[^>]*>/gi,"");content=content.replace(/<\/?\w+:[^>]*>/gi,"");content=content.replace(/-- page break --\s*

       <\/p>/gi,"");content=content.replace(/-- page break --/gi,"");if(!tinyMCE.settings['force_p_newlines']){content=content.replace('','','gi');content=content.replace('

      ','

      ','gi');}if(!tinyMCE.isMSIE&&!tinyMCE.settings['force_p_newlines']){content=content.replace(/<\/?p[^>]*>/gi,"");}content=content.replace(/<\/?div[^>]*>/gi,"");if(tinyMCE.getParam("paste_convert_middot_lists",true)){var div=document.createElement("div");div.innerHTML=content;var className=tinyMCE.getParam("paste_unindented_list_class","unIndentedList");while(TinyMCE_PastePlugin._convertMiddots(div,"--list--"));while(TinyMCE_PastePlugin._convertMiddots(div,middot,className));while(TinyMCE_PastePlugin._convertMiddots(div,bull));content=div.innerHTML;}if(tinyMCE.getParam("paste_convert_headers_to_strong",false)){content=content.replace(/ <\/h[1-6]>/gi,'

        

      ');content=content.replace(//gi,'

      ');content=content.replace(/<\/h[1-6]>/gi,'

      ');content=content.replace(/ <\/b>/gi,'  ');content=content.replace(/^( )*/gi,'');}content=content.replace(/--list--/gi,"");if((cb=tinyMCE.getParam("paste_insert_word_content_callback",""))!="")content=eval(cb+"('after', content)");tinyMCE.execCommand("mceInsertContent",false,content);window.setTimeout('tinyMCE.execCommand("mceCleanup");',1);}},_reEscape:function(s){var l="?.\\*[](){}+^$:";var o="";for(var i=0;i 0) - tinyMCE.execCommand('mcePasteWord', false, html); + return ''; + }, - tinyMCE.cancelEvent(e); - return false; - } + execCommand : function(editor_id, element, command, user_interface, value) { + switch (command) { + case "mcePasteText": + if (user_interface) { + if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false)) + TinyMCE_PastePlugin._insertText(clipboardData.getData("Text"), true); + else { + var template = new Array(); + template['file'] = '../../plugins/paste/pastetext.htm'; // Relative to theme + template['width'] = 450; + template['height'] = 400; + var plain_text = ""; + tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'}); + } + } else + TinyMCE_PastePlugin._insertText(value['html'], value['linebreaks']); + + return true; + + case "mcePasteWord": + if (user_interface) { + if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false)) { + var html = TinyMCE_PastePlugin._clipboardHTML(); + + if (html && html.length > 0) + TinyMCE_PastePlugin._insertWordContent(html); + } else { + var template = new Array(); + template['file'] = '../../plugins/paste/pasteword.htm'; // Relative to theme + template['width'] = 450; + template['height'] = 400; + var plain_text = ""; + tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'}); + } + } else + TinyMCE_PastePlugin._insertWordContent(value); + + return true; + + case "mceSelectAll": + tinyMCE.execInstanceCommand(editor_id, 'selectall'); + return true; - return true; -} + } -function TinyMCE_paste_getControlHTML(control_name) { - switch (control_name) { - case "pastetext": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePasteText\', true);return false;'; - return ''; - - case "pasteword": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePasteWord\', true);return false;'; - return ''; - - case "selectall": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSelectAll\');return false;'; - return ''; - } - - return ''; -} - -function TinyMCE_paste_execCommand(editor_id, element, command, user_interface, value) { - switch (command) { - case "mcePasteText": - if (user_interface) { - if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false)) - TinyMCE_paste__insertText(clipboardData.getData("Text"), true); - else { - var template = new Array(); - template['file'] = '../../plugins/paste/pastetext.htm'; // Relative to theme - template['width'] = 450; - template['height'] = 400; - var plain_text = ""; - tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'}); - } - } else - TinyMCE_paste__insertText(value['html'], value['linebreaks']); + // Pass to next handler in chain + return false; + }, + + // Private plugin internal methods + + _handlePasteEvent : function(e) { + switch (e.type) { + case "paste": + var html = TinyMCE_PastePlugin._clipboardHTML(); + var r, inst = tinyMCE.selectedInstance; + + // Removes italic, strong etc, the if was needed due to bug #1437114 + if (inst && (r = inst.getRng()) && r.text.length > 0) + tinyMCE.execCommand('delete'); - return true; + if (html && html.length > 0) + tinyMCE.execCommand('mcePasteWord', false, html); - case "mcePasteWord": - if (user_interface) { - if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false)) { - var html = TinyMCE_paste__clipboardHTML(); - - if (html && html.length > 0) - TinyMCE_paste__insertWordContent(html); - } else { - var template = new Array(); - template['file'] = '../../plugins/paste/pasteword.htm'; // Relative to theme - template['width'] = 450; - template['height'] = 400; - var plain_text = ""; - tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'}); - } - } else - TinyMCE_paste__insertWordContent(value); + tinyMCE.cancelEvent(e); + return false; + } - return true; + return true; + }, - case "mceSelectAll": - tinyMCE.execInstanceCommand(editor_id, 'selectall'); - return true; - - } - - // Pass to next handler in chain - return false; -} - -function TinyMCE_paste__insertText(content, bLinebreaks) { - if (content && content.length > 0) { - if (bLinebreaks) { - // Special paragraph treatment - if (tinyMCE.getParam("paste_create_paragraphs", true)) { - var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); - for (var i=0; i

      ", "gi"); - content = tinyMCE.regexpReplace(content, "\r\r", "

      ", "gi"); - content = tinyMCE.regexpReplace(content, "\n\n", "

      ", "gi"); - - // Has paragraphs - if ((pos = content.indexOf('

      ')) != -1) { - tinyMCE.execCommand("Delete"); - - var node = tinyMCE.selectedInstance.getFocusElement(); - - // Get list of elements to break - var breakElms = new Array(); - - do { - if (node.nodeType == 1) { - // Don't break tables and break at body - if (node.nodeName == "TD" || node.nodeName == "BODY") - break; - - breakElms[breakElms.length] = node; + _insertText : function(content, bLinebreaks) { + if (content && content.length > 0) { + if (bLinebreaks) { + // Special paragraph treatment + if (tinyMCE.getParam("paste_create_paragraphs", true)) { + var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); + for (var i=0; i

      ", "gi"); + content = tinyMCE.regexpReplace(content, "\r\r", "

      ", "gi"); + content = tinyMCE.regexpReplace(content, "\n\n", "

      ", "gi"); + + // Has paragraphs + if ((pos = content.indexOf('

      ')) != -1) { + tinyMCE.execCommand("Delete"); + + var node = tinyMCE.selectedInstance.getFocusElement(); + + // Get list of elements to break + var breakElms = new Array(); + + do { + if (node.nodeType == 1) { + // Don't break tables and break at body + if (node.nodeName == "TD" || node.nodeName == "BODY") + break; + + breakElms[breakElms.length] = node; + } + } while(node = node.parentNode); + + var before = "", after = "

      "; + before += content.substring(0, pos); + + for (var i=0; i"; + after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">"; } - } while(node = node.parentNode); - - var before = "", after = "

      "; - before += content.substring(0, pos); - for (var i=0; i"; - after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">"; + before += "

      "; + content = before + content.substring(pos+7) + after; } - - before += "

      "; - content = before + content.substring(pos+7) + after; } + + if (tinyMCE.getParam("paste_create_linebreaks", true)) { + content = tinyMCE.regexpReplace(content, "\r\n", "
      ", "gi"); + content = tinyMCE.regexpReplace(content, "\r", "
      ", "gi"); + content = tinyMCE.regexpReplace(content, "\n", "
      ", "gi"); + } } + + tinyMCE.execCommand("mceInsertRawHTML", false, content); + } + }, + + _insertWordContent : function(content) { + if (content && content.length > 0) { + // Cleanup Word content + var bull = String.fromCharCode(8226); + var middot = String.fromCharCode(183); + var cb; + + if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "") + content = eval(cb + "('before', content)"); + + var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); + for (var i=0; i", "gi"); - content = tinyMCE.regexpReplace(content, "\r", "
      ", "gi"); - content = tinyMCE.regexpReplace(content, "\n", "
      ", "gi"); + if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) { + content = content.replace(new RegExp('

      (.*?)<\/p>', 'gi'), '

      $1

      '); } - } - - tinyMCE.execCommand("mceInsertRawHTML", false, content); - } -} -function TinyMCE_paste__insertWordContent(content) { - if (content && content.length > 0) { - // Cleanup Word content - var bull = String.fromCharCode(8226); - var middot = String.fromCharCode(183); + content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--"); + content = content.replace(new RegExp(bull + "(.*?)
      ", "gi"), "

      " + middot + "$1

      "); + content = content.replace(new RegExp('', 'gi'), "" + bull); // Covert to bull list + content = content.replace(/<\/o:p>/gi, ""); + content = content.replace(new RegExp('
      ]*>/gi, ""); + + if (tinyMCE.getParam("paste_remove_styles", true)) + content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3"); + + content = content.replace(/<\/?font[^>]*>/gi, ""); + + // Strips class attributes. + switch (tinyMCE.getParam("paste_strip_class_attributes", "all")) { + case "all": + content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3"); + break; - var rl = tinyMCE.getParam("paste_replace_list", '\u2122,TM,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(','); - for (var i=0; i]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3"); + break; + } - if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) { - content = content.replace(new RegExp('

      (.*?)<\/p>', 'gi'), '

      $1

      '); - } + content = content.replace(new RegExp('href="?' + TinyMCE_PastePlugin._reEscape("" + document.location) + '', 'gi'), 'href="' + tinyMCE.settings['document_base_url']); + content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); + content = content.replace(/<\\?\?xml[^>]*>/gi, ""); + content = content.replace(/<\/?\w+:[^>]*>/gi, ""); + content = content.replace(/-- page break --\s*

       <\/p>/gi, ""); // Remove pagebreaks + content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks + + // content = content.replace(/\/? */gi, "");   + // content = content.replace(/

       <\/p>/gi, ''); + + if (!tinyMCE.settings['force_p_newlines']) { + content = content.replace('', '' ,'gi'); + content = content.replace('

      ', '

      ' ,'gi'); + } - content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--"); - content = content.replace(new RegExp(bull + "(.*?)
      ", "gi"), "

      " + middot + "$1

      "); - content = content.replace(new RegExp('', 'gi'), "" + bull); // Covert to bull list - content = content.replace(/<\/o:p>/gi, ""); - content = content.replace(new RegExp('
      ]*>/gi, ""); - content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3"); - content = content.replace(/<\/?font[^>]*>/gi, ""); - - // Strips class attributes. - switch (tinyMCE.getParam("paste_strip_class_attributes", "all")) { - case "all": - content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3"); - break; - - case "mso": - content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3"); - break; - } + if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) { + content = content.replace(/<\/?p[^>]*>/gi, ""); + } - content = content.replace(new RegExp('href="?' + TinyMCE_paste__reEscape("" + document.location) + '', 'gi'), 'href="' + tinyMCE.settings['document_base_url']); - content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3"); - content = content.replace(/<\\?\?xml[^>]*>/gi, ""); - content = content.replace(/<\/?\w+:[^>]*>/gi, ""); - content = content.replace(/-- page break --\s*

       <\/p>/gi, ""); // Remove pagebreaks - content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks - -// content = content.replace(/\/? */gi, "");   -// content = content.replace(/

       <\/p>/gi, ''); - - if (!tinyMCE.settings['force_p_newlines']) { - content = content.replace('', '' ,'gi'); - content = content.replace('

      ', '

      ' ,'gi'); - } + content = content.replace(/<\/?div[^>]*>/gi, ""); - if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) { - content = content.replace(/<\/?p[^>]*>/gi, ""); - } + // Convert all middlot lists to UL lists + if (tinyMCE.getParam("paste_convert_middot_lists", true)) { + var div = document.createElement("div"); + div.innerHTML = content; - content = content.replace(/<\/?div[^>]*>/gi, ""); + // Convert all middot paragraphs to li elements + var className = tinyMCE.getParam("paste_unindented_list_class", "unIndentedList"); - // Convert all middlot lists to UL lists - if (tinyMCE.getParam("paste_convert_middot_lists", true)) { - var div = document.createElement("div"); - div.innerHTML = content; + while (TinyMCE_PastePlugin._convertMiddots(div, "--list--")) ; // bull + while (TinyMCE_PastePlugin._convertMiddots(div, middot, className)) ; // Middot + while (TinyMCE_PastePlugin._convertMiddots(div, bull)) ; // bull - // Convert all middot paragraphs to li elements - var className = tinyMCE.getParam("paste_unindented_list_class", "unIndentedList"); + content = div.innerHTML; + } - while (TinyMCE_paste_convertMiddots(div, "--list--")) ; // bull - while (TinyMCE_paste_convertMiddots(div, middot, className)) ; // Middot - while (TinyMCE_paste_convertMiddots(div, bull)) ; // bull + // Replace all headers with strong and fix some other issues + if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) { + content = content.replace(/ <\/h[1-6]>/gi, '

        

      '); + content = content.replace(//gi, '

      '); + content = content.replace(/<\/h[1-6]>/gi, '

      '); + content = content.replace(/ <\/b>/gi, '  '); + content = content.replace(/^( )*/gi, ''); + } - content = div.innerHTML; + content = content.replace(/--list--/gi, ""); // Remove --list-- + + if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "") + content = eval(cb + "('after', content)"); + + // Insert cleaned content + tinyMCE.execCommand("mceInsertContent", false, content); + window.setTimeout('tinyMCE.execCommand("mceCleanup");', 1); // Do normal cleanup detached from this thread } + }, - // Replace all headers with strong and fix some other issues - if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) { - content = content.replace(/ <\/h[1-6]>/gi, '

        

      '); - content = content.replace(//gi, '

      '); - content = content.replace(/<\/h[1-6]>/gi, '

      '); - content = content.replace(/ <\/b>/gi, '  '); - content = content.replace(/^( )*/gi, ''); + _reEscape : function(s) { + var l = "?.\\*[](){}+^$:"; + var o = ""; + + for (var i=0; i';}return "";}function TinyMCE_preview_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mcePreview":var previewPage=tinyMCE.getParam("plugin_preview_pageurl",null);var previewWidth=tinyMCE.getParam("plugin_preview_width","550");var previewHeight=tinyMCE.getParam("plugin_preview_height","600");if(previewPage){var template=new Array();template['file']=previewPage;template['width']=previewWidth;template['height']=previewHeight;tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"yes",inline:"yes",content:tinyMCE.getContent(),content_css:tinyMCE.getParam("content_css")});}else{var win=window.open("","mcePreview","menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width="+previewWidth+",height="+previewHeight);var html="";html+=tinyMCE.getParam('doctype');html+='';html+='';html+=''+tinyMCE.getLang('lang_preview_desc')+'';html+='';html+='';html+='';html+='';html+='';html+=tinyMCE.getContent();html+='';html+='';win.document.write(html);win.document.close();}return true;}return false;} \ No newline at end of file +tinyMCE.importPluginLanguagePack('preview','en,tr,cs,de,el,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_PreviewPlugin={getInfo:function(){return{longname:'Preview',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_preview.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"preview":return tinyMCE.getButtonHTML(cn,'lang_preview_desc','{$pluginurl}/images/preview.gif','mcePreview');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mcePreview":var previewPage=tinyMCE.getParam("plugin_preview_pageurl",null);var previewWidth=tinyMCE.getParam("plugin_preview_width","550");var previewHeight=tinyMCE.getParam("plugin_preview_height","600");if(previewPage){var template=new Array();template['file']=previewPage;template['width']=previewWidth;template['height']=previewHeight;tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"yes",inline:"yes",content:tinyMCE.getContent(),content_css:tinyMCE.getParam("content_css")});}else{var win=window.open("","mcePreview","menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width="+previewWidth+",height="+previewHeight);var html="";var c=tinyMCE.getContent();var pos=c.indexOf('',pos);pos2=c.lastIndexOf('');c=c.substring(pos+1,pos2);}html+=tinyMCE.getParam('doctype');html+='';html+='';html+=''+tinyMCE.getLang('lang_preview_desc')+'';html+='';html+='';html+='';html+='';html+='';html+=c;html+='';html+='';win.document.write(html);win.document.close();}return true;}return false;}};tinyMCE.addPlugin("preview",TinyMCE_PreviewPlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/preview/editor_plugin_src.js 2006-06-25 16:54:19.000000000 -0400 @@ -1,72 +1,92 @@ -/* Import plugin specific language pack */ -tinyMCE.importPluginLanguagePack('preview', 'cs,de,el,en,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk'); - -function TinyMCE_preview_getInfo() { - return { - longname : 'Preview', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_preview.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; - /** - * Returns the HTML contents of the preview control. + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.23 $ + * $Date: 2006/03/20 12:03:44 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. */ -function TinyMCE_preview_getControlHTML(control_name) { - switch (control_name) { - case "preview": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePreview\');return false;'; - return ''; - } - return ""; -} +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('preview', 'en,tr,cs,de,el,fr_ca,it,ko,pt,sv,zh_cn,fa,fr,pl,pt_br,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,zh_tw,zh_tw_utf8,sk'); -/** - * Executes the mcePreview command. - */ -function TinyMCE_preview_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mcePreview": - var previewPage = tinyMCE.getParam("plugin_preview_pageurl", null); - var previewWidth = tinyMCE.getParam("plugin_preview_width", "550"); - var previewHeight = tinyMCE.getParam("plugin_preview_height", "600"); - - // Use a custom preview page - if (previewPage) { - var template = new Array(); - - template['file'] = previewPage; - template['width'] = previewWidth; - template['height'] = previewHeight; - - tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "yes", inline : "yes", content : tinyMCE.getContent(), content_css : tinyMCE.getParam("content_css")}); - } else { - var win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + previewWidth + ",height=" + previewHeight); - var html = ""; - - html += tinyMCE.getParam('doctype'); - html += ''; - html += ''; - html += '' + tinyMCE.getLang('lang_preview_desc') + ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += tinyMCE.getContent(); - html += ''; - html += ''; - - win.document.write(html); - win.document.close(); - } +var TinyMCE_PreviewPlugin = { + getInfo : function() { + return { + longname : 'Preview', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_preview.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + /** + * Returns the HTML contents of the preview control. + */ + getControlHTML : function(cn) { + switch (cn) { + case "preview": + return tinyMCE.getButtonHTML(cn, 'lang_preview_desc', '{$pluginurl}/images/preview.gif', 'mcePreview'); + } + + return ""; + }, + + /** + * Executes the mcePreview command. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mcePreview": + var previewPage = tinyMCE.getParam("plugin_preview_pageurl", null); + var previewWidth = tinyMCE.getParam("plugin_preview_width", "550"); + var previewHeight = tinyMCE.getParam("plugin_preview_height", "600"); + + // Use a custom preview page + if (previewPage) { + var template = new Array(); + + template['file'] = previewPage; + template['width'] = previewWidth; + template['height'] = previewHeight; + + tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "yes", inline : "yes", content : tinyMCE.getContent(), content_css : tinyMCE.getParam("content_css")}); + } else { + var win = window.open("", "mcePreview", "menubar=no,toolbar=no,scrollbars=yes,resizable=yes,left=20,top=20,width=" + previewWidth + ",height=" + previewHeight); + var html = ""; + var c = tinyMCE.getContent(); + var pos = c.indexOf('', pos); + pos2 = c.lastIndexOf(''); + c = c.substring(pos + 1, pos2); + } + + html += tinyMCE.getParam('doctype'); + html += ''; + html += ''; + html += '' + tinyMCE.getLang('lang_preview_desc') + ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += ''; + html += c; + html += ''; + html += ''; + + win.document.write(html); + win.document.close(); + } - return true; + return true; + } + + return false; } +}; - return false; -} +tinyMCE.addPlugin("preview", TinyMCE_PreviewPlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin.js 2006-06-25 16:54:23.000000000 -0400 @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('print','en,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_print_getInfo(){return{longname:'Print',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_print.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_print_getControlHTML(control_name){switch(control_name){case "print":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePrint\',true);return false;';return '';}return "";}function TinyMCE_print_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mcePrint":tinyMCE.getInstanceById(editor_id).contentWindow.print();return true;}return false;} \ No newline at end of file +tinyMCE.importPluginLanguagePack('print','en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_PrintPlugin={getInfo:function(){return{longname:'Print',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_print.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"print":return tinyMCE.getButtonHTML(cn,'lang_print_desc','{$pluginurl}/images/print.gif','mcePrint');}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mcePrint":tinyMCE.getInstanceById(editor_id).contentWindow.print();return true;}return false;}};tinyMCE.addPlugin("print",TinyMCE_PrintPlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/print/editor_plugin_src.js 2006-06-25 16:54:23.000000000 -0400 @@ -1,37 +1,49 @@ +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.19 $ + * $Date: 2006/02/10 16:29:40 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + /* Import theme specific language pack */ -tinyMCE.importPluginLanguagePack('print', 'en,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk'); +tinyMCE.importPluginLanguagePack('print', 'en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,zh_tw,zh_tw_utf8,sk'); -function TinyMCE_print_getInfo() { - return { - longname : 'Print', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_print.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; +var TinyMCE_PrintPlugin = { + getInfo : function() { + return { + longname : 'Print', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_print.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, -function TinyMCE_print_getControlHTML(control_name) { - switch (control_name) { - case "print": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcePrint\',true);return false;'; - return ''; - } + getControlHTML : function(cn) { + switch (cn) { + case "print": + return tinyMCE.getButtonHTML(cn, 'lang_print_desc', '{$pluginurl}/images/print.gif', 'mcePrint'); + } - return ""; -} + return ""; + }, -/** - * Executes the search/replace commands. - */ -function TinyMCE_print_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mcePrint": - tinyMCE.getInstanceById(editor_id).contentWindow.print(); - return true; + /** + * Executes the search/replace commands. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mcePrint": + tinyMCE.getInstanceById(editor_id).contentWindow.print(); + return true; + } + + // Pass to next handler in chain + return false; } +}; - // Pass to next handler in chain - return false; -} +tinyMCE.addPlugin("print", TinyMCE_PrintPlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/save/editor_plugin.js 2006-06-25 16:54:23.000000000 -0400 @@ -1 +1 @@ -tinyMCE.importPluginLanguagePack('save','en,sv,zh_cn,cs,fa,fr_ca,fr,de,pl,pt_br,nl,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,da,es,cy,is,zh_tw,zh_tw_utf8,sk');function TinyMCE_save_getInfo(){return{longname:'Save',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_save.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_save_getControlHTML(control_name){switch(control_name){case "save":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSave\');return false;';return '';}return "";}function TinyMCE_save_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceSave":var formObj=tinyMCE.selectedInstance.formElement.form;if(formObj){tinyMCE.triggerSave();for(var i=0;i'; - } + if (tinyMCE.getParam("save_enablewhendirty")) { + var inst = tinyMCE.getInstanceById(editor_id); - return ""; -} + if (inst.isDirty()) { + tinyMCE.switchClass(editor_id + '_save', 'mceButtonNormal'); + return true; + } -/** - * Executes the save command. - */ -function TinyMCE_save_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mceSave": - var formObj = tinyMCE.selectedInstance.formElement.form; - - if (formObj) { - tinyMCE.triggerSave(); - - // Disable all UI form elements that TinyMCE created - for (var i=0; i';case "replace":var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSearchReplace\',true);return false;';return '';}return "";}function TinyMCE_searchreplace_execCommand(editor_id,element,command,user_interface,value){function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key];}function replaceSel(search_str,str){if(!tinyMCE.isMSIE){var sel=instance.contentWindow.getSelection();var rng=sel.getRangeAt(0);}else{var rng=instance.contentWindow.document.selection.createRange();}if(!tinyMCE.isMSIE){var doc=instance.contentWindow.document;if(str.indexOf(search_str)==-1){rng.deleteContents();rng.insertNode(rng.createContextualFragment(str));rng.collapse(false);}else{doc.execCommand("insertimage",false,"#mce_temp_url#");var elm=tinyMCE.getElementByAttributeValue(doc.body,"img","src","#mce_temp_url#");elm.parentNode.replaceChild(doc.createTextNode(str),elm);}}else{if(rng.item)rng.item(0).outerHTML=str;else rng.pasteHTML(str);}}var instance=tinyMCE.getInstanceById(editor_id);if(!value)value=new Array();defValue("editor_id",editor_id);defValue("searchstring","");defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");switch(command){case "mceResetSearch":tinyMCE.lastSearchRng=null;return true;case "mceSearch":if(user_interface){var template=new Array();if(value['replacestring']!=null){template['file']='../../plugins/searchreplace/replace.htm';template['width']=320;template['height']=120+(tinyMCE.isNS7?20:0);template['width']+=tinyMCE.getLang('lang_searchreplace_replace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}else{template['file']='../../plugins/searchreplace/search.htm';template['width']=310;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_searchreplace_search_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}tinyMCE.openWindow(template,value);}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;if(body.innerHTML==""){alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true;}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring']);value['replacemode']="none";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}if(tinyMCE.isMSIE){var rng=tinyMCE.lastSearchRng?tinyMCE.lastSearchRng:doc.selection.createRange();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){alert('This operation is currently not supported by this browser.');return true;}if(value['replacemode']=="all"){while(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(false);replaceSel(value['string'],value['replacestring']);}alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(value['backwards']);tinyMCE.lastSearchRng=rng;}else alert(tinyMCE.getLang('lang_searchreplace_notfound'));}else{if(value['replacemode']=="all"){while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))replaceSel(value['string'],value['replacestring']);alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))alert(tinyMCE.getLang('lang_searchreplace_notfound'));}}return true;case "mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}return false;}function TinyMCE_searchreplace_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){return true;} \ No newline at end of file +tinyMCE.importPluginLanguagePack('searchreplace','en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk');var TinyMCE_SearchReplacePlugin={getInfo:function(){return{longname:'Search/Replace',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},initInstance:function(inst){inst.addShortcut('ctrl','f','lang_searchreplace_search_desc','mceSearch',true);},getControlHTML:function(cn){switch(cn){case"search":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_search_desc','{$pluginurl}/images/search.gif','mceSearch',true);case"replace":return tinyMCE.getButtonHTML(cn,'lang_searchreplace_replace_desc','{$pluginurl}/images/replace.gif','mceSearchReplace',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){var instance=tinyMCE.getInstanceById(editor_id);function defValue(key,default_value){value[key]=typeof(value[key])=="undefined"?default_value:value[key];}function replaceSel(search_str,str,back){instance.execCommand('mceInsertContent',false,str);}if(!value)value=new Array();defValue("editor_id",editor_id);defValue("searchstring","");defValue("replacestring",null);defValue("replacemode","none");defValue("casesensitive",false);defValue("backwards",false);defValue("wrap",false);defValue("wholeword",false);defValue("inline","yes");switch(command){case"mceResetSearch":tinyMCE.lastSearchRng=null;return true;case"mceSearch":if(user_interface){var template=new Array();if(value['replacestring']!=null){template['file']='../../plugins/searchreplace/replace.htm';template['width']=320;template['height']=100+(tinyMCE.isNS7?20:0);template['width']+=tinyMCE.getLang('lang_searchreplace_replace_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}else{template['file']='../../plugins/searchreplace/search.htm';template['width']=310;template['height']=105+(tinyMCE.isNS7?25:0);template['width']+=tinyMCE.getLang('lang_searchreplace_search_delta_width',0);template['height']+=tinyMCE.getLang('lang_searchreplace_replace_delta_height',0);}instance.execCommand('SelectAll');if(tinyMCE.isMSIE){var r=instance.selection.getRng();r.collapse(true);r.select();}else instance.selection.getSel().collapseToStart();tinyMCE.openWindow(template,value);}else{var win=tinyMCE.getInstanceById(editor_id).contentWindow;var doc=tinyMCE.getInstanceById(editor_id).contentWindow.document;var body=tinyMCE.getInstanceById(editor_id).contentWindow.document.body;if(body.innerHTML==""){alert(tinyMCE.getLang('lang_searchreplace_notfound'));return true;}if(value['replacemode']=="current"){replaceSel(value['string'],value['replacestring'],value['backwards']);value['replacemode']="none";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}if(tinyMCE.isMSIE){var rng=tinyMCE.lastSearchRng?tinyMCE.lastSearchRng:doc.selection.createRange();var flags=0;if(value['wholeword'])flags=flags|2;if(value['casesensitive'])flags=flags|4;if(!rng.findText){alert('This operation is currently not supported by this browser.');return true;}if(value['replacemode']=="all"){while(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(false);replaceSel(value['string'],value['replacestring'],value['backwards']);}alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(rng.findText(value['string'],value['backwards']?-1:1,flags)){rng.scrollIntoView();rng.select();rng.collapse(value['backwards']);tinyMCE.lastSearchRng=rng;}else alert(tinyMCE.getLang('lang_searchreplace_notfound'));}else{if(value['replacemode']=="all"){while(win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))replaceSel(value['string'],value['replacestring'],value['backwards']);alert(tinyMCE.getLang('lang_searchreplace_allreplaced'));return true;}if(!win.find(value['string'],value['casesensitive'],value['backwards'],value['wrap'],value['wholeword'],false,false))alert(tinyMCE.getLang('lang_searchreplace_notfound'));}}return true;case"mceSearchReplace":value['replacestring']="";tinyMCE.execInstanceCommand(editor_id,'mceSearch',user_interface,value,false);return true;}return false;}};tinyMCE.addPlugin("searchreplace",TinyMCE_SearchReplacePlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/editor_plugin_src.js 2006-06-25 16:54:23.000000000 -0400 @@ -1,195 +1,185 @@ -/* Import theme specific language pack */ -tinyMCE.importPluginLanguagePack('searchreplace', 'en,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk'); - -function TinyMCE_searchreplace_getInfo() { - return { - longname : 'Search/Replace', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; - -function TinyMCE_searchreplace_getControlHTML(control_name) { - switch (control_name) { - case "search": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSearch\',true);return false;'; - return ''; - - case "replace": - var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSearchReplace\',true);return false;'; - return ''; - } - - return ""; -} - /** - * Executes the search/replace commands. + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.27 $ + * $Date: 2006/02/13 15:09:28 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. */ -function TinyMCE_searchreplace_execCommand(editor_id, element, command, user_interface, value) { - function defValue(key, default_value) { - value[key] = typeof(value[key]) == "undefined" ? default_value : value[key]; - } - function replaceSel(search_str, str) { - // Get current selection - if (!tinyMCE.isMSIE) { - var sel = instance.contentWindow.getSelection(); - var rng = sel.getRangeAt(0); - } else { - var rng = instance.contentWindow.document.selection.createRange(); - } +/* Import theme specific language pack */ +tinyMCE.importPluginLanguagePack('searchreplace', 'en,tr,sv,zh_cn,fa,fr_ca,fr,de,pl,pt_br,cs,nl,da,he,nb,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,cy,es,is,zh_tw,zh_tw_utf8,sk'); - // Replace current one - if (!tinyMCE.isMSIE) { - var doc = instance.contentWindow.document; - - // This way works when the replace doesn't contain the search string - if (str.indexOf(search_str) == -1) { - rng.deleteContents(); - rng.insertNode(rng.createContextualFragment(str)); - rng.collapse(false); - } else { - // Insert content ugly way! Needed to move selection to after replace item - doc.execCommand("insertimage", false, "#mce_temp_url#"); - var elm = tinyMCE.getElementByAttributeValue(doc.body, "img", "src", "#mce_temp_url#"); - elm.parentNode.replaceChild(doc.createTextNode(str), elm); - } - } else { - if (rng.item) - rng.item(0).outerHTML = str; - else - rng.pasteHTML(str); +var TinyMCE_SearchReplacePlugin = { + getInfo : function() { + return { + longname : 'Search/Replace', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_searchreplace.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + initInstance : function(inst) { + inst.addShortcut('ctrl', 'f', 'lang_searchreplace_search_desc', 'mceSearch', true); + }, + + getControlHTML : function(cn) { + switch (cn) { + case "search": + return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_search_desc', '{$pluginurl}/images/search.gif', 'mceSearch', true); + case "replace": + return tinyMCE.getButtonHTML(cn, 'lang_searchreplace_replace_desc', '{$pluginurl}/images/replace.gif', 'mceSearchReplace', true); } - } + return ""; + }, - var instance = tinyMCE.getInstanceById(editor_id); + /** + * Executes the search/replace commands. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + var instance = tinyMCE.getInstanceById(editor_id); - if (!value) - value = new Array(); - - // Setup defualt values - defValue("editor_id", editor_id); - defValue("searchstring", ""); - defValue("replacestring", null); - defValue("replacemode", "none"); - defValue("casesensitive", false); - defValue("backwards", false); - defValue("wrap", false); - defValue("wholeword", false); - defValue("inline", "yes"); - - // Handle commands - switch (command) { - case "mceResetSearch": - tinyMCE.lastSearchRng = null; - return true; - - case "mceSearch": - if (user_interface) { - // Open search dialog - var template = new Array(); - - if (value['replacestring'] != null) { - template['file'] = '../../plugins/searchreplace/replace.htm'; // Relative to theme - template['width'] = 320; - template['height'] = 120 + (tinyMCE.isNS7 ? 20 : 0); - template['width'] += tinyMCE.getLang('lang_searchreplace_replace_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0); - } else { - template['file'] = '../../plugins/searchreplace/search.htm'; // Relative to theme - template['width'] = 310; - template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0); - template['width'] += tinyMCE.getLang('lang_searchreplace_search_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0); - } + function defValue(key, default_value) { + value[key] = typeof(value[key]) == "undefined" ? default_value : value[key]; + } - tinyMCE.openWindow(template, value); - } else { - var win = tinyMCE.getInstanceById(editor_id).contentWindow; - var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document; - var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body; - - // Whats the point - if (body.innerHTML == "") { - alert(tinyMCE.getLang('lang_searchreplace_notfound')); - return true; - } + function replaceSel(search_str, str, back) { + instance.execCommand('mceInsertContent', false, str); + } - // Handle replace current - if (value['replacemode'] == "current") { - replaceSel(value['string'], value['replacestring']); - - // Search next one - value['replacemode'] = "none"; - tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false); + if (!value) + value = new Array(); - return true; - } + // Setup defualt values + defValue("editor_id", editor_id); + defValue("searchstring", ""); + defValue("replacestring", null); + defValue("replacemode", "none"); + defValue("casesensitive", false); + defValue("backwards", false); + defValue("wrap", false); + defValue("wholeword", false); + defValue("inline", "yes"); + + // Handle commands + switch (command) { + case "mceResetSearch": + tinyMCE.lastSearchRng = null; + return true; + + case "mceSearch": + if (user_interface) { + // Open search dialog + var template = new Array(); + + if (value['replacestring'] != null) { + template['file'] = '../../plugins/searchreplace/replace.htm'; // Relative to theme + template['width'] = 320; + template['height'] = 100 + (tinyMCE.isNS7 ? 20 : 0); + template['width'] += tinyMCE.getLang('lang_searchreplace_replace_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0); + } else { + template['file'] = '../../plugins/searchreplace/search.htm'; // Relative to theme + template['width'] = 310; + template['height'] = 105 + (tinyMCE.isNS7 ? 25 : 0); + template['width'] += tinyMCE.getLang('lang_searchreplace_search_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_searchreplace_replace_delta_height', 0); + } - if (tinyMCE.isMSIE) { - var rng = tinyMCE.lastSearchRng ? tinyMCE.lastSearchRng : doc.selection.createRange(); - var flags = 0; + instance.execCommand('SelectAll'); - if (value['wholeword']) - flags = flags | 2; + if (tinyMCE.isMSIE) { + var r = instance.selection.getRng(); + r.collapse(true); + r.select(); + } else + instance.selection.getSel().collapseToStart(); - if (value['casesensitive']) - flags = flags | 4; + tinyMCE.openWindow(template, value); + } else { + var win = tinyMCE.getInstanceById(editor_id).contentWindow; + var doc = tinyMCE.getInstanceById(editor_id).contentWindow.document; + var body = tinyMCE.getInstanceById(editor_id).contentWindow.document.body; - if (!rng.findText) { - alert('This operation is currently not supported by this browser.'); + // Whats the point + if (body.innerHTML == "") { + alert(tinyMCE.getLang('lang_searchreplace_notfound')); return true; } - // Handle replace all mode - if (value['replacemode'] == "all") { - while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) { - rng.scrollIntoView(); - rng.select(); - rng.collapse(false); - replaceSel(value['string'], value['replacestring']); - } + // Handle replace current + if (value['replacemode'] == "current") { + replaceSel(value['string'], value['replacestring'], value['backwards']); + + // Search next one + value['replacemode'] = "none"; + tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false); - alert(tinyMCE.getLang('lang_searchreplace_allreplaced')); return true; } - if (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) { - rng.scrollIntoView(); - rng.select(); - rng.collapse(value['backwards']); - tinyMCE.lastSearchRng = rng; - } else - alert(tinyMCE.getLang('lang_searchreplace_notfound')); - } else { - if (value['replacemode'] == "all") { - while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false)) - replaceSel(value['string'], value['replacestring']); + if (tinyMCE.isMSIE) { + var rng = tinyMCE.lastSearchRng ? tinyMCE.lastSearchRng : doc.selection.createRange(); + var flags = 0; + + if (value['wholeword']) + flags = flags | 2; + + if (value['casesensitive']) + flags = flags | 4; + + if (!rng.findText) { + alert('This operation is currently not supported by this browser.'); + return true; + } - alert(tinyMCE.getLang('lang_searchreplace_allreplaced')); - return true; - } + // Handle replace all mode + if (value['replacemode'] == "all") { + while (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) { + rng.scrollIntoView(); + rng.select(); + rng.collapse(false); + replaceSel(value['string'], value['replacestring'], value['backwards']); + } - if (!win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false)) - alert(tinyMCE.getLang('lang_searchreplace_notfound')); + alert(tinyMCE.getLang('lang_searchreplace_allreplaced')); + return true; + } + + if (rng.findText(value['string'], value['backwards'] ? -1 : 1, flags)) { + rng.scrollIntoView(); + rng.select(); + rng.collapse(value['backwards']); + tinyMCE.lastSearchRng = rng; + } else + alert(tinyMCE.getLang('lang_searchreplace_notfound')); + } else { + if (value['replacemode'] == "all") { + while (win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false)) + replaceSel(value['string'], value['replacestring'], value['backwards']); + + alert(tinyMCE.getLang('lang_searchreplace_allreplaced')); + return true; + } + + if (!win.find(value['string'], value['casesensitive'], value['backwards'], value['wrap'], value['wholeword'], false, false)) + alert(tinyMCE.getLang('lang_searchreplace_notfound')); + } } - } - return true; + return true; - case "mceSearchReplace": - value['replacestring'] = ""; + case "mceSearchReplace": + value['replacestring'] = ""; - tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false); - return true; + tinyMCE.execInstanceCommand(editor_id, 'mceSearch', user_interface, value, false); + return true; + } + + // Pass to next handler in chain + return false; } +}; - // Pass to next handler in chain - return false; -} - -function TinyMCE_searchreplace_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { - return true; -} +tinyMCE.addPlugin("searchreplace", TinyMCE_SearchReplacePlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/jscripts/replace.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/jscripts/replace.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/jscripts/replace.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/jscripts/replace.js 2006-06-25 16:54:23.000000000 -0400 @@ -6,8 +6,8 @@ formObj.searchstring.value = tinyMCE.getWindowArg("searchstring"); formObj.replacestring.value = tinyMCE.getWindowArg("replacestring"); formObj.casesensitivebox.checked = tinyMCE.getWindowArg("casesensitive"); - formObj.backwards[0].checked = tinyMCE.getWindowArg("backwards"); - formObj.backwards[1].checked = !tinyMCE.getWindowArg("backwards"); +// formObj.backwards[0].checked = tinyMCE.getWindowArg("backwards"); +// formObj.backwards[1].checked = !tinyMCE.getWindowArg("backwards"); // formObj.wrapatend.checked = tinyMCE.getWindowArg("wrap"); // formObj.wholeword.checked = tinyMCE.getWindowArg("wholeword"); @@ -27,7 +27,7 @@ replacestring : formObj.replacestring.value, replacemode : replacemode, casesensitive : formObj.casesensitivebox.checked, - backwards : formObj.backwards[0].checked + backwards : false // wrap : formObj.wrapatend.checked, // wholeword : formObj.wholeword.checked }, false); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/langs/en.js 2006-06-25 16:54:23.000000000 -0400 @@ -4,10 +4,10 @@ searchreplace_search_desc : 'Find', searchreplace_searchnext_desc : 'Find again', searchreplace_replace_desc : 'Find/Replace', -searchreplace_notfound : 'The search has been compleated. The search string could not be found.', +searchreplace_notfound : 'The search has been completed. The search string could not be found.', searchreplace_search_title : 'Find', searchreplace_replace_title : 'Find/Replace', -searchreplace_allreplaced : 'All occurrences of the search string was replaced.', +searchreplace_allreplaced : 'All occurrences of the search string were replaced.', searchreplace_findwhat : 'Find what', searchreplace_replacewith : 'Replace with', searchreplace_direction : 'Direction', diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/replace.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/replace.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/replace.htm 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/searchreplace/replace.htm 2006-06-25 16:54:23.000000000 -0400 @@ -17,7 +17,7 @@ - + - + - + - + ';deltaHeight-=23;}template['html']+='
      diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/css/props.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/css/props.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/css/props.css 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/css/props.css 2006-06-25 16:54:23.000000000 -0400 @@ -0,0 +1,63 @@ +#text_font { + width: 250px; +} + +#text_size { + width: 70px; +} + +.mceAddSelectValue { + background-color: #DDDDDD; +} + +select, #block_text_indent, #box_width, #box_height, #box_padding_top, #box_padding_right, #box_padding_bottom, #box_padding_left { + width: 70px; +} + +#box_margin_top, #box_margin_right, #box_margin_bottom, #box_margin_left, #positioning_width, #positioning_height, #positioning_zindex { + width: 70px; +} + +#positioning_placement_top, #positioning_placement_right, #positioning_placement_bottom, #positioning_placement_left { + width: 70px; +} + +#positioning_clip_top, #positioning_clip_right, #positioning_clip_bottom, #positioning_clip_left { + width: 70px; +} + +.panel_wrapper div.current { + padding-top: 10px; + height: 230px; +} + +.delim { + b2ackground-color: #DDDDDD; + border-left: 1px solid gray; +} + +.tdelim { + border-bottom: 1px solid gray; +} + +#block_display { + width: 145px; +} + +#list_type { + width: 115px; +} + +.disabled { + background-color: #EEEEEE; +} + +#apply { + font-weight: bold; + width: 78px; + height: 21px; + border: 0; + background-image: url('../images/apply_button_bg.gif'); + cursor: pointer; +} + diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin.js 2006-06-25 16:54:23.000000000 -0400 @@ -0,0 +1 @@ +tinyMCE.importPluginLanguagePack('style','en');var TinyMCE_StylePlugin={getInfo:function(){return{longname:'Style',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_style.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(cn){switch(cn){case"styleprops":return tinyMCE.getButtonHTML(cn,'lang_style_styleinfo_desc','{$pluginurl}/images/style_info.gif','mceStyleProps',true);}return"";},execCommand:function(editor_id,element,command,user_interface,value){var e,inst;switch(command){case"mceStyleProps":TinyMCE_StylePlugin._styleProps();return true;case"mceSetElementStyle":inst=tinyMCE.getInstanceById(editor_id);e=inst.selection.getFocusElement();if(e){e.style.cssText=value;inst.repaint();}return true;}return false;},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection){},_styleProps:function(){var e=tinyMCE.selectedInstance.selection.getFocusElement();if(!e)return;tinyMCE.openWindow({file:'../../plugins/style/props.htm',width:480+tinyMCE.getLang('lang_style_props_delta_width',0),height:320+tinyMCE.getLang('lang_style_props_delta_height',0)},{editor_id:tinyMCE.selectedInstance.editorId,inline:"yes",style_text:e.style.cssText});}};tinyMCE.addPlugin("style",TinyMCE_StylePlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/editor_plugin_src.js 2006-06-25 16:54:23.000000000 -0400 @@ -0,0 +1,81 @@ +/** + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.1 $ + * $Date: 2006/05/03 10:46:42 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +/* Import plugin specific language pack */ +tinyMCE.importPluginLanguagePack('style', 'en'); + +var TinyMCE_StylePlugin = { + getInfo : function() { + return { + longname : 'Style', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_style.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + getControlHTML : function(cn) { + switch (cn) { + case "styleprops": + return tinyMCE.getButtonHTML(cn, 'lang_style_styleinfo_desc', '{$pluginurl}/images/style_info.gif', 'mceStyleProps', true); + } + + return ""; + }, + + execCommand : function(editor_id, element, command, user_interface, value) { + var e, inst; + + // Handle commands + switch (command) { + case "mceStyleProps": + TinyMCE_StylePlugin._styleProps(); + return true; + + case "mceSetElementStyle": + inst = tinyMCE.getInstanceById(editor_id); + e = inst.selection.getFocusElement(); + + if (e) { + e.style.cssText = value; + inst.repaint(); + } + + return true; + } + + // Pass to next handler in chain + return false; + }, + + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { + }, + + // Private plugin specific methods + + _styleProps : function() { + var e = tinyMCE.selectedInstance.selection.getFocusElement(); + + if (!e) + return; + + tinyMCE.openWindow({ + file : '../../plugins/style/props.htm', + width : 480 + tinyMCE.getLang('lang_style_props_delta_width', 0), + height : 320 + tinyMCE.getLang('lang_style_props_delta_height', 0) + }, { + editor_id : tinyMCE.selectedInstance.editorId, + inline : "yes", + style_text : e.style.cssText + }); + } +}; + +tinyMCE.addPlugin("style", TinyMCE_StylePlugin); Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/images/apply_button_bg.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/images/apply_button_bg.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/images/style_info.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/images/style_info.gif differ diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/jscripts/props.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/jscripts/props.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/jscripts/props.js 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/jscripts/props.js 2006-06-25 16:54:23.000000000 -0400 @@ -0,0 +1,630 @@ +var defaultFonts = "" + + "Arial, Helvetica, sans-serif=Arial, Helvetica, sans-serif;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Courier New, Courier, mono=Courier New, Courier, mono;" + + "Times New Roman, Times, serif=Times New Roman, Times, serif;" + + "Georgia, Times New Roman, Times, serif=Georgia, Times New Roman, Times, serif;" + + "Verdana, Arial, Helvetica, sans-serif=Verdana, Arial, Helvetica, sans-serif;" + + "Geneva, Arial, Helvetica, sans-serif=Geneva, Arial, Helvetica, sans-serif"; + +var defaultSizes = "9;10;12;14;16;18;24;xx-small;x-small;small;medium;large;x-large;xx-large;smaller;larger"; +var defaultMeasurement = "+pixels=px;points=pt;in;cm;mm;picas;ems;exs;%"; +var defaultSpacingMeasurement = "pixels=px;points=pt;in;cm;mm;picas;+ems;exs;%"; +var defaultIndentMeasurement = "pixels=px;+points=pt;in;cm;mm;picas;ems;exs;%"; +var defaultWeight = "normal;bold;bolder;lighter;100;200;300;400;500;600;700;800;900"; +var defaultTextStyle = "normal;italic;oblique"; +var defaultVariant = "normal;small-caps"; +var defaultLineHeight = "normal"; +var defaultAttachment = "fixed;scroll"; +var defaultRepeat = "no-repeat;repeat;repeat-x;repeat-y"; +var defaultPosH = "left;center;right"; +var defaultPosV = "top;center;bottom"; +var defaultVAlign = "baseline;sub;super;top;text-top;middle;bottom;text-bottom"; +var defaultDisplay = "inline;block;list-item;run-in;compact;marker;table;inline-table;table-row-group;table-header-group;table-footer-group;table-row;table-column-group;table-column;table-cell;table-caption;none"; +var defaultBorderStyle = "none;solid;dashed;dotted;double;groove;ridge;inset;outset"; +var defaultBorderWidth = "thin;medium;thick"; +var defaultListType = "disc;circle;square;decimal;lower-roman;upper-roman;lower-alpha;upper-alpha;none"; + +function init() { + var ce = document.getElementById('container'); + + ce.style.cssText = tinyMCEPopup.getWindowArg('style_text'); + + tinyMCEPopup.resizeToInnerSize(); + + document.getElementById('text_color_pickcontainer').innerHTML = getColorPickerHTML('text_color_pick','text_color'); + document.getElementById('background_color_pickcontainer').innerHTML = getColorPickerHTML('background_color_pick','background_color'); + document.getElementById('border_color_top_pickcontainer').innerHTML = getColorPickerHTML('border_color_top_pick','border_color_top'); + document.getElementById('border_color_right_pickcontainer').innerHTML = getColorPickerHTML('border_color_right_pick','border_color_right'); + document.getElementById('border_color_bottom_pickcontainer').innerHTML = getColorPickerHTML('border_color_bottom_pick','border_color_bottom'); + document.getElementById('border_color_left_pickcontainer').innerHTML = getColorPickerHTML('border_color_left_pick','border_color_left'); + + fillSelect(0, 'text_font', 'style_font', defaultFonts, ';', true); + fillSelect(0, 'text_size', 'style_font_size', defaultSizes, ';', true); + fillSelect(0, 'text_size_measurement', 'style_font_size_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'text_case', 'style_text_case', "capitalize;uppercase;lowercase", ';', true); + fillSelect(0, 'text_weight', 'style_font_weight', defaultWeight, ';', true); + fillSelect(0, 'text_style', 'style_font_style', defaultTextStyle, ';', true); + fillSelect(0, 'text_variant', 'style_font_variant', defaultVariant, ';', true); + fillSelect(0, 'text_lineheight', 'style_font_line_height', defaultLineHeight, ';', true); + fillSelect(0, 'text_lineheight_measurement', 'style_font_line_height_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_attachment', 'style_background_attachment', defaultAttachment, ';', true); + fillSelect(0, 'background_repeat', 'style_background_repeat', defaultRepeat, ';', true); + + fillSelect(0, 'background_hpos_measurement', 'style_background_hpos_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'background_vpos_measurement', 'style_background_vpos_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'background_hpos', 'style_background_hpos', defaultPosH, ';', true); + fillSelect(0, 'background_vpos', 'style_background_vpos', defaultPosV, ';', true); + + fillSelect(0, 'block_wordspacing', 'style_wordspacing', 'normal', ';', true); + fillSelect(0, 'block_wordspacing_measurement', 'style_wordspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_letterspacing', 'style_letterspacing', 'normal', ';', true); + fillSelect(0, 'block_letterspacing_measurement', 'style_letterspacing_measurement', defaultSpacingMeasurement, ';', true); + fillSelect(0, 'block_vertical_alignment', 'style_vertical_alignment', defaultVAlign, ';', true); + fillSelect(0, 'block_text_align', 'style_text_align', "left;right;center;justify", ';', true); + fillSelect(0, 'block_whitespace', 'style_whitespace', "normal;pre;nowrap", ';', true); + fillSelect(0, 'block_display', 'style_display', defaultDisplay, ';', true); + fillSelect(0, 'block_text_indent_measurement', 'style_text_indent_measurement', defaultIndentMeasurement, ';', true); + + fillSelect(0, 'box_width_measurement', 'style_box_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_height_measurement', 'style_box_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_float', 'style_float', 'left;right;none', ';', true); + fillSelect(0, 'box_clear', 'style_clear', 'left;right;both;none', ';', true); + fillSelect(0, 'box_padding_left_measurement', 'style_padding_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_top_measurement', 'style_padding_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_bottom_measurement', 'style_padding_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_padding_right_measurement', 'style_padding_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_left_measurement', 'style_margin_left_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_top_measurement', 'style_margin_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_bottom_measurement', 'style_margin_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'box_margin_right_measurement', 'style_margin_right_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'border_style_top', 'style_border_style_top', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_right', 'style_border_style_right', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_bottom', 'style_border_style_bottom', defaultBorderStyle, ';', true); + fillSelect(0, 'border_style_left', 'style_border_style_left', defaultBorderStyle, ';', true); + + fillSelect(0, 'border_width_top', 'style_border_width_top', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_right', 'style_border_width_right', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_bottom', 'style_border_width_bottom', defaultBorderWidth, ';', true); + fillSelect(0, 'border_width_left', 'style_border_width_left', defaultBorderWidth, ';', true); + + fillSelect(0, 'border_width_top_measurement', 'style_border_width_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_right_measurement', 'style_border_width_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_bottom_measurement', 'style_border_width_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'border_width_left_measurement', 'style_border_width_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'list_type', 'style_list_type', defaultListType, ';', true); + fillSelect(0, 'list_position', 'style_list_position', "inside;outside", ';', true); + + fillSelect(0, 'positioning_type', 'style_positioning_type', "absolute;relative;static", ';', true); + fillSelect(0, 'positioning_visibility', 'style_positioning_visibility', "inherit;visible;hidden", ';', true); + + fillSelect(0, 'positioning_width_measurement', 'style_positioning_width_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_height_measurement', 'style_positioning_height_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_overflow', 'style_positioning_overflow', "visible;hidden;scroll;auto", ';', true); + + fillSelect(0, 'positioning_placement_top_measurement', 'style_positioning_placement_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_right_measurement', 'style_positioning_placement_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_bottom_measurement', 'style_positioning_placement_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_placement_left_measurement', 'style_positioning_placement_left_measurement', defaultMeasurement, ';', true); + + fillSelect(0, 'positioning_clip_top_measurement', 'style_positioning_clip_top_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_right_measurement', 'style_positioning_clip_right_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_bottom_measurement', 'style_positioning_clip_bottom_measurement', defaultMeasurement, ';', true); + fillSelect(0, 'positioning_clip_left_measurement', 'style_positioning_clip_left_measurement', defaultMeasurement, ';', true); + + TinyMCE_EditableSelects.init(); + setupFormData(); + showDisabledControls(); +} + +function setupFormData() { + var ce = document.getElementById('container'), f = document.forms[0], s, b, i; + + // Setup text fields + + selectByValue(f, 'text_font', ce.style.fontFamily, true, true); + selectByValue(f, 'text_size', getNum(ce.style.fontSize), true, true); + selectByValue(f, 'text_size_measurement', getMeasurement(ce.style.fontSize)); + selectByValue(f, 'text_weight', ce.style.fontWeight, true, true); + selectByValue(f, 'text_style', ce.style.fontStyle, true, true); + selectByValue(f, 'text_lineheight', getNum(ce.style.lineHeight), true, true); + selectByValue(f, 'text_lineheight_measurement', getMeasurement(ce.style.lineHeight)); + selectByValue(f, 'text_case', ce.style.textTransform, true, true); + selectByValue(f, 'text_variant', ce.style.fontVariant, true, true); + f.text_color.value = ce.style.color; + updateColor('text_color_pick', 'text_color'); + f.text_underline.checked = inStr(ce.style.textDecoration, 'underline'); + f.text_overline.checked = inStr(ce.style.textDecoration, 'overline'); + f.text_linethrough.checked = inStr(ce.style.textDecoration, 'line-through'); + f.text_blink.checked = inStr(ce.style.textDecoration, 'blink'); + + // Setup background fields + + f.background_color.value = ce.style.backgroundColor; + updateColor('background_color_pick', 'background_color'); + f.background_image.value = ce.style.backgroundImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + selectByValue(f, 'background_repeat', ce.style.backgroundRepeat, true, true); + selectByValue(f, 'background_attachment', ce.style.backgroundAttachment, true, true); + selectByValue(f, 'background_hpos', getNum(getVal(ce.style.backgroundPosition, 0)), true, true); + selectByValue(f, 'background_hpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 0))); + selectByValue(f, 'background_vpos', getNum(getVal(ce.style.backgroundPosition, 1)), true, true); + selectByValue(f, 'background_vpos_measurement', getMeasurement(getVal(ce.style.backgroundPosition, 1))); + + // Setup block fields + + selectByValue(f, 'block_wordspacing', getNum(ce.style.wordSpacing), true, true); + selectByValue(f, 'block_wordspacing_measurement', getMeasurement(ce.style.wordSpacing)); + selectByValue(f, 'block_letterspacing', getNum(ce.style.letterSpacing), true, true); + selectByValue(f, 'block_letterspacing_measurement', getMeasurement(ce.style.letterSpacing)); + selectByValue(f, 'block_vertical_alignment', ce.style.verticalAlign, true, true); + selectByValue(f, 'block_text_align', ce.style.textAlign, true, true); + f.block_text_indent.value = getNum(ce.style.textIndent); + selectByValue(f, 'block_text_indent_measurement', getMeasurement(ce.style.textIndent)); + selectByValue(f, 'block_whitespace', ce.style.whiteSpace, true, true); + selectByValue(f, 'block_display', ce.style.display, true, true); + + // Setup box fields + + f.box_width.value = getNum(ce.style.width); + selectByValue(f, 'box_width_measurement', getMeasurement(ce.style.width)); + + f.box_height.value = getNum(ce.style.height); + selectByValue(f, 'box_height_measurement', getMeasurement(ce.style.height)); + + if (tinyMCE.isGecko) + selectByValue(f, 'box_float', ce.style.cssFloat, true, true); + else + selectByValue(f, 'box_float', ce.style.styleFloat, true, true); + + selectByValue(f, 'box_clear', ce.style.clear, true, true); + + setupBox(f, ce, 'box_padding', 'padding', ''); + setupBox(f, ce, 'box_margin', 'margin', ''); + + // Setup border fields + + setupBox(f, ce, 'border_style', 'border', 'Style'); + setupBox(f, ce, 'border_width', 'border', 'Width'); + setupBox(f, ce, 'border_color', 'border', 'Color'); + + updateColor('border_color_top_pick', 'border_color_top'); + updateColor('border_color_right_pick', 'border_color_right'); + updateColor('border_color_bottom_pick', 'border_color_bottom'); + updateColor('border_color_left_pick', 'border_color_left'); + + // Setup list fields + + selectByValue(f, 'list_type', ce.style.listStyleType, true, true); + selectByValue(f, 'list_position', ce.style.listStylePosition, true, true); + f.list_bullet_image.value = ce.style.listStyleImage.replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1"); + + // Setup box fields + + selectByValue(f, 'positioning_type', ce.style.position, true, true); + selectByValue(f, 'positioning_visibility', ce.style.visibility, true, true); + selectByValue(f, 'positioning_overflow', ce.style.overflow, true, true); + f.positioning_zindex.value = ce.style.zIndex ? ce.style.zIndex : ""; + + f.positioning_width.value = getNum(ce.style.width); + selectByValue(f, 'positioning_width_measurement', getMeasurement(ce.style.width)); + + f.positioning_height.value = getNum(ce.style.height); + selectByValue(f, 'positioning_height_measurement', getMeasurement(ce.style.height)); + + setupBox(f, ce, 'positioning_placement', '', '', new Array('top', 'right', 'bottom', 'left')); + + s = ce.style.clip.replace(new RegExp("rect\\('?([^']*)'?\\)", 'gi'), "$1"); + s = s.replace(/,/g, ' '); + + if (!hasEqualValues(new Array(getVal(s, 0), getVal(s, 1), getVal(s, 2), getVal(s, 3)))) { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = getNum(getVal(s, 1)); + selectByValue(f, 'positioning_clip_right_measurement', getMeasurement(getVal(s, 1))); + f.positioning_clip_bottom.value = getNum(getVal(s, 2)); + selectByValue(f, 'positioning_clip_bottom_measurement', getMeasurement(getVal(s, 2))); + f.positioning_clip_left.value = getNum(getVal(s, 3)); + selectByValue(f, 'positioning_clip_left_measurement', getMeasurement(getVal(s, 3))); + } else { + f.positioning_clip_top.value = getNum(getVal(s, 0)); + selectByValue(f, 'positioning_clip_top_measurement', getMeasurement(getVal(s, 0))); + f.positioning_clip_right.value = f.positioning_clip_bottom.value = f.positioning_clip_left.value; + } + +// setupBox(f, ce, '', 'border', 'Color'); +} + +function getMeasurement(s) { + return s.replace(/^([0-9]+)(.*)$/, "$2"); +} + +function getNum(s) { + if (new RegExp('^[0-9]+[a-z%]+$', 'gi').test(s)) + return s.replace(/[^0-9]/g, ''); + + return s; +} + +function inStr(s, n) { + return new RegExp(n, 'gi').test(s); +} + +function getVal(s, i) { + var a = tinyMCE.explode(' ', s); + + if (a.length > 1) + return a[i]; + + return ""; +} + +function setValue(f, n, v) { + if (f.elements[n].type == "text") + f.elements[n].value = v; + else + selectByValue(f, n, v, true, true); +} + +function setupBox(f, ce, fp, pr, sf, b) { + if (typeof(b) == "undefined") + b = new Array('Top', 'Right', 'Bottom', 'Left'); + + if (isSame(ce, pr, sf, b)) { + f.elements[fp + "_same"].checked = true; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + f.elements[fp + "_right"].value = ""; + f.elements[fp + "_right"].disabled = true; + f.elements[fp + "_bottom"].value = ""; + f.elements[fp + "_bottom"].disabled = true; + f.elements[fp + "_left"].value = ""; + f.elements[fp + "_left"].disabled = true; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + f.elements[fp + "_left_measurement"].disabled = true; + f.elements[fp + "_bottom_measurement"].disabled = true; + f.elements[fp + "_right_measurement"].disabled = true; + } + } else { + f.elements[fp + "_same"].checked = false; + + setValue(f, fp + "_top", getNum(ce.style[pr + b[0] + sf])); + f.elements[fp + "_top"].disabled = false; + + setValue(f, fp + "_right", getNum(ce.style[pr + b[1] + sf])); + f.elements[fp + "_right"].disabled = false; + + setValue(f, fp + "_bottom", getNum(ce.style[pr + b[2] + sf])); + f.elements[fp + "_bottom"].disabled = false; + + setValue(f, fp + "_left", getNum(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left"].disabled = false; + + if (f.elements[fp + "_top_measurement"]) { + selectByValue(f, fp + '_top_measurement', getMeasurement(ce.style[pr + b[0] + sf])); + selectByValue(f, fp + '_right_measurement', getMeasurement(ce.style[pr + b[1] + sf])); + selectByValue(f, fp + '_bottom_measurement', getMeasurement(ce.style[pr + b[2] + sf])); + selectByValue(f, fp + '_left_measurement', getMeasurement(ce.style[pr + b[3] + sf])); + f.elements[fp + "_left_measurement"].disabled = false; + f.elements[fp + "_bottom_measurement"].disabled = false; + f.elements[fp + "_right_measurement"].disabled = false; + } + } +} + +function isSame(e, pr, sf, b) { + var a = new Array(), i, x; + + if (typeof(b) == "undefined") + b = new Array('Top', 'Right', 'Bottom', 'Left'); + + if (typeof(sf) == "undefined" || sf == null) + sf = ""; + + a[0] = e.style[pr + b[0] + sf]; + a[1] = e.style[pr + b[1] + sf]; + a[2] = e.style[pr + b[2] + sf]; + a[3] = e.style[pr + b[3] + sf]; + + for (i=0; i 0 ? s.substring(1) : s; + + if (f.text_none.checked) + s = "none"; + + ce.style.textDecoration = s; + + // Build background styles + + ce.style.backgroundColor = f.background_color.value; + ce.style.backgroundImage = f.background_image.value != "" ? "url(" + f.background_image.value + ")" : ""; + ce.style.backgroundRepeat = f.background_repeat.value; + ce.style.backgroundAttachment = f.background_attachment.value; + + if (f.background_hpos.value != "") { + s = ""; + s += f.background_hpos.value + (isNum(f.background_hpos.value) ? f.background_hpos_measurement.value : "") + " "; + s += f.background_vpos.value + (isNum(f.background_vpos.value) ? f.background_vpos_measurement.value : ""); + ce.style.backgroundPosition = s; + } + + // Build block styles + + ce.style.wordSpacing = f.block_wordspacing.value + (isNum(f.block_wordspacing.value) ? f.block_wordspacing_measurement.value : ""); + ce.style.letterSpacing = f.block_letterspacing.value + (isNum(f.block_letterspacing.value) ? f.block_letterspacing_measurement.value : ""); + ce.style.verticalAlign = f.block_vertical_alignment.value; + ce.style.textAlign = f.block_text_align.value; + ce.style.textIndent = f.block_text_indent.value + (isNum(f.block_text_indent.value) ? f.block_text_indent_measurement.value : ""); + ce.style.whiteSpace = f.block_whitespace.value; + ce.style.display = f.block_display.value; + + // Build box styles + + ce.style.width = f.box_width.value + (isNum(f.box_width.value) ? f.box_width_measurement.value : ""); + ce.style.height = f.box_height.value + (isNum(f.box_height.value) ? f.box_height_measurement.value : ""); + ce.style.styleFloat = f.box_float.value; + + if (tinyMCE.isGecko) + ce.style.cssFloat = f.box_float.value; + + ce.style.clear = f.box_clear.value; + + if (!f.box_padding_same.checked) { + ce.style.paddingTop = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + ce.style.paddingRight = f.box_padding_right.value + (isNum(f.box_padding_right.value) ? f.box_padding_right_measurement.value : ""); + ce.style.paddingBottom = f.box_padding_bottom.value + (isNum(f.box_padding_bottom.value) ? f.box_padding_bottom_measurement.value : ""); + ce.style.paddingLeft = f.box_padding_left.value + (isNum(f.box_padding_left.value) ? f.box_padding_left_measurement.value : ""); + } else + ce.style.padding = f.box_padding_top.value + (isNum(f.box_padding_top.value) ? f.box_padding_top_measurement.value : ""); + + if (!f.box_margin_same.checked) { + ce.style.marginTop = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + ce.style.marginRight = f.box_margin_right.value + (isNum(f.box_margin_right.value) ? f.box_margin_right_measurement.value : ""); + ce.style.marginBottom = f.box_margin_bottom.value + (isNum(f.box_margin_bottom.value) ? f.box_margin_bottom_measurement.value : ""); + ce.style.marginLeft = f.box_margin_left.value + (isNum(f.box_margin_left.value) ? f.box_margin_left_measurement.value : ""); + } else + ce.style.margin = f.box_margin_top.value + (isNum(f.box_margin_top.value) ? f.box_margin_top_measurement.value : ""); + + // Build border styles + + if (!f.border_style_same.checked) { + ce.style.borderTopStyle = f.border_style_top.value; + ce.style.borderRightStyle = f.border_style_right.value; + ce.style.borderBottomStyle = f.border_style_bottom.value; + ce.style.borderLeftStyle = f.border_style_left.value; + } else + ce.style.borderStyle = f.border_style_top.value; + + if (!f.border_width_same.checked) { + ce.style.borderTopWidth = f.border_width_top.value + (isNum(f.border_width_top.value) ? f.border_width_top_measurement.value : ""); + ce.style.borderRightWidth = f.border_width_right.value + (isNum(f.border_width_right.value) ? f.border_width_right_measurement.value : ""); + ce.style.borderBottomWidth = f.border_width_bottom.value + (isNum(f.border_width_bottom.value) ? f.border_width_bottom_measurement.value : ""); + ce.style.borderLeftWidth = f.border_width_left.value + (isNum(f.border_width_left.value) ? f.border_width_left_measurement.value : ""); + } else + ce.style.borderWidth = f.border_width_top.value; + + if (!f.border_color_same.checked) { + ce.style.borderTopColor = f.border_color_top.value; + ce.style.borderRightColor = f.border_color_right.value; + ce.style.borderBottomColor = f.border_color_bottom.value; + ce.style.borderLeftColor = f.border_color_left.value; + } else + ce.style.borderColor = f.border_color_top.value; + + // Build list styles + + ce.style.listStyleType = f.list_type.value; + ce.style.listStylePosition = f.list_position.value; + ce.style.listStyleImage = f.list_bullet_image.value != "" ? "url(" + f.list_bullet_image.value + ")" : ""; + + // Build positioning styles + + ce.style.position = f.positioning_type.value; + ce.style.visibility = f.positioning_visibility.value; + + if (ce.style.width == "") + ce.style.width = f.positioning_width.value + (isNum(f.positioning_width.value) ? f.positioning_width_measurement.value : ""); + + if (ce.style.height == "") + ce.style.height = f.positioning_height.value + (isNum(f.positioning_height.value) ? f.positioning_height_measurement.value : ""); + + ce.style.zIndex = f.positioning_zindex.value; + ce.style.overflow = f.positioning_overflow.value; + + if (!f.positioning_placement_same.checked) { + ce.style.top = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.right = f.positioning_placement_right.value + (isNum(f.positioning_placement_right.value) ? f.positioning_placement_right_measurement.value : ""); + ce.style.bottom = f.positioning_placement_bottom.value + (isNum(f.positioning_placement_bottom.value) ? f.positioning_placement_bottom_measurement.value : ""); + ce.style.left = f.positioning_placement_left.value + (isNum(f.positioning_placement_left.value) ? f.positioning_placement_left_measurement.value : ""); + } else { + s = f.positioning_placement_top.value + (isNum(f.positioning_placement_top.value) ? f.positioning_placement_top_measurement.value : ""); + ce.style.top = s; + ce.style.right = s; + ce.style.bottom = s; + ce.style.left = s; + } + + if (!f.positioning_clip_same.checked) { + s = "rect("; + s += (isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_right.value) ? f.positioning_clip_right.value + f.positioning_clip_right_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_bottom.value) ? f.positioning_clip_bottom.value + f.positioning_clip_bottom_measurement.value : "auto") + " "; + s += (isNum(f.positioning_clip_left.value) ? f.positioning_clip_left.value + f.positioning_clip_left_measurement.value : "auto"); + s += ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } else { + s = "rect("; + t = isNum(f.positioning_clip_top.value) ? f.positioning_clip_top.value + f.positioning_clip_top_measurement.value : "auto"; + s += t + " "; + s += t + " "; + s += t + " "; + s += t + ")"; + + if (s != "rect(auto auto auto auto)") + ce.style.clip = s; + } + + ce.style.cssText = tinyMCE.serializeStyle(tinyMCE.parseStyle(ce.style.cssText)); +} + +function isNum(s) { + return new RegExp('[0-9]+', 'g').test(s); +} + +function showDisabledControls() { + var f = document.forms, i, a; + + for (i=0; i 1) { + addSelectValue(f, s, p[0], p[1]); + + if (se) + selectByValue(f, s, p[1]); + } else { + addSelectValue(f, s, p[0], p[0]); + + if (se) + selectByValue(f, s, p[0]); + } + } +} + +function toggleSame(ce, pre) { + var el = document.forms[0].elements, i; + + if (ce.checked) { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = true; + el[pre + "_bottom"].disabled = true; + el[pre + "_left"].disabled = true; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = true; + el[pre + "_bottom_measurement"].disabled = true; + el[pre + "_left_measurement"].disabled = true; + } + } else { + el[pre + "_top"].disabled = false; + el[pre + "_right"].disabled = false; + el[pre + "_bottom"].disabled = false; + el[pre + "_left"].disabled = false; + + if (el[pre + "_top_measurement"]) { + el[pre + "_top_measurement"].disabled = false; + el[pre + "_right_measurement"].disabled = false; + el[pre + "_bottom_measurement"].disabled = false; + el[pre + "_left_measurement"].disabled = false; + } + } + + showDisabledControls(); +} + +function synch(fr, to) { + var f = document.forms[0]; + + f.elements[to].value = f.elements[fr].value; + + if (f.elements[fr + "_measurement"]) + selectByValue(f, to + "_measurement", f.elements[fr + "_measurement"].value); +} diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/langs/en.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/langs/en.js 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/langs/en.js 2006-06-25 16:54:23.000000000 -0400 @@ -0,0 +1,60 @@ +// UK lang variables + +tinyMCE.addToLang('style',{ +title : 'Edit CSS Style', +styleinfo_desc : 'Edit CSS Style', +text_tab : 'Text', +background_tab : 'Background', +block_tab : 'Block', +box_tab : 'Box', +border_tab : 'Border', +list_tab : 'List', +positioning_tab : 'Positioning', +text_props : 'Text', +text_font : 'Font', +text_size : 'Size', +text_weight : 'Weight', +text_style : 'Style', +text_variant : 'Variant', +text_lineheight : 'Line height', +text_case : 'Case', +text_color : 'Color', +text_decoration : 'Decoration', +background_color : 'Background color', +background_image : 'Background image', +background_repeat : 'Repeat', +background_attachment : 'Attachment', +background_hpos : 'Horizontal position', +background_vpos : 'Vertical position', +block_wordspacing : 'Word spacing', +block_letterspacing : 'Letter spacing', +block_vertical_alignment : 'Vertical alignment', +block_text_align : 'Text align', +block_text_indent : 'Text indent', +block_whitespace : 'Whitespace', +block_display : 'Display', +box_width : 'Width', +box_height : 'Height', +box_float : 'Float', +box_clear : 'Clear', +padding : 'Padding', +same : 'Same for all', +top : 'Top', +right : 'Right', +bottom : 'Bottom', +left : 'Left', +margin : 'Margin', +style : 'Style', +width : 'Width', +height : 'Height', +color : 'Color', +list_type : 'Type', +bullet_image : 'Bullet image', +position : 'Position', +positioning_type : 'Type', +visibility : 'Visibility', +zindex : 'Z-index', +overflow : 'Overflow', +placement : 'Placement', +clip : 'Clip' +}); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/props.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/props.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/props.htm 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/style/props.htm 2006-06-25 16:54:23.000000000 -0400 @@ -0,0 +1,580 @@ + + + {$lang_style_title} + + + + + + + + + +
      + + +
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + +
        +
      +
      + +
      + + + +
      +
      + +   +
      +
      + +
      + + + + + +
       
      +
      {$lang_style_text_decoration} + + + + + + +
      +
      + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + +
       
      +
      + +
        +
      +
      + +
        +
      +
      +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
        +
      +
      + +
        +
      +
      + +
        +
      +
      +
      + +
      + + + + + + + + + + + + + + +
      + +
        +
      +
         
      + +
        +
      +
         
      +
      +
      + {$lang_style_padding} + + + + + + + + + + + + + + + + + + + + + + +
       
      + +
        +
      +
      + +
        +
      +
      + +
        +
      +
      + +
        +
      +
      +
      +
      +
      +
      + {$lang_style_margin} + + + + + + + + + + + + + + + + + + + + + + +
       
      + +
        +
      +
      + +
        +
      +
      + +
        +
      +
      + +
        +
      +
      +
      +
      +
      +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        {$lang_style_style} {$lang_style_width} {$lang_style_color}
            
      {$lang_style_top}   + + +
        +
      +
        + + + + +
       
      +
      {$lang_style_right}   + + +
        +
      +
        + + + + +
       
      +
      {$lang_style_bottom}   + + +
        +
      +
        + + + + +
       
      +
      {$lang_style_left}   + + +
        +
      +
        + + + + +
       
      +
      +
      + +
      + + + + + + + + + + + + + + + +
      +
      + +
      + + + + + + + + + + + + + + + + + + + + + +
         
      + +
        +
      +
         
      + +
        +
      +
         
      + +
      +
      + {$lang_style_placement} + + + + + + + + + + + + + + + + + + + + + + +
       
      {$lang_style_top} + +
        +
      +
      {$lang_style_right} + +
        +
      +
      {$lang_style_bottom} + +
        +
      +
      {$lang_style_left} + +
        +
      +
      +
      +
      +
      +
      + {$lang_style_clip} + + + + + + + + + + + + + + + + + + + + + + +
       
      {$lang_style_top} + +
        +
      +
      {$lang_style_right} + +
        +
      +
      {$lang_style_bottom} + +
        +
      +
      {$lang_style_left} + +
        +
      +
      +
      +
      +
      +
      + + +
      +
      +
      +
       
      +
      +
      + +
      + +
      +
      + + +
      +
      +
      + + diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/cell.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/cell.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/cell.htm 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/table/cell.htm 2006-06-25 16:54:22.000000000 -0400 @@ -75,7 +75,7 @@
      \ - \ - \ - \ - \ - ';}return "";}function TinyMCE_zoom_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceZoom":tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom=value;tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom=value;return true;}return false;} \ No newline at end of file +var TinyMCE_ZoomPlugin={getInfo:function(){return{longname:'Zoom',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};},getControlHTML:function(control_name){if(!tinyMCE.isMSIE||tinyMCE.isMSIE5_0||tinyMCE.isOpera)return"";switch(control_name){case"zoom":return'';}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceZoom":tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom=value;tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom=value;return true;}return false;}};tinyMCE.addPlugin("zoom",TinyMCE_ZoomPlugin); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/editor_plugin_src.js 2006-06-25 16:54:20.000000000 -0400 @@ -1,47 +1,58 @@ -/* Import plugin specific language pack */ - -function TinyMCE_zoom_getInfo() { - return { - longname : 'Zoom', - author : 'Moxiecode Systems', - authorurl : 'http://tinymce.moxiecode.com', - infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html', - version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion - }; -}; - /** - * Returns the HTML contents of the zoom control. + * $RCSfile: editor_plugin_src.js,v $ + * $Revision: 1.10 $ + * $Date: 2006/04/07 15:52:50 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. */ -function TinyMCE_zoom_getControlHTML(control_name) { - if (!tinyMCE.isMSIE || tinyMCE.isMSIE5_0 || tinyMCE.isOpera) - return ""; - switch (control_name) { - case "zoom": - return ''; - } +var TinyMCE_ZoomPlugin = { + getInfo : function() { + return { + longname : 'Zoom', + author : 'Moxiecode Systems', + authorurl : 'http://tinymce.moxiecode.com', + infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_zoom.html', + version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion + }; + }, + + /** + * Returns the HTML contents of the zoom control. + */ + getControlHTML : function(control_name) { + if (!tinyMCE.isMSIE || tinyMCE.isMSIE5_0 || tinyMCE.isOpera) + return ""; + + switch (control_name) { + case "zoom": + return ''; + } - return ""; -} + return ""; + }, -/** - * Executes the mceZoom command. - */ -function TinyMCE_zoom_execCommand(editor_id, element, command, user_interface, value) { - // Handle commands - switch (command) { - case "mceZoom": - tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom = value; - tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom = value; - return true; + /** + * Executes the mceZoom command. + */ + execCommand : function(editor_id, element, command, user_interface, value) { + // Handle commands + switch (command) { + case "mceZoom": + tinyMCE.getInstanceById(editor_id).contentDocument.body.style.zoom = value; + tinyMCE.getInstanceById(editor_id).contentDocument.body.style.mozZoom = value; + return true; + } + + // Pass to next handler in chain + return false; } +}; - // Pass to next handler in chain - return false; -} +tinyMCE.addPlugin("zoom", TinyMCE_ZoomPlugin); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/es.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/es.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/es.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/es.js 1969-12-31 19:00:00.000000000 -0500 @@ -1,3 +0,0 @@ -// Español por matiasl-AR - -tinyMCELang['lang_zoom_prefix'] = 'Aumento de Tamaño'; \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/he.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/he.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/he.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/he.js 1969-12-31 19:00:00.000000000 -0500 @@ -1,5 +0,0 @@ -// HE lang variables by Liron Newman, http://eesh.net - -tinyMCE.addToLang('',{ -zoom_prefix : 'æåí' -}); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/index.html joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/index.html --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/index.html 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/index.html 1969-12-31 19:00:00.000000000 -0500 @@ -1 +0,0 @@ - \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru.js 1969-12-31 19:00:00.000000000 -0500 @@ -1,5 +0,0 @@ -// RU cp1251 lang variables - -tinyMCE.addToLang('',{ -zoom_prefix : 'ìàñøòàá' -}); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_KOI8-R.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_KOI8-R.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_KOI8-R.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_KOI8-R.js 1969-12-31 19:00:00.000000000 -0500 @@ -1,5 +0,0 @@ -// RU KOI8-R lang variables - -tinyMCE.addToLang('',{ -zoom_prefix : 'ÍÁÓÛÔÁÂ' -}); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_UTF-8.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_UTF-8.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_UTF-8.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/langs/ru_UTF-8.js 1969-12-31 19:00:00.000000000 -0500 @@ -1,5 +0,0 @@ -// RU UTF-8 lang variables - -tinyMCE.addToLang('',{ -zoom_prefix : 'маÑштаб' -}); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/readme.txt joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/readme.txt --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/readme.txt 1969-12-31 19:00:00.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/plugins/zoom/readme.txt 2006-06-25 16:54:20.000000000 -0400 @@ -0,0 +1 @@ +Check the TinyMCE documentation for details on this plugin. diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/about.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/about.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/about.htm 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/about.htm 2006-06-25 16:54:35.000000000 -0400 @@ -4,14 +4,15 @@ - @@ -22,7 +23,7 @@

      Version: {$tinymce_version} ({$tinymce_releasedate})

      TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

      -

      Copyright © 2005, Moxiecode Systems AB, All rights reserved.

      +

      Copyright © 2003-2006, Moxiecode Systems AB, All rights reserved.

      For more information about this software visit the TinyMCE website.

      diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/color_picker.htm 2006-06-25 16:54:35.000000000 -0400 @@ -5,7 +5,7 @@ - +
      diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_content.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_content.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_content.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_content.css 2006-06-25 16:54:35.000000000 -0400 @@ -1,34 +1,24 @@ /* This file contains the CSS data for the editable area(iframe) of TinyMCE */ /* You can extend this CSS by adding your own CSS file with the the content_css option */ -body { - background-color: #FFFFFF; - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; - scrollbar-3dlight-color: #F0F0EE; - scrollbar-arrow-color: #676662; - scrollbar-base-color: #F0F0EE; - scrollbar-darkshadow-color: #DDDDDD; - scrollbar-face-color: #E0E0DD; - scrollbar-highlight-color: #F0F0EE; - scrollbar-shadow-color: #F0F0EE; - scrollbar-track-color: #F5F5F5; -} - -td { +body, td, pre { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } -pre { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; +body { + background-color: #FFFFFF; } .mceVisualAid { border: 1px dashed #BBBBBB !important; } +div.mceVisualAid { + background-image:url('../images/spacer.gif'); + visibility: visible !important; +} + .mceItemAnchor { width: 12px; line-height: 6px; @@ -53,3 +43,16 @@ color: green; } */ + +/* MSIE specific */ + +* html body { + scrollbar-3dlight-color: #F0F0EE; + scrollbar-arrow-color: #676662; + scrollbar-base-color: #F0F0EE; + scrollbar-darkshadow-color: #DDDDDD; + scrollbar-face-color: #E0E0DD; + scrollbar-highlight-color: #F0F0EE; + scrollbar-shadow-color: #F0F0EE; + scrollbar-track-color: #F5F5F5; +} diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_popup.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_popup.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_popup.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_popup.css 2006-06-25 16:54:35.000000000 -0400 @@ -35,14 +35,14 @@ } .input_noborder { - border: 0px solid #808080; + border: 0; } -#insert { +#insert, .updateButton { font-weight: bold; width: 90px; height: 21px; - border: 0px; + border: 0; background-image: url('../images/insert_button_bg.gif'); cursor: pointer; } @@ -51,7 +51,7 @@ font-weight: bold; width: 90px; height: 21px; - border: 0px; + border: 0; background-image: url('../images/cancel_button_bg.gif'); cursor: pointer; } @@ -84,7 +84,7 @@ td.charmapOver { background-color: #CCCCCC; - cursor: arrow; + cursor: default; } a.charmap { @@ -120,17 +120,17 @@ border-bottom: 1px solid; border-right: 1px solid; border-color: #F0F0EE; - cursor: arrow; + cursor: default; } .mceButtonOver { border: 1px solid #0A246A; - cursor: arrow; + cursor: default; background-color: #B6BDD2; } .mceButtonDown { - cursor: arrow; + cursor: default; border: 1px solid #0A246A; background-color: #8592B5; } @@ -144,7 +144,7 @@ border-bottom: 1px solid; border-right: 1px solid; border-color: #F0F0EE; - cursor: arrow; + cursor: default; } .mceActionPanel { @@ -162,7 +162,7 @@ .tabs ul { margin: 0; - padding: 0px 0px 0; + padding: 0 0 0; list-style: none; } @@ -170,7 +170,7 @@ float: left; background: url("../images/xp/tab_bg.gif") no-repeat left top; margin: 0; - margin-left: 0px; + margin-left: 0; margin-right: 2px; padding: 0 0 0 10px; line-height: 18px; @@ -185,7 +185,7 @@ float: left; display: block; background: url("../images/xp/tab_end.gif") no-repeat right top; - padding: 0px 10px 0px 0px; + padding: 0px 10px 0 0; } .tabs .current span { @@ -235,8 +235,8 @@ border: 1px solid #919B9C; font-family: Verdana, Arial; font-size: 10px; - padding: 0px; - margin: 0px; + padding: 0; + margin: 0; padding: 4px; } @@ -295,8 +295,8 @@ h1, h2, h3, h4 { color: #2B6FB6; - margin: 0px; - padding: 0px; + margin: 0; + padding: 0; padding-top: 5px; } @@ -304,6 +304,14 @@ font-size: 14px; } +#link .panel_wrapper, #link div.current { + height: 125px; +} + +#image .panel_wrapper, #image div.current { + height: 190px; +} + /* Disables the advanced tab in the table plugin. */ /* #table #advanced_tab { diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_ui.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_ui.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_ui.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/css/editor_ui.css 2006-06-25 16:54:35.000000000 -0400 @@ -1,65 +1,14 @@ /* This file contains the CSS data for the editor UI of TinyMCE instances */ .mceToolbarTop a, .mceToolbarTop a:visited, .mceToolbarTop a:hover, .mceToolbarBottom a, .mceToolbarBottom a:visited, .mceToolbarBottom a:hover { - border: 0px; margin: 0px; padding: 0px; background: transparent; -} - -.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceSeparatorLine, .mceButtonDisabled, .mceButtonSelected { - border: 0px; margin: 0px; padding: 0px; background: transparent; - margin-top: 1px; - margin-left: 1px; - padding: 0px; -} - -.mceButtonNormal { - border: 1px solid #F0F0EE !important; - cursor: arrow; -} - -.mceButtonOver { - border: 1px solid #0A246A !important; - cursor: arrow; - background-color: #B6BDD2; -} - -.mceButtonDown { - cursor: arrow; - border: 1px solid #0A246A !important; - background-color: #8592B5; -} - -.mceButtonSelected { - border: 1px solid #C0C0BB !important; - cursor: arrow; -} - -.mceButtonDisabled { - filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); - -moz-opacity:0.3; - opacity: 0.3; - border: 1px solid #F0F0EE !important; - cursor: arrow; -} - -.mceSeparator { - border-top: 1px solid buttonhighlight; - border-left: 1px solid buttonhighlight; - border-bottom: 1px solid buttonshadow; - border-right: 1px solid buttonshadow; - margin-right: 2px; - margin-left: 2px; + border: 0; margin: 0; padding: 0; background: transparent; } .mceSeparatorLine { - margin:2px; + border: 0; + padding: 0; margin-left: 4px; - background-color: #F0F0EE; - border-top: 1px solid buttonshadow; - border-left: 1px solid buttonshadow; - border-bottom: 1px solid buttonhighlight; - border-right: 1px solid buttonhighlight; - width: 0px; - height: 15px; + margin-right: 2px; } .mceSelectList { @@ -67,10 +16,10 @@ font-size: 7pt !important; font-weight: normal; margin-top: 3px; - padding: 0px; + padding: 0; display: inline; vertical-align: top; - background-color: #F0F0EE + background-color: #F0F0EE; } .mceLabel, .mceLabelDisabled { @@ -90,15 +39,15 @@ .mceEditor { background: #F0F0EE; border: 1px solid #cccccc; - padding: 0px; - margin: 0px; + padding: 0; + margin: 0; } .mceEditorArea { font-family: 'MS Sans Serif', sans-serif, Verdana, Arial; background: #FFFFFF; - padding: 0px; - margin: 0px; + padding: 0; + margin: 0; } .mceToolbarTop, .mceToolbarBottom { @@ -109,6 +58,7 @@ .mceToolbarTop { border-bottom: 1px solid #cccccc; + padding-bottom: 1px; } .mceToolbarBottom { @@ -168,6 +118,236 @@ height: 10px; display: none; border: 1px dotted gray; - margin: 0px; - padding: 0px; + margin: 0; + padding: 0; +} + +.mceEditorIframe { + border: 0; +} + +/* Button CSS rules */ + +a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img { + width: 20px; + height: 20px; + cursor: default; + margin-top: 1px; + margin-left: 1px; +} + +a.mceButtonDisabled img { + border: 0 !important; +} + +a.mceButtonNormal img, a.mceButtonSelected img { + border: 1px solid #F0F0EE !important; +} + +a.mceButtonSelected img { + border: 1px solid #6779AA !important; + background-color: #D4D5D8; +} + +a.mceButtonNormal img:hover, a.mceButtonSelected img:hover { + border: 1px solid #0A246A !important; + cursor: default; + background-color: #B6BDD2; +} + +a.mceButtonDisabled img { + -moz-opacity:0.3; + opacity: 0.3; + border: 1px solid #F0F0EE !important; + cursor: default; +} + +a.mceTiledButton img { + background-image: url('../images/buttons.gif'); + background-repeat: no-repeat; +} + +/* MSIE specific rules */ + +* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img { + border: 0 !important; + margin-top: 2px; + margin-bottom: 1px; +} + +* html a.mceButtonDisabled img { + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); + border: 0 !important; +} + +* html a.mceButtonDisabled { + border: 1px solid #F0F0EE !important; +} + +* html a.mceButtonNormal, * html a.mceButtonSelected { + border: 1px solid #F0F0EE !important; + cursor: default; +} + +* html a.mceButtonSelected { + border: 1px solid #6779AA !important; + background-color: #D4D5D8; +} + +* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover { + border: 1px solid #0A246A !important; + cursor: default; + background-color: #B6BDD2; +} + +* html .mceSelectList { + margin-top: 2px; +} + +/* Menu button CSS rules */ + +span.mceMenuButton img, span.mceMenuButtonSelected img { + border: 1px solid #F0F0EE; + margin-left: 1px; +} + +span.mceMenuButtonSelected img { + border: 1px solid #6779AA; + background-color: #B6BDD2; +} + +span.mceMenuButtonSelected img.mceMenuButton { + border: 1px solid #F0F0EE; + background-color: transparent; +} + +span.mceMenuButton img.mceMenuButton, span.mceMenuButtonSelected img.mceMenuButton { + border-left: 0; + margin-left: 0; +} + +span.mceMenuButton:hover img, span.mceMenuButtonSelected:hover img { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +span.mceMenuButton:hover img.mceMenuButton, span.mceMenuButtonSelected:hover img.mceMenuButton { + border-left: 0; +} + +span.mceMenuButtonFocus img { + border: 1px solid gray; + border-right: 0; + margin-left: 1px; + background-color: #F5F4F2; +} + +span.mceMenuButtonFocus img.mceMenuButton { + border: 1px solid gray; + border-left: 1px solid #F5F4F2; + margin-left: 0; +} + +/* Menu button MSIE specific rules */ + +* html span.mceMenuButton, * html span.mceMenuButtonFocus { + position: relative; + left: 0; + top: 0; +} + +* html span.mceMenuButton img, * html span.mceMenuButtonSelected img, * html span.mceMenuButtonFocus img { + position: relative; + top: 1px; +} + +* html span.mceMenuHover img { + border: 1px solid #0A246A; + background-color: #B6BDD2; +} + +* html span.mceMenuButtonSelected.mceMenuHover img.mceMenuButton { + border: 1px solid #0A246A; + background-color: #B6BDD2; + border-left: 0; +} + +/* Menu */ + +.mceMenu { + position: absolute; + left: 0; + top: 0; + display: none; + z-index: 100; + background-color: white; + border: 1px solid gray; + font-weight: normal; +} + +.mceMenu a, .mceMenuTitle, .mceMenuDisabled { + display: block; + width: 100%; + text-decoration: none; + background-color: white; + font-family: Tahoma, Verdana, Arial, Helvetica; + font-size: 11px; + line-height: 20px; + color: black; +} + +.mceMenu a:hover { + background-color: #B6BDD2; + color: black; + text-decoration: none !important; +} + +.mceMenu span { + padding-left: 10px; + padding-right: 10px; + display: block; + line-height: 20px; +} + +.mceMenuSeparator { + border-bottom: 1px solid gray; + background-color: gray; + height: 1px; +} + +.mceMenuTitle span { + padding-left: 5px; +} + +.mceMenuTitle { + background-color: #DDDDDD; + font-weight: bold; +} + +.mceMenuDisabled { + color: gray; +} + +span.mceMenuSelectedItem { + background-image: url('../images/menu_check.gif'); + background-repeat: no-repeat; + background-position: 5px 8px; + padding-left: 20px; +} + +span.mceMenuCheckItem { + padding-left: 20px; +} + +span.mceMenuLine { + display: block; + position: absolute; + left: 0; + top: -1px; + background-color: #F5F4F2; + width: 30px; + height: 1px; + overflow: hidden; + padding-left: 0; + padding-right: 0; } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/editor_template.js 2006-06-25 16:54:35.000000000 -0400 @@ -1,12 +1 @@ -tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_advanced_autoImportCSSClasses=true;var TinyMCE_advanced_resizer=new Object();var TinyMCE_advanced_buttons=[['bold','{$lang_bold_img}','{$lang_bold_desc}','Bold'],['italic','{$lang_italic_img}','{$lang_italic_desc}','Italic'],['underline','{$lang_underline_img}','{$lang_underline_desc}','Underline'],['strikethrough','strikethrough.gif','{$lang_striketrough_desc}','Strikethrough'],['justifyleft','justifyleft.gif','{$lang_justifyleft_desc}','JustifyLeft'],['justifycenter','justifycenter.gif','{$lang_justifycenter_desc}','JustifyCenter'],['justifyright','justifyright.gif','{$lang_justifyright_desc}','JustifyRight'],['justifyfull','justifyfull.gif','{$lang_justifyfull_desc}','JustifyFull'],['bullist','bullist.gif','{$lang_bullist_desc}','InsertUnorderedList'],['numlist','numlist.gif','{$lang_numlist_desc}','InsertOrderedList'],['outdent','outdent.gif','{$lang_outdent_desc}','Outdent'],['indent','indent.gif','{$lang_indent_desc}','Indent'],['cut','cut.gif','{$lang_cut_desc}','Cut'],['copy','copy.gif','{$lang_copy_desc}','Copy'],['paste','paste.gif','{$lang_paste_desc}','Paste'],['undo','undo.gif','{$lang_undo_desc}','Undo'],['redo','redo.gif','{$lang_redo_desc}','Redo'],['link','link.gif','{$lang_link_desc}','mceLink',true],['unlink','unlink.gif','{$lang_unlink_desc}','unlink'],['image','image.gif','{$lang_image_desc}','mceImage',true],['cleanup','cleanup.gif','{$lang_cleanup_desc}','mceCleanup'],['help','help.gif','{$lang_help_desc}','mceHelp'],['code','code.gif','{$lang_theme_code_desc}','mceCodeEditor'],['hr','hr.gif','{$lang_theme_hr_desc}','inserthorizontalrule'],['removeformat','removeformat.gif','{$lang_theme_removeformat_desc}','removeformat'],['sub','sub.gif','{$lang_theme_sub_desc}','subscript'],['sup','sup.gif','{$lang_theme_sup_desc}','superscript'],['forecolor','forecolor.gif','{$lang_theme_forecolor_desc}','mceForeColor',true],['backcolor','backcolor.gif','{$lang_theme_backcolor_desc}','mceBackColor',true],['charmap','charmap.gif','{$lang_theme_charmap_desc}','mceCharMap'],['visualaid','visualaid.gif','{$lang_theme_visualaid_desc}','mceToggleVisualAid'],['anchor','anchor.gif','{$lang_theme_anchor_desc}','mceInsertAnchor'],['newdocument','newdocument.gif','{$lang_newdocument_desc}','mceNewDocument']];function TinyMCE_advanced_getControlHTML(button_name){var buttonTileMap=new Array('anchor.gif','backcolor.gif','bullist.gif','justifycenter.gif','charmap.gif','cleanup.gif','code.gif','copy.gif','custom_1.gif','cut.gif','forecolor.gif','justifyfull.gif','help.gif','hr.gif','image.gif','indent.gif','justifyleft.gif','link.gif','numlist.gif','outdent.gif','paste.gif','redo.gif','removeformat.gif','justifyright.gif','strikethrough.gif','sub.gif','sup.gif','undo.gif','unlink.gif','visualaid.gif');for(var i=0;i4?but[4]:false)+(but.length>5?',\''+but[5]+'\'':'')+')';return '';}}}var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\','+(but.length>4?but[4]:false)+(but.length>5?',\''+but[5]+'\'':'')+')';return '';}}switch(button_name){case "formatselect":var html='';return html;case "styleselect":return '';case "fontselect":var fontHTML='';return fontHTML;case "fontsizeselect":return '';case "|":case "separator":return '';case "spacer":return '';case "rowseparator":return '
      ';}return "";}function TinyMCE_advanced_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceForeColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=tinyMCE.getAttrib(elm,"color");if(inputColor=='')inputColor=elm.style.color;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"forecolor",input_color:inputColor});return true;case "mceBackColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=elm.style.backgroundColor;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;template['width']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"HiliteColor",input_color:inputColor});return true;case "mceColorPicker":if(user_interface){var template=new Array();var inputColor=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=220;template['height']=190;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:inputColor});}else{var savedVal=tinyMCE.lastColorPickerValue;var elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;eval('elm.onchange();');}return true;case "mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",500));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",400));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case "mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case "mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case "mceNewDocument":if(confirm(tinyMCE.getLang('lang_newdocument')))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,'');return true;}return false;}function TinyMCE_advanced_getEditorTemplate(settings,editorId){function removeFromArray(in_array,remove_array){var outArray=new Array();for(var i=0;i 

      ';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i'+key+'';}TinyMCE_advanced_autoImportCSSClasses=false;}switch(layoutManager){case "SimpleLayout":var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var toolbarAlign=tinyMCE.getParam("theme_advanced_toolbar_align","center");var pathLocation=tinyMCE.getParam("theme_advanced_path_location","none");var statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};toolbarHTML+='';for(var i=1;i<100;i++){var def=defVals["theme_advanced_buttons"+i];var buttons=tinyMCE.getParam("theme_advanced_buttons"+i,def==null?'':def,true,',');if(buttons.length==0)break;buttons=removeFromArray(buttons,tinyMCE.getParam("theme_advanced_disable","",true,','));buttons=addToArray(buttons,tinyMCE.getParam("theme_advanced_buttons"+i+"_add","",true,','));buttons=addToArray(tinyMCE.getParam("theme_advanced_buttons"+i+"_add_before","",true,','),buttons);for(var b=0;b0){toolbarHTML+="
      ";deltaHeight-=23;}}toolbarHTML+='';template['html']='';if(toolbarLocation=="top"){template['html']+='';}if(statusbarLocation=="top"){template['html']+='';deltaHeight-=23;}template['html']+='';if(toolbarLocation=="bottom"){template['html']+='';}if(toolbarLocation=="external"){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVars(toolbarHTML,tinyMCE.settings);toolbarHTML=tinyMCE.replaceVars(toolbarHTML,tinyMCELang);toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.replaceVar(toolbarHTML,"editor_id",editorId);toolbarHTML=tinyMCE.applyTemplate(toolbarHTML);elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='
      '+toolbarHTML+'
      '+statusbarHTML+'
      '+toolbarHTML+'
      '+toolbarHTML+'
      ';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null;}if(statusbarLocation=="bottom"){template['html']+='
      '+statusbarHTML+'
      ';break;case "RowLayout":template['html']='';var containers=tinyMCE.getParam("theme_advanced_containers","",true,",");var defaultContainerCSS=tinyMCE.getParam("theme_advanced_containers_default_class","container");var defaultContainerAlign=tinyMCE.getParam("theme_advanced_containers_default_align","center");for(var i=0;i';}else if(containers[i]=="mceElementpath"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom";}else if(i==0){pathClass="mceStatusbar";}else{deltaHeight-=2;}template['html']+='';deltaHeight-=22;}else{var curContainer=tinyMCE.getParam("theme_advanced_container_"+containers[i],"",true,',');var curContainerHTML="";var curAlign=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align",defaultContainerAlign);var curCSS=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class",defaultContainerCSS);for(var j=0;j0){curContainerHTML+="
      ";deltaHeight-=23;}template['html']+='
      ';}}template['html']+='
      \ - \ -
      '+statusbarHTML+'
      '+curContainerHTML+'
      ';break;case "BorderLayout":break;case "CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);");}break;default:alert('UNDEFINED LAYOUT MANAGER! PLEASE CHECK YOUR TINYMCE CONFIG!');break;}if(resizing)template['html']+='';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=deltaHeight;return template;}function TinyMCE_advanced_setResizing(e,editor_id,state){e=typeof(e)=="undefined"?window.event:e;var resizer=TinyMCE_advanced_resizer;var editorContainer=document.getElementById(editor_id+'_parent');var editorArea=document.getElementById(editor_id+'_parent').firstChild;var resizeBox=document.getElementById(editor_id+'_resize_box');var inst=tinyMCE.getInstanceById(editor_id);if(state){var width=editorArea.clientWidth;var height=editorArea.clientHeight;resizeBox.style.width=width+"px";resizeBox.style.height=height+"px";resizer.iframeWidth=inst.iframeElement.clientWidth;resizer.iframeHeight=inst.iframeElement.clientHeight;editorArea.style.display="none";resizeBox.style.display="block";if(!resizer.eventHandlers){if(tinyMCE.isMSIE)tinyMCE.addEvent(document,"mousemove",TinyMCE_advanced_resizeEventHandler);else tinyMCE.addEvent(window,"mousemove",TinyMCE_advanced_resizeEventHandler);tinyMCE.addEvent(document,"mouseup",TinyMCE_advanced_resizeEventHandler);resizer.eventHandlers=true;}resizer.resizing=true;resizer.downX=e.screenX;resizer.downY=e.screenY;resizer.width=parseInt(resizeBox.style.width);resizer.height=parseInt(resizeBox.style.height);resizer.editorId=editor_id;resizer.resizeBox=resizeBox;resizer.horizontal=tinyMCE.getParam("theme_advanced_resize_horizontal",true);}else{resizer.resizing=false;resizeBox.style.display="none";editorArea.style.display=tinyMCE.isMSIE?"block":"table";tinyMCE.execCommand('mceResetDesignMode');}}function TinyMCE_advanced_initInstance(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_advanced_getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_advanced_getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_advanced_resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true));}}}function TinyMCE_advanced_setCookie(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie;}function TinyMCE_advanced_getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end));}function TinyMCE_advanced_resizeTo(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0;}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2;}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;w=w<1?30:w;h=h<1?30:h;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;iw=iw<1?30:iw;ih=ih<1?30:ih;if(tinyMCE.isGecko){iw-=2;ih-=2;}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName=="b"){nodeName="strong";}if(nodeName=="i"){nodeName="em";}if(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+st+" ";}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+face+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="size: "+size+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+color+" ";}if(getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" ";}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(getAttrib(path[i],'src')!=""){var src=tinyMCE.getAttrib(path[i],"mce_src");if(src=="")src=tinyMCE.getAttrib(path[i],"src");nodeData+="src: "+src+" ";}if(getAttrib(path[i],'href')!=""){var href=tinyMCE.getAttrib(path[i],"mce_href");if(href=="")href=tinyMCE.getAttrib(path[i],"href");nodeData+="href: "+href+" ";}if(nodeName=="img"&&tinyMCE.getAttrib(path[i],"class").indexOf('mceItemFlash')!=-1){nodeName="flash";nodeData="src: "+path[i].getAttribute('title');}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+anchor;nodeData="";}if(getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className;}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+=''+nodeName+'';if(i>0){html+=" » ";}}pathElm.innerHTML=''+tinyMCE.getLang('lang_theme_path')+": "+html+' ';}tinyMCE.switchClassSticky(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_link','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_unlink','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_outdent','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_image','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_hr','mceButtonNormal');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)tinyMCE.switchClassSticky(editor_id+'_anchor','mceButtonSelected');var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClassSticky(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal',false);}tinyMCE.switchClassSticky(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal',false);if(undo_levels!=-1){tinyMCE.switchClassSticky(editor_id+'_undo','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_redo','mceButtonDisabled',true);}if(tinyMCE.getParentElement(node,"li,blockquote")){tinyMCE.switchClassSticky(editor_id+'_outdent','mceButtonNormal',false);}if(undo_index!=-1&&(undo_index0)){tinyMCE.switchClassSticky(editor_id+'_redo','mceButtonNormal',false);}if(undo_index!=-1&&(undo_index>0&&undo_levels>0)){tinyMCE.switchClassSticky(editor_id+'_undo','mceButtonNormal',false);}var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_advanced_setupCSSClasses(editor_id);classNode=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i");else selectByValue(selectElm,"");}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=inst.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="");}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(selectElm,family,family!=""))selectByValue(selectElm,"");}else selectByValue(selectElm,"");}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=inst.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size);}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i0){selectElm.setAttribute('cssImported','true');}}}; \ No newline at end of file +tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_AdvancedTheme={_autoImportCSSClasses:true,_resizer:{},_buttons:[['bold','{$lang_bold_img}','lang_bold_desc','Bold'],['italic','{$lang_italic_img}','lang_italic_desc','Italic'],['underline','{$lang_underline_img}','lang_underline_desc','Underline'],['strikethrough','strikethrough.gif','lang_striketrough_desc','Strikethrough'],['justifyleft','justifyleft.gif','lang_justifyleft_desc','JustifyLeft'],['justifycenter','justifycenter.gif','lang_justifycenter_desc','JustifyCenter'],['justifyright','justifyright.gif','lang_justifyright_desc','JustifyRight'],['justifyfull','justifyfull.gif','lang_justifyfull_desc','JustifyFull'],['bullist','bullist.gif','lang_bullist_desc','InsertUnorderedList'],['numlist','numlist.gif','lang_numlist_desc','InsertOrderedList'],['outdent','outdent.gif','lang_outdent_desc','Outdent'],['indent','indent.gif','lang_indent_desc','Indent'],['cut','cut.gif','lang_cut_desc','Cut'],['copy','copy.gif','lang_copy_desc','Copy'],['paste','paste.gif','lang_paste_desc','Paste'],['undo','undo.gif','lang_undo_desc','Undo'],['redo','redo.gif','lang_redo_desc','Redo'],['link','link.gif','lang_link_desc','mceLink',true],['unlink','unlink.gif','lang_unlink_desc','unlink'],['image','image.gif','lang_image_desc','mceImage',true],['cleanup','cleanup.gif','lang_cleanup_desc','mceCleanup'],['help','help.gif','lang_help_desc','mceHelp'],['code','code.gif','lang_theme_code_desc','mceCodeEditor'],['hr','hr.gif','lang_theme_hr_desc','inserthorizontalrule'],['removeformat','removeformat.gif','lang_theme_removeformat_desc','removeformat'],['sub','sub.gif','lang_theme_sub_desc','subscript'],['sup','sup.gif','lang_theme_sup_desc','superscript'],['forecolor','forecolor.gif','lang_theme_forecolor_desc','mceForeColor',true],['backcolor','backcolor.gif','lang_theme_backcolor_desc','mceBackColor',true],['charmap','charmap.gif','lang_theme_charmap_desc','mceCharMap'],['visualaid','visualaid.gif','lang_theme_visualaid_desc','mceToggleVisualAid'],['anchor','anchor.gif','lang_theme_anchor_desc','mceInsertAnchor'],['newdocument','newdocument.gif','lang_newdocument_desc','mceNewDocument']],_buttonMap:'anchor,backcolor,bold,bullist,charmap,cleanup,code,copy,cut,forecolor,help,hr,image,indent,italic,justifycenter,justifyfull,justifyleft,justifyright,link,newdocument,numlist,outdent,paste,redo,removeformat,strikethrough,sub,sup,underline,undo,unlink,visualaid,advhr,ltr,rtl,emotions,flash,fullpage,fullscreen,iespell,insertdate,inserttime,pastetext,pasteword,selectall,preview,print,save,replace,search,table,cell_props,delete_col,delete_row,col_after,col_before,row_after,row_before,merge_cells,row_props,split_cells',getControlHTML:function(button_name){var i,x;for(i=0;i4?but[4]:false),(but.length>5?but[5]:null));}switch(button_name){case"formatselect":var html='';return html;case"styleselect":return'';case"fontselect":var fontHTML='';return fontHTML;case"fontsizeselect":return'';case"|":case"separator":return'';case"spacer":return'';case"rowseparator":return'
      ';}return"";},execCommand:function(editor_id,element,command,user_interface,value){switch(command){case"mceLink":var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();var selectedText="";if(tinyMCE.isMSIE){var rng=doc.selection.createRange();selectedText=rng.text;}else selectedText=inst.getSel().toString();if(!tinyMCE.linkElement){if((tinyMCE.selectedElement.nodeName.toLowerCase()!="img")&&(selectedText.length<=0))return true;}var href="",target="",title="",onclick="",action="insert",style_class="";if(tinyMCE.selectedElement.nodeName.toLowerCase()=="a")tinyMCE.linkElement=tinyMCE.selectedElement;if(tinyMCE.linkElement!=null&&tinyMCE.getAttrib(tinyMCE.linkElement,'href')=="")tinyMCE.linkElement=null;if(tinyMCE.linkElement){href=tinyMCE.getAttrib(tinyMCE.linkElement,'href');target=tinyMCE.getAttrib(tinyMCE.linkElement,'target');title=tinyMCE.getAttrib(tinyMCE.linkElement,'title');onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');style_class=tinyMCE.getAttrib(tinyMCE.linkElement,'class');if(onclick=="")onclick=tinyMCE.getAttrib(tinyMCE.linkElement,'onclick');onclick=tinyMCE.cleanupEventStr(onclick);href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");mceRealHref=tinyMCE.getAttrib(tinyMCE.linkElement,'mce_href');if(mceRealHref!=""){href=mceRealHref;if(tinyMCE.getParam('convert_urls'))href=eval(tinyMCE.settings['urlconverter_callback']+"(href, tinyMCE.linkElement, true);");}action="update";}var template=new Array();template['file']='link.htm';template['width']=310;template['height']=200;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);if(inst.settings['insertlink_callback']){var returnVal=eval(inst.settings['insertlink_callback']+"(href, target, title, onclick, action, style_class);");if(returnVal&&returnVal['href'])TinyMCE_AdvancedTheme._insertLink(returnVal['href'],returnVal['target'],returnVal['title'],returnVal['onclick'],returnVal['style_class']);}else{tinyMCE.openWindow(template,{href:href,target:target,title:title,onclick:onclick,action:action,className:style_class,inline:"yes"});}return true;case"mceImage":var src="",alt="",border="",hspace="",vspace="",width="",height="",align="";var title="",onmouseover="",onmouseout="",action="insert";var img=tinyMCE.imgElement;var inst=tinyMCE.getInstanceById(editor_id);if(tinyMCE.selectedElement!=null&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){img=tinyMCE.selectedElement;tinyMCE.imgElement=img;}if(img){if(tinyMCE.getAttrib(img,'name').indexOf('mce_')==0)return true;src=tinyMCE.getAttrib(img,'src');alt=tinyMCE.getAttrib(img,'alt');if(alt=="")alt=tinyMCE.getAttrib(img,'title');if(tinyMCE.isGecko){var w=img.style.width;if(w!=null&&w!="")img.setAttribute("width",w);var h=img.style.height;if(h!=null&&h!="")img.setAttribute("height",h);}border=tinyMCE.getAttrib(img,'border');hspace=tinyMCE.getAttrib(img,'hspace');vspace=tinyMCE.getAttrib(img,'vspace');width=tinyMCE.getAttrib(img,'width');height=tinyMCE.getAttrib(img,'height');align=tinyMCE.getAttrib(img,'align');onmouseover=tinyMCE.getAttrib(img,'onmouseover');onmouseout=tinyMCE.getAttrib(img,'onmouseout');title=tinyMCE.getAttrib(img,'title');if(tinyMCE.isMSIE){width=img.attributes['width'].specified?width:"";height=img.attributes['height'].specified?height:"";}src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");mceRealSrc=tinyMCE.getAttrib(img,'mce_src');if(mceRealSrc!=""){src=mceRealSrc;if(tinyMCE.getParam('convert_urls'))src=eval(tinyMCE.settings['urlconverter_callback']+"(src, img, true);");}action="update";}var template=new Array();template['file']='image.htm?src={$src}';template['width']=355;template['height']=265+(tinyMCE.isMSIE?25:0);template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);if(inst.settings['insertimage_callback']){var returnVal=eval(inst.settings['insertimage_callback']+"(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");if(returnVal&&returnVal['src'])TinyMCE_AdvancedTheme._insertImage(returnVal['src'],returnVal['alt'],returnVal['border'],returnVal['hspace'],returnVal['vspace'],returnVal['width'],returnVal['height'],returnVal['align'],returnVal['title'],returnVal['onmouseover'],returnVal['onmouseout']);}else tinyMCE.openWindow(template,{src:src,alt:alt,border:border,hspace:hspace,vspace:vspace,width:width,height:height,align:align,title:title,onmouseover:onmouseover,onmouseout:onmouseout,action:action,inline:"yes"});return true;case"mceForeColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=tinyMCE.getAttrib(elm,"color");if(inputColor=='')inputColor=elm.style.color;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"forecolor",input_color:inputColor});return true;case"mceBackColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=elm.style.backgroundColor;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;template['width']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"HiliteColor",input_color:inputColor});return true;case"mceColorPicker":if(user_interface){var template=new Array();var inputColor=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=220;template['height']=190;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:inputColor});}else{var savedVal=tinyMCE.lastColorPickerValue;var elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;if(elm.onchange!=null&&elm.onchange!='')eval('elm.onchange();');}return true;case"mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",720));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",580));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case"mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case"mceNewDocument":if(confirm(tinyMCE.getLang('lang_newdocument')))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,' ');return true;}return false;},getEditorTemplate:function(settings,editorId){function removeFromArray(in_array,remove_array){var outArray=new Array();for(var i=0;i 

      ';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i'+key+'';}TinyMCE_AdvancedTheme._autoImportCSSClasses=false;}switch(layoutManager){case"SimpleLayout":var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var toolbarAlign=tinyMCE.getParam("theme_advanced_toolbar_align","center");var pathLocation=tinyMCE.getParam("theme_advanced_path_location","none");var statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};toolbarHTML+='0){toolbarHTML+="
      ";deltaHeight-=23;}}toolbarHTML+='
      ';template['html']='';if(toolbarLocation=="top"){template['html']+='';}if(statusbarLocation=="top"){template['html']+='';deltaHeight-=23;}template['html']+='';if(toolbarLocation=="bottom"){template['html']+='';}if(toolbarLocation=="external"){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.applyTemplate(toolbarHTML,{editor_id:editorId});elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='
      '+toolbarHTML+'
      '+statusbarHTML+'
      '+toolbarHTML+'
      '+toolbarHTML+'
      ';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null;}if(statusbarLocation=="bottom"){template['html']+=''+statusbarHTML+'';deltaHeight-=23;}template['html']+='';break;case"RowLayout":template['html']='';var containers=tinyMCE.getParam("theme_advanced_containers","",true,",");var defaultContainerCSS=tinyMCE.getParam("theme_advanced_containers_default_class","container");var defaultContainerAlign=tinyMCE.getParam("theme_advanced_containers_default_align","center");for(var i=0;i';else if(containers[i]=="mceElementpath"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom";}else if(i==0){pathClass="mceStatusbar";}else{deltaHeight-=2;}template['html']+='';deltaHeight-=22;}else{var curContainer=tinyMCE.getParam("theme_advanced_container_"+containers[i],"",true,',');var curContainerHTML="";var curAlign=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align",defaultContainerAlign);var curCSS=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class",defaultContainerCSS);for(var j=0;j0){curContainerHTML+="
      ";deltaHeight-=23;}template['html']+='
      ';}}template['html']+='
      '+statusbarHTML+'
      '+curContainerHTML+'
      ';break;case"CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);");}break;}if(resizing)template['html']+='';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=deltaHeight;return template;},initInstance:function(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_AdvancedTheme._getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_AdvancedTheme._resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true));}}inst.addShortcut('ctrl','k','lang_link_desc','mceLink');},handleNodeChange:function(editor_id,node,undo_index,undo_levels,visual_aid,any_selection,setup_content){function selectByValue(select_elm,value,first_index){first_index=typeof(first_index)=="undefined"?false:true;if(select_elm){for(var i=0;i=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName=="b"){nodeName="strong";}if(nodeName=="i"){nodeName="em";}if(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+st+" ";}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+face+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="size: "+size+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+color+" ";}if(getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" ";}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(getAttrib(path[i],'src')!=""){var src=tinyMCE.getAttrib(path[i],"mce_src");if(src=="")src=tinyMCE.getAttrib(path[i],"src");nodeData+="src: "+src+" ";}if(getAttrib(path[i],'href')!=""){var href=tinyMCE.getAttrib(path[i],"mce_href");if(href=="")href=tinyMCE.getAttrib(path[i],"href");nodeData+="href: "+href+" ";}if(nodeName=="img"&&tinyMCE.getAttrib(path[i],"class").indexOf('mceItemFlash')!=-1){nodeName="flash";nodeData="src: "+path[i].getAttribute('title');}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+anchor;nodeData="";}if(getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className;}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+=''+nodeName+'';if(i>0){html+=" » ";}}pathElm.innerHTML=''+tinyMCE.getLang('lang_theme_path')+": "+html+' ';}tinyMCE.switchClass(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClass(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClass(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClass(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClass(editor_id+'_link','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_unlink','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_outdent','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_image','mceButtonNormal');tinyMCE.switchClass(editor_id+'_hr','mceButtonNormal');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)tinyMCE.switchClass(editor_id+'_anchor','mceButtonSelected');var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClass(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal');tinyMCE.switchClass(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal');}tinyMCE.switchClass(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal');if(undo_levels!=-1){tinyMCE.switchClass(editor_id+'_undo','mceButtonDisabled');tinyMCE.switchClass(editor_id+'_redo','mceButtonDisabled');}if(tinyMCE.getParentElement(node,"li,blockquote"))tinyMCE.switchClass(editor_id+'_outdent','mceButtonNormal');if(undo_index!=-1&&(undo_index0))tinyMCE.switchClass(editor_id+'_redo','mceButtonNormal');if(undo_index!=-1&&(undo_index>0&&undo_levels>0))tinyMCE.switchClass(editor_id+'_undo','mceButtonNormal');var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_AdvancedTheme._setupCSSClasses(editor_id);classNode=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i");else selectByValue(selectElm,"");}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=inst.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="");}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(selectElm,family,family!=""))selectByValue(selectElm,"");}else selectByValue(selectElm,"");}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=inst.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size);}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i0)selectElm.setAttribute('cssImported','true');}},_setCookie:function(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie;},_getCookie:function(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end));},_resizeTo:function(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0;}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2;}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;w=w<1?30:w;h=h<1?30:h;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;iw=iw<1?30:iw;ih=ih<1?30:ih;if(tinyMCE.isGecko){iw-=2;ih-=2;}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth';tinyMCE.execCommand("mceInsertContent",false,html);}else{if(!tinyMCE.imgElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari)tinyMCE.execCommand("mceInsertContent",false,'');else tinyMCE.selectedInstance.contentDocument.execCommand("insertimage",false,tinyMCE.uniqueURL);tinyMCE.imgElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"img","src",tinyMCE.uniqueURL);}}if(tinyMCE.imgElement){var needsRepaint=false;var msrc=src;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, tinyMCE.imgElement);");if(tinyMCE.getParam('convert_urls'))msrc=src;if(onmouseover&&onmouseover!="")onmouseover="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseover, tinyMCE.imgElement);")+"';";if(onmouseout&&onmouseout!="")onmouseout="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseout, tinyMCE.imgElement);")+"';";if(typeof(title)=="undefined")title=alt;if(width!=tinyMCE.imgElement.getAttribute("width")||height!=tinyMCE.imgElement.getAttribute("height")||align!=tinyMCE.imgElement.getAttribute("align"))needsRepaint=true;tinyMCE.setAttrib(tinyMCE.imgElement,'src',src);tinyMCE.setAttrib(tinyMCE.imgElement,'mce_src',msrc);tinyMCE.setAttrib(tinyMCE.imgElement,'alt',alt);tinyMCE.setAttrib(tinyMCE.imgElement,'title',title);tinyMCE.setAttrib(tinyMCE.imgElement,'align',align);tinyMCE.setAttrib(tinyMCE.imgElement,'border',border,true);tinyMCE.setAttrib(tinyMCE.imgElement,'hspace',hspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'vspace',vspace,true);tinyMCE.setAttrib(tinyMCE.imgElement,'width',width,true);tinyMCE.setAttrib(tinyMCE.imgElement,'height',height,true);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseover',onmouseover);tinyMCE.setAttrib(tinyMCE.imgElement,'onmouseout',onmouseout);if(width&&width!="")tinyMCE.imgElement.style.pixelWidth=width;if(height&&height!="")tinyMCE.imgElement.style.pixelHeight=height;if(needsRepaint)tinyMCE.selectedInstance.repaint();}tinyMCE.execCommand('mceEndUndoLevel');},_insertLink:function(href,target,title,onclick,style_class){tinyMCE.execCommand('mceBeginUndoLevel');if(tinyMCE.selectedInstance&&tinyMCE.selectedElement&&tinyMCE.selectedElement.nodeName.toLowerCase()=="img"){var doc=tinyMCE.selectedInstance.getDoc();var linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");var newLink=false;if(!linkElement){linkElement=doc.createElement("a");newLink=true;}var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(linkElement,'href',thref);tinyMCE.setAttrib(linkElement,'mce_href',mhref);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',title);tinyMCE.setAttrib(linkElement,'onclick',onclick);tinyMCE.setAttrib(linkElement,'class',style_class);if(newLink){linkElement.appendChild(tinyMCE.selectedElement.cloneNode(true));tinyMCE.selectedElement.parentNode.replaceChild(linkElement,tinyMCE.selectedElement);}return;}if(!tinyMCE.linkElement&&tinyMCE.selectedInstance){if(tinyMCE.isSafari){tinyMCE.execCommand("mceInsertContent",false,''+tinyMCE.selectedInstance.selection.getSelectedHTML()+'');}else tinyMCE.selectedInstance.contentDocument.execCommand("createlink",false,tinyMCE.uniqueURL);tinyMCE.linkElement=tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);var elementArray=tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);for(var i=0;i 4 ? but[4] : false) + (but.length > 5 ? ',\'' + but[5] + '\'' : '') + ')'; - return ''; + if (but[0] == button_name) + return tinyMCE.getButtonHTML(but[0], but[2], '{$themeurl}/images/' + but[1], but[3], (but.length > 4 ? but[4] : false), (but.length > 5 ? but[5] : null)); + } + + // Custom controlls other than buttons + switch (button_name) { + case "formatselect": + var html = ''; + + return html; + + case "styleselect": + return ''; + + case "fontselect": + var fontHTML = ''; + return fontHTML; + + case "fontsizeselect": + return ''; + + case "|": + case "separator": + return ''; + + case "spacer": + return ''; + + case "rowseparator": + return '
      '; } - } - // Custom controlls other than buttons - switch (button_name) - { - case "formatselect": - var html = ''; - //formatselect - return html; - - case "styleselect": - //styleselect - return ''; - - case "fontselect": - var fontHTML = ''; - return fontHTML; + if (img) { + // Is it a internal MCE visual aid image, then skip this one. + if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0) + return true; + + src = tinyMCE.getAttrib(img, 'src'); + alt = tinyMCE.getAttrib(img, 'alt'); + + // Try polling out the title + if (alt == "") + alt = tinyMCE.getAttrib(img, 'title'); + + // Fix width/height attributes if the styles is specified + if (tinyMCE.isGecko) { + var w = img.style.width; + if (w != null && w != "") + img.setAttribute("width", w); + + var h = img.style.height; + if (h != null && h != "") + img.setAttribute("height", h); + } - case "fontsizeselect": - //fontsizeselect - return ''; - - case "|": - case "separator": - return ''; + border = tinyMCE.getAttrib(img, 'border'); + hspace = tinyMCE.getAttrib(img, 'hspace'); + vspace = tinyMCE.getAttrib(img, 'vspace'); + width = tinyMCE.getAttrib(img, 'width'); + height = tinyMCE.getAttrib(img, 'height'); + align = tinyMCE.getAttrib(img, 'align'); + onmouseover = tinyMCE.getAttrib(img, 'onmouseover'); + onmouseout = tinyMCE.getAttrib(img, 'onmouseout'); + title = tinyMCE.getAttrib(img, 'title'); + + // Is realy specified? + if (tinyMCE.isMSIE) { + width = img.attributes['width'].specified ? width : ""; + height = img.attributes['height'].specified ? height : ""; + } - case "spacer": - return ''; + //onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover)); + //onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout)); - case "rowseparator": - return '
      '; - } + src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);"); - return ""; -} + // Use mce_src if defined + mceRealSrc = tinyMCE.getAttrib(img, 'mce_src'); + if (mceRealSrc != "") { + src = mceRealSrc; -/** - * Theme specific exec command handeling. - */ -function TinyMCE_advanced_execCommand(editor_id, element, command, user_interface, value) -{ - switch (command) - { - case "mceForeColor": - var template = new Array(); - var elm = tinyMCE.selectedInstance.getFocusElement(); - var inputColor = tinyMCE.getAttrib(elm, "color"); - - if (inputColor == '') - inputColor = elm.style.color; - - if (!inputColor) - inputColor = "#000000"; - - template['file'] = 'color_picker.htm'; - template['width'] = 220; - template['height'] = 190; - - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "forecolor", input_color : inputColor}); - return true; - - case "mceBackColor": - var template = new Array(); - var elm = tinyMCE.selectedInstance.getFocusElement(); - var inputColor = elm.style.backgroundColor; - - if (!inputColor) - inputColor = "#000000"; - - template['file'] = 'color_picker.htm'; - template['width'] = 220; - template['height'] = 190; - - template['width'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height', 0); - - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "HiliteColor", input_color : inputColor}); - //mceBackColor - return true; + if (tinyMCE.getParam('convert_urls')) + src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);"); + } + + //if (onmouseover != "") + // onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);"); + + //if (onmouseout != "") + // onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);"); + + action = "update"; + } + + var template = new Array(); + + template['file'] = 'image.htm?src={$src}'; + template['width'] = 355; + template['height'] = 265 + (tinyMCE.isMSIE ? 25 : 0); + + // Language specific width and height addons + template['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0); + + if (inst.settings['insertimage_callback']) { + var returnVal = eval(inst.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);"); + if (returnVal && returnVal['src']) + TinyMCE_AdvancedTheme._insertImage(returnVal['src'], returnVal['alt'], returnVal['border'], returnVal['hspace'], returnVal['vspace'], returnVal['width'], returnVal['height'], returnVal['align'], returnVal['title'], returnVal['onmouseover'], returnVal['onmouseout']); + } else + tinyMCE.openWindow(template, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"}); + + return true; - case "mceColorPicker": - if (user_interface) { + case "mceForeColor": var template = new Array(); - var inputColor = value['document'].getElementById(value['element_id']).value; + var elm = tinyMCE.selectedInstance.getFocusElement(); + var inputColor = tinyMCE.getAttrib(elm, "color"); + + if (inputColor == '') + inputColor = elm.style.color; + + if (!inputColor) + inputColor = "#000000"; template['file'] = 'color_picker.htm'; template['width'] = 220; template['height'] = 190; - template['close_previous'] = "no"; - template['width'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height', 0); + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "forecolor", input_color : inputColor}); + return true; - if (typeof(value['store_selection']) == "undefined") - value['store_selection'] = true; + case "mceBackColor": + var template = new Array(); + var elm = tinyMCE.selectedInstance.getFocusElement(); + var inputColor = elm.style.backgroundColor; - tinyMCE.lastColorPickerValue = value; - tinyMCE.openWindow(template, {editor_id : editor_id, mce_store_selection : value['store_selection'], inline : "yes", command : "mceColorPicker", input_color : inputColor}); - } else { - var savedVal = tinyMCE.lastColorPickerValue; - var elm = savedVal['document'].getElementById(savedVal['element_id']); - elm.value = value; - eval('elm.onchange();'); - } - return true; + if (!inputColor) + inputColor = "#000000"; - case "mceCodeEditor": - var template = new Array(); + template['file'] = 'color_picker.htm'; + template['width'] = 220; + template['height'] = 190; - template['file'] = 'source_editor.htm'; - template['width'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_width", 500)); - template['height'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_height", 400)); + template['width'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height', 0); - tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no", inline : "yes"}); - //mceCodeEditor - return true; + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes", command : "HiliteColor", input_color : inputColor}); + //mceBackColor + return true; - case "mceCharMap": - var template = new Array(); + case "mceColorPicker": + if (user_interface) { + var template = new Array(); + var inputColor = value['document'].getElementById(value['element_id']).value; + + template['file'] = 'color_picker.htm'; + template['width'] = 220; + template['height'] = 190; + template['close_previous'] = "no"; + + template['width'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height', 0); + + if (typeof(value['store_selection']) == "undefined") + value['store_selection'] = true; + + tinyMCE.lastColorPickerValue = value; + tinyMCE.openWindow(template, {editor_id : editor_id, mce_store_selection : value['store_selection'], inline : "yes", command : "mceColorPicker", input_color : inputColor}); + } else { + var savedVal = tinyMCE.lastColorPickerValue; + var elm = savedVal['document'].getElementById(savedVal['element_id']); + elm.value = value; - template['file'] = 'charmap.htm'; - template['width'] = 550 + (tinyMCE.isOpera ? 40 : 0); - template['height'] = 250; + if (elm.onchange != null && elm.onchange != '') + eval('elm.onchange();'); + } + return true; - template['width'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_height', 0); + case "mceCodeEditor": + var template = new Array(); - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); - //mceCharMap - return true; + template['file'] = 'source_editor.htm'; + template['width'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_width", 720)); + template['height'] = parseInt(tinyMCE.getParam("theme_advanced_source_editor_height", 580)); - case "mceInsertAnchor": - var template = new Array(); + tinyMCE.openWindow(template, {editor_id : editor_id, resizable : "yes", scrollbars : "no", inline : "yes"}); + return true; - template['file'] = 'anchor.htm'; - template['width'] = 320; - template['height'] = 90 + (tinyMCE.isNS7 ? 30 : 0); + case "mceCharMap": + var template = new Array(); - template['width'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_theme_advanced_anchor_delta_height', 0); + template['file'] = 'charmap.htm'; + template['width'] = 550 + (tinyMCE.isOpera ? 40 : 0); + template['height'] = 250; - tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); - return true; + template['width'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_width', 0); + template['height'] += tinyMCE.getLang('lang_theme_advanced_charmap_delta_height', 0); - case "mceNewDocument": - if (confirm(tinyMCE.getLang('lang_newdocument'))) - tinyMCE.execInstanceCommand(editor_id, 'mceSetContent', false, ''); + tinyMCE.openWindow(template, {editor_id : editor_id, inline : "yes"}); + return true; - return true; - } + case "mceInsertAnchor": + var template = new Array(); - // Default behavior - return false; -} + template['file'] = 'anchor.htm'; + template['width'] = 320; + template['height'] = 90 + (tinyMCE.isNS7 ? 30 : 0); -/** - * Editor instance template function. - */ -function TinyMCE_advanced_getEditorTemplate(settings, editorId) -{ - function removeFromArray(in_array, remove_array) - { - var outArray = new Array(); - - for (var i=0; i 

      '; + var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout"); + + // Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY! + var styleSelectHTML = ''; + if (settings['theme_advanced_styles']) { + var stylesAr = settings['theme_advanced_styles'].split(';'); + + for (var i=0; i 

      '; - var layoutManager = tinyMCE.getParam("theme_advanced_layout_manager", "SimpleLayout"); - - // Setup style select options -- MOVED UP FOR EXTERNAL TOOLBAR COMPATABILITY! - var styleSelectHTML = ''; - if (settings['theme_advanced_styles']) { - var stylesAr = settings['theme_advanced_styles'].split(';'); - - for (var i=0; i' + key + ''; + } - styleSelectHTML += ''; + TinyMCE_AdvancedTheme._autoImportCSSClasses = false; } - TinyMCE_advanced_autoImportCSSClasses = false; - } + switch(layoutManager) { + case "SimpleLayout" : //the default TinyMCE Layout (for backwards compatibility)... + var toolbarHTML = ""; + var toolbarLocation = tinyMCE.getParam("theme_advanced_toolbar_location", "bottom"); + var toolbarAlign = tinyMCE.getParam("theme_advanced_toolbar_align", "center"); + var pathLocation = tinyMCE.getParam("theme_advanced_path_location", "none"); // Compatiblity + var statusbarLocation = tinyMCE.getParam("theme_advanced_statusbar_location", pathLocation); + var defVals = { + theme_advanced_buttons1 : "bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect", + theme_advanced_buttons2 : "bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code", + theme_advanced_buttons3 : "hr,removeformat,visualaid,separator,sub,sup,separator,charmap" + }; + + // Add accessibility control + toolbarHTML += ''; - - // Render rows - for (var i=1; i<100; i++) { - var def = defVals["theme_advanced_buttons" + i]; + var buttons = tinyMCE.getParam("theme_advanced_buttons" + i, def == null ? '' : def, true, ','); + if (buttons.length == 0) + break; - var buttons = tinyMCE.getParam("theme_advanced_buttons" + i, def == null ? '' : def, true, ','); - if (buttons.length == 0) - break; + buttons = removeFromArray(buttons, tinyMCE.getParam("theme_advanced_disable", "", true, ',')); + buttons = addToArray(buttons, tinyMCE.getParam("theme_advanced_buttons" + i + "_add", "", true, ',')); + buttons = addToArray(tinyMCE.getParam("theme_advanced_buttons" + i + "_add_before", "", true, ','), buttons); + + for (var b=0; b 0) { + toolbarHTML += "
      "; + deltaHeight -= 23; + } + } + + // Add accessibility control + toolbarHTML += ''; + + // Setup template html + template['html'] = ''; - for (var b=0; b' + toolbarHTML + ''; + } - if (buttons.length > 0) { - toolbarHTML += "
      "; + if (statusbarLocation == "top") { + template['html'] += '
      '; deltaHeight -= 23; } - } - // Add accessibility control - toolbarHTML += ''; + template['html'] += ''; - // Setup template html - template['html'] = '
      ' + statusbarHTML + '
      '; + if (toolbarLocation == "bottom") { + template['html'] += ''; + } - if (toolbarLocation == "top") - { - template['html'] += ''; - } + // External toolbar changes + if (toolbarLocation == "external") { + var bod = document.body; + var elm = document.createElement ("div"); + + toolbarHTML = tinyMCE.replaceVar(toolbarHTML, 'style_select_options', styleSelectHTML); + toolbarHTML = tinyMCE.applyTemplate(toolbarHTML, {editor_id : editorId}); + + elm.className = "mceToolbarExternal"; + elm.id = editorId+"_toolbar"; + elm.innerHTML = '
      ' + toolbarHTML + '
      ' + toolbarHTML + '
      '+toolbarHTML+'
      '; + bod.appendChild (elm); + // bod.style.marginTop = elm.offsetHeight + "px"; + + deltaHeight = 0; + tinyMCE.getInstanceById(editorId).toolbarElement = elm; + + //template['html'] = '
      '+toolbarHTML+'
      ' + template["html"]; + } else { + tinyMCE.getInstanceById(editorId).toolbarElement = null; + } - if (statusbarLocation == "top") - { - template['html'] += '' + statusbarHTML + ''; - deltaHeight -= 23; - } + if (statusbarLocation == "bottom") { + template['html'] += '' + statusbarHTML + ''; + deltaHeight -= 23; + } - template['html'] += ''; + template['html'] += ''; + //"SimpleLayout" + break; - if (toolbarLocation == "bottom") - { - template['html'] += '' + toolbarHTML + ''; - } + case "RowLayout" : //Container Layout - containers defined in "theme_advanced_containers" are rendered from top to bottom. + template['html'] = ''; - // External toolbar changes - if (toolbarLocation == "external") - { - var bod = document.body; - var elm = document.createElement ("div"); - - toolbarHTML = tinyMCE.replaceVars(toolbarHTML, tinyMCE.settings); - toolbarHTML = tinyMCE.replaceVars(toolbarHTML, tinyMCELang); - toolbarHTML = tinyMCE.replaceVar(toolbarHTML, 'style_select_options', styleSelectHTML); - toolbarHTML = tinyMCE.replaceVar(toolbarHTML, "editor_id", editorId); - toolbarHTML = tinyMCE.applyTemplate(toolbarHTML); - - elm.className = "mceToolbarExternal"; - elm.id = editorId+"_toolbar"; - elm.innerHTML = '
      '+toolbarHTML+'
      '; - bod.appendChild (elm); - // bod.style.marginTop = elm.offsetHeight + "px"; + var containers = tinyMCE.getParam("theme_advanced_containers", "", true, ","); + var defaultContainerCSS = tinyMCE.getParam("theme_advanced_containers_default_class", "container"); + var defaultContainerAlign = tinyMCE.getParam("theme_advanced_containers_default_align", "center"); - deltaHeight = 0; - tinyMCE.getInstanceById(editorId).toolbarElement = elm; + //Render Containers: + for (var i = 0; i < containers.length; i++) + { + if (containers[i] == "mceEditor") //Exceptions for mceEditor and ... + template['html'] += ''; + else if (containers[i] == "mceElementpath" || containers[i] == "mceStatusbar") // ... mceElementpath: + { + var pathClass = "mceStatusbar"; - //template['html'] = '
      '+toolbarHTML+'
      ' + template["html"]; - } - else - { - tinyMCE.getInstanceById(editorId).toolbarElement = null; - } + if (i == containers.length-1) + { + pathClass = "mceStatusbarBottom"; + } + else if (i == 0) + { + pathClass = "mceStatusbar"; + } + else + { + deltaHeight-=2; + } - if (statusbarLocation == "bottom") - { - template['html'] += '' + statusbarHTML + ''; - deltaHeight -= 23; - } + template['html'] += '' + statusbarHTML + ''; + deltaHeight -= 22; + } else { // Render normal Container + var curContainer = tinyMCE.getParam("theme_advanced_container_"+containers[i], "", true, ','); + var curContainerHTML = ""; + var curAlign = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align", defaultContainerAlign); + var curCSS = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class", defaultContainerCSS); - template['html'] += ''; - //"SimpleLayout" - break; - - case "RowLayout" : //Container Layout - containers defined in "theme_advanced_containers" are rendered from top to bottom. - template['html'] = ''; - - var containers = tinyMCE.getParam("theme_advanced_containers", "", true, ","); - var defaultContainerCSS = tinyMCE.getParam("theme_advanced_containers_default_class", "container"); - var defaultContainerAlign = tinyMCE.getParam("theme_advanced_containers_default_align", "center"); - - //Render Containers: - for (var i = 0; i < containers.length; i++) - { - if (containers[i] == "mceEditor") //Exceptions for mceEditor and ... - { - template['html'] += ''; - } - else if (containers[i] == "mceElementpath" || containers[i] == "mceStatusbar") // ... mceElementpath: - { - var pathClass = "mceStatusbar"; + for (var j=0; j 0) { + curContainerHTML += "
      "; + deltaHeight -= 23; + } - template['html'] += '
      '; - deltaHeight -= 22; + template['html'] += ''; + } } - else //Render normal Container: - { - var curContainer = tinyMCE.getParam("theme_advanced_container_"+containers[i], "", true, ','); - var curContainerHTML = ""; - var curAlign = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align", defaultContainerAlign); - var curCSS = tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class", defaultContainerCSS); - for (var j=0; j 0) - { - curContainerHTML += "
      "; - deltaHeight -= 23; - } + case "CustomLayout" : //User defined layout callback... + var customLayout = tinyMCE.getParam("theme_advanced_custom_layout",""); - template['html'] += '
      '; + if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined") { + template = eval(customLayout + "(template);"); } - } + break; + } - template['html'] += '
      \ - \ -
      ' + statusbarHTML + '
      ' + curContainerHTML + '
      ' + curContainerHTML + '
      '; - //RowLayout - break; - - case "BorderLayout" : //will be like java.awt.BorderLayout of SUN Java... - // Not implemented yet... - break; + if (resizing) + template['html'] += ''; - case "CustomLayout" : //User defined layout callback... - var customLayout = tinyMCE.getParam("theme_advanced_custom_layout",""); - - if (customLayout != "" && eval("typeof(" + customLayout + ")") != "undefined") - { - template = eval(customLayout + "(template);"); + template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML); + template['delta_width'] = 0; + template['delta_height'] = deltaHeight; + + return template; + }, + + initInstance : function(inst) { + if (tinyMCE.getParam("theme_advanced_resizing", false)) { + if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) { + var w = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_width"); + var h = TinyMCE_AdvancedTheme._getCookie("TinyMCE_" + inst.editorId + "_height"); + + TinyMCE_AdvancedTheme._resizeTo(inst, w, h, tinyMCE.getParam("theme_advanced_resize_horizontal", true)); } - break; - - default: - alert('UNDEFINED LAYOUT MANAGER! PLEASE CHECK YOUR TINYMCE CONFIG!'); - //CustomLayout - break; - } + } - if (resizing) - template['html'] += ''; + inst.addShortcut('ctrl', 'k', 'lang_link_desc', 'mceLink'); + }, - template['html'] = tinyMCE.replaceVar(template['html'], 'style_select_options', styleSelectHTML); - template['delta_width'] = 0; - template['delta_height'] = deltaHeight; + /** + * Node change handler. + */ + handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection, setup_content) { + function selectByValue(select_elm, value, first_index) { + first_index = typeof(first_index) == "undefined" ? false : true; + + if (select_elm) { + for (var i=0; i=0; i--) { + var nodeName = path[i].nodeName.toLowerCase(); + var nodeData = ""; -function TinyMCE_advanced_initInstance(inst) { - if (tinyMCE.getParam("theme_advanced_resizing", false)) { - if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) { - var w = TinyMCE_advanced_getCookie("TinyMCE_" + inst.editorId + "_width"); - var h = TinyMCE_advanced_getCookie("TinyMCE_" + inst.editorId + "_height"); + if (nodeName == "b") { + nodeName = "strong"; + } - TinyMCE_advanced_resizeTo(inst, w, h, tinyMCE.getParam("theme_advanced_resize_horizontal", true)); - } - } -} + if (nodeName == "i") { + nodeName = "em"; + } -function TinyMCE_advanced_setCookie(name, value, expires, path, domain, secure) { - var curCookie = name + "=" + escape(value) + - ((expires) ? "; expires=" + expires.toGMTString() : "") + - ((path) ? "; path=" + escape(path) : "") + - ((domain) ? "; domain=" + domain : "") + - ((secure) ? "; secure" : ""); - - document.cookie = curCookie; -} - -function TinyMCE_advanced_getCookie(name) { - var dc = document.cookie; - var prefix = name + "="; - var begin = dc.indexOf("; " + prefix); - - if (begin == -1) { - begin = dc.indexOf(prefix); - - if (begin != 0) - return null; - } else - begin += 2; - - var end = document.cookie.indexOf(";", begin); - - if (end == -1) - end = dc.length; - - return unescape(dc.substring(begin + prefix.length, end)); -} - -function TinyMCE_advanced_resizeTo(inst, w, h, set_w) { - var editorContainer = document.getElementById(inst.editorId + '_parent'); - var tableElm = editorContainer.firstChild; - var iframe = inst.iframeElement; - - if (w == null || w == "null") { - set_w = false; - w = 0; - } + if (nodeName == "span") { + var cn = tinyMCE.getAttrib(path[i], "class"); + if (cn != "" && cn.indexOf('mceItem') == -1) + nodeData += "class: " + cn + " "; + + var st = tinyMCE.getAttrib(path[i], "style"); + if (st != "") { + st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st)); + nodeData += "style: " + st + " "; + } + } - if (h == null || h == "null") - return; + if (nodeName == "font") { + if (tinyMCE.getParam("convert_fonts_to_spans")) + nodeName = "span"; + + var face = tinyMCE.getAttrib(path[i], "face"); + if (face != "") + nodeData += "font: " + face + " "; + + var size = tinyMCE.getAttrib(path[i], "size"); + if (size != "") + nodeData += "size: " + size + " "; + + var color = tinyMCE.getAttrib(path[i], "color"); + if (color != "") + nodeData += "color: " + color + " "; + } - w = parseInt(w); - h = parseInt(h); + if (getAttrib(path[i], 'id') != "") { + nodeData += "id: " + path[i].getAttribute('id') + " "; + } - if (tinyMCE.isGecko) { - w += 2; - h += 2; - } + var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); + if (className != "" && className.indexOf('mceItem') == -1) + nodeData += "class: " + className + " "; - var dx = w - tableElm.clientWidth; - var dy = h - tableElm.clientHeight; + if (getAttrib(path[i], 'src') != "") { + var src = tinyMCE.getAttrib(path[i], "mce_src"); - w = w < 1 ? 30 : w; - h = h < 1 ? 30 : h; + if (src == "") + src = tinyMCE.getAttrib(path[i], "src"); - if (set_w) - tableElm.style.width = w + "px"; + nodeData += "src: " + src + " "; + } - tableElm.style.height = h + "px"; + if (getAttrib(path[i], 'href') != "") { + var href = tinyMCE.getAttrib(path[i], "mce_href"); - iw = iframe.clientWidth + dx; - ih = iframe.clientHeight + dy; + if (href == "") + href = tinyMCE.getAttrib(path[i], "href"); - iw = iw < 1 ? 30 : iw; - ih = ih < 1 ? 30 : ih; + nodeData += "href: " + href + " "; + } - if (tinyMCE.isGecko) { - iw -= 2; - ih -= 2; - } + if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) { + nodeName = "flash"; + nodeData = "src: " + path[i].getAttribute('title'); + } - if (set_w) - iframe.style.width = iw + "px"; + if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") { + nodeName = "a"; + nodeName += "#" + anchor; + nodeData = ""; + } - iframe.style.height = ih + "px"; + if (getAttrib(path[i], 'name').indexOf("mce_") != 0) { + var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); + if (className != "" && className.indexOf('mceItem') == -1) { + nodeName += "." + className; + } + } - // Is it to small, make it bigger again - if (set_w) { - var tableBodyElm = tableElm.firstChild; - var minIframeWidth = tableBodyElm.scrollWidth; - if (inst.iframeElement.clientWidth < minIframeWidth) { - dx = minIframeWidth - inst.iframeElement.clientWidth; + var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');'; + html += '' + nodeName + ''; - inst.iframeElement.style.width = (iw + dx) + "px"; - } - } -} + if (i > 0) { + html += " » "; + } + } -/** - * Handles resizing events. - */ -function TinyMCE_advanced_resizeEventHandler(e) { - var resizer = TinyMCE_advanced_resizer; + pathElm.innerHTML = '' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' '; + } - // Do nothing - if (!resizer.resizing) - return; + // Reset old states + tinyMCE.switchClass(editor_id + '_justifyleft', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_justifyright', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_justifycenter', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_justifyfull', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_sub', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_sup', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_link', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_unlink', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_image', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_hr', 'mceButtonNormal'); + + if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1) + tinyMCE.switchClass(editor_id + '_anchor', 'mceButtonSelected'); + + // Get link + var anchorLink = tinyMCE.getParentElement(node, "a", "href"); + + if (anchorLink || any_selection) { + tinyMCE.switchClass(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal'); + } - e = typeof(e) == "undefined" ? window.event : e; + // Handle visual aid + tinyMCE.switchClass(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal'); - var dx = e.screenX - resizer.downX; - var dy = e.screenY - resizer.downY; - var resizeBox = resizer.resizeBox; - var editorId = resizer.editorId; + if (undo_levels != -1) { + tinyMCE.switchClass(editor_id + '_undo', 'mceButtonDisabled'); + tinyMCE.switchClass(editor_id + '_redo', 'mceButtonDisabled'); + } - switch (e.type) { - case "mousemove": - var w, h; + // Within li, blockquote + if (tinyMCE.getParentElement(node, "li,blockquote")) + tinyMCE.switchClass(editor_id + '_outdent', 'mceButtonNormal'); + + // Has redo levels + if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0)) + tinyMCE.switchClass(editor_id + '_redo', 'mceButtonNormal'); + + // Has undo levels + if (undo_index != -1 && (undo_index > 0 && undo_levels > 0)) + tinyMCE.switchClass(editor_id + '_undo', 'mceButtonNormal'); - w = resizer.width + dx; - h = resizer.height + dy; + // Select class in select box + var selectElm = document.getElementById(editor_id + "_styleSelect"); + + if (selectElm) { + TinyMCE_AdvancedTheme._setupCSSClasses(editor_id); - w = w < 1 ? 1 : w; - h = h < 1 ? 1 : h; + classNode = node; + breakOut = false; + var index = 0; + + do { + if (classNode && classNode.className) { + for (var i=0; i"); + else + selectByValue(selectElm, ""); + } - // Expire in a month - if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) { - var expires = new Date(); - expires.setTime(expires.getTime() + 3600000 * 24 * 30); + // Select fontselect + var selectElm = document.getElementById(editor_id + "_fontNameSelect"); + if (selectElm) { + if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) { + var face = inst.queryCommandValue('FontName'); - // Set the cookies - TinyMCE_advanced_setCookie("TinyMCE_" + editorId + "_width", "" + (resizer.horizontal ? resizer.width + dx : ""), expires); - TinyMCE_advanced_setCookie("TinyMCE_" + editorId + "_height", "" + (resizer.height + dy), expires); - } - break; - } -} + face = face == null || face == "" ? "" : face; -/** - * Insert link template function. - */ -function TinyMCE_advanced_getInsertLinkTemplate() -{ - var template = new Array(); - - template['file'] = 'link.htm'; - template['width'] = 330; - template['height'] = 170 + (tinyMCE.isMSIE ? 25 : 0); - - // Language specific width and height addons - template['width'] += tinyMCE.getLang('lang_insert_link_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_insert_link_delta_height', 0); + selectByValue(selectElm, face, face != ""); + } else { + var elm = tinyMCE.getParentElement(node, "font", "face"); - return template; -}; + if (elm) { + var family = tinyMCE.getAttrib(elm, "face"); -/** - * Insert image template function. - */ -function TinyMCE_advanced_getInsertImageTemplate() { - var template = new Array(); + if (family == '') + family = '' + elm.style.fontFamily; - template['file'] = 'image.htm?src={$src}'; - template['width'] = 340; - template['height'] = 250 + (tinyMCE.isMSIE ? 25 : 0); - - // Language specific width and height addons - template['width'] += tinyMCE.getLang('lang_insert_image_delta_width', 0); - template['height'] += tinyMCE.getLang('lang_insert_image_delta_height', 0); + if (!selectByValue(selectElm, family, family != "")) + selectByValue(selectElm, ""); + } else + selectByValue(selectElm, ""); + } + } - return template; -}; + // Select fontsize + var selectElm = document.getElementById(editor_id + "_fontSizeSelect"); + if (selectElm) { + if (!tinyMCE.isSafari && !tinyMCE.isOpera) { + var size = inst.queryCommandValue('FontSize'); + selectByValue(selectElm, size == null || size == "" ? "0" : size); + } else { + var elm = tinyMCE.getParentElement(node, "font", "size"); + if (elm) { + var size = tinyMCE.getAttrib(elm, "size"); + + if (size == '') { + var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px'); + + size = '' + elm.style.fontSize; + + for (var i=0; i=0; i--) { - var nodeName = path[i].nodeName.toLowerCase(); - var nodeData = ""; + // Handle elements + do { + switch (node.nodeName) { + case "UL": + tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected'); + break; - if (nodeName == "b") { - nodeName = "strong"; - } + case "OL": + tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected'); + break; - if (nodeName == "i") { - nodeName = "em"; - } + case "HR": + tinyMCE.switchClass(editor_id + '_hr', 'mceButtonSelected'); + break; - if (nodeName == "span") { - var cn = tinyMCE.getAttrib(path[i], "class"); - if (cn != "" && cn.indexOf('mceItem') == -1) - nodeData += "class: " + cn + " "; - - var st = tinyMCE.getAttrib(path[i], "style"); - if (st != "") { - st = tinyMCE.serializeStyle(tinyMCE.parseStyle(st)); - nodeData += "style: " + st + " "; + case "IMG": + if (getAttrib(node, 'name').indexOf('mce_') != 0) { + tinyMCE.switchClass(editor_id + '_image', 'mceButtonSelected'); } + break; } + } while ((node = node.parentNode) != null); + }, - if (nodeName == "font") { - if (tinyMCE.getParam("convert_fonts_to_spans")) - nodeName = "span"; - - var face = tinyMCE.getAttrib(path[i], "face"); - if (face != "") - nodeData += "font: " + face + " "; - - var size = tinyMCE.getAttrib(path[i], "size"); - if (size != "") - nodeData += "size: " + size + " "; - - var color = tinyMCE.getAttrib(path[i], "color"); - if (color != "") - nodeData += "color: " + color + " "; - } + // Private theme internal functions - if (getAttrib(path[i], 'id') != "") { - nodeData += "id: " + path[i].getAttribute('id') + " "; - } + // This function auto imports CSS classes into the class selection droplist + _setupCSSClasses : function(editor_id) { + var i, selectElm; - var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); - if (className != "" && className.indexOf('mceItem') == -1) - nodeData += "class: " + className + " "; + if (!TinyMCE_AdvancedTheme._autoImportCSSClasses) + return; - if (getAttrib(path[i], 'src') != "") { - var src = tinyMCE.getAttrib(path[i], "mce_src"); + selectElm = document.getElementById(editor_id + '_styleSelect'); - if (src == "") - src = tinyMCE.getAttrib(path[i], "src"); - - nodeData += "src: " + src + " "; + if (selectElm && selectElm.getAttribute('cssImported') != 'true') { + var csses = tinyMCE.getCSSClasses(editor_id); + if (csses && selectElm) { + for (i=0; i 0) + selectElm.setAttribute('cssImported', 'true'); + } + }, - if (href == "") - href = tinyMCE.getAttrib(path[i], "href"); + _setCookie : function(name, value, expires, path, domain, secure) { + var curCookie = name + "=" + escape(value) + + ((expires) ? "; expires=" + expires.toGMTString() : "") + + ((path) ? "; path=" + escape(path) : "") + + ((domain) ? "; domain=" + domain : "") + + ((secure) ? "; secure" : ""); + + document.cookie = curCookie; + }, + + _getCookie : function(name) { + var dc = document.cookie; + var prefix = name + "="; + var begin = dc.indexOf("; " + prefix); + + if (begin == -1) { + begin = dc.indexOf(prefix); + + if (begin != 0) + return null; + } else + begin += 2; + + var end = document.cookie.indexOf(";", begin); + + if (end == -1) + end = dc.length; + + return unescape(dc.substring(begin + prefix.length, end)); + }, + + _resizeTo : function(inst, w, h, set_w) { + var editorContainer = document.getElementById(inst.editorId + '_parent'); + var tableElm = editorContainer.firstChild; + var iframe = inst.iframeElement; + + if (w == null || w == "null") { + set_w = false; + w = 0; + } - nodeData += "href: " + href + " "; - } + if (h == null || h == "null") + return; - if (nodeName == "img" && tinyMCE.getAttrib(path[i], "class").indexOf('mceItemFlash') != -1) { - nodeName = "flash"; - nodeData = "src: " + path[i].getAttribute('title'); - } + w = parseInt(w); + h = parseInt(h); - if (nodeName == "a" && (anchor = tinyMCE.getAttrib(path[i], "name")) != "") { - nodeName = "a"; - nodeName += "#" + anchor; - nodeData = ""; - } + if (tinyMCE.isGecko) { + w += 2; + h += 2; + } - if (getAttrib(path[i], 'name').indexOf("mce_") != 0) { - var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i], "class"), false); - if (className != "" && className.indexOf('mceItem') == -1) { - nodeName += "." + className; - } - } + var dx = w - tableElm.clientWidth; + var dy = h - tableElm.clientHeight; - var cmd = 'tinyMCE.execInstanceCommand(\'' + editor_id + '\',\'mceSelectNodeDepth\',false,\'' + i + '\');'; - html += '' + nodeName + ''; + w = w < 1 ? 30 : w; + h = h < 1 ? 30 : h; - if (i > 0) { - html += " » "; - } - } + if (set_w) + tableElm.style.width = w + "px"; - pathElm.innerHTML = '' + tinyMCE.getLang('lang_theme_path') + ": " + html + ' '; - } + tableElm.style.height = h + "px"; - // Reset old states - tinyMCE.switchClassSticky(editor_id + '_justifyleft', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_justifyright', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_justifycenter', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_justifyfull', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_sub', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_sup', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_anchor', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_link', 'mceButtonDisabled', true); - tinyMCE.switchClassSticky(editor_id + '_unlink', 'mceButtonDisabled', true); - tinyMCE.switchClassSticky(editor_id + '_outdent', 'mceButtonDisabled', true); - tinyMCE.switchClassSticky(editor_id + '_image', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_hr', 'mceButtonNormal'); - - if (node.nodeName == "A" && tinyMCE.getAttrib(node, "class").indexOf('mceItemAnchor') != -1) - tinyMCE.switchClassSticky(editor_id + '_anchor', 'mceButtonSelected'); - - // Get link - var anchorLink = tinyMCE.getParentElement(node, "a", "href"); - - if (anchorLink || any_selection) - { - tinyMCE.switchClassSticky(editor_id + '_link', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal', false); - tinyMCE.switchClassSticky(editor_id + '_unlink', anchorLink ? 'mceButtonSelected' : 'mceButtonNormal', false); - } + iw = iframe.clientWidth + dx; + ih = iframe.clientHeight + dy; - // Handle visual aid - tinyMCE.switchClassSticky(editor_id + '_visualaid', visual_aid ? 'mceButtonSelected' : 'mceButtonNormal', false); + iw = iw < 1 ? 30 : iw; + ih = ih < 1 ? 30 : ih; - if (undo_levels != -1) - { - tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonDisabled', true); - tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonDisabled', true); - } + if (tinyMCE.isGecko) { + iw -= 2; + ih -= 2; + } - // Within li, blockquote - if (tinyMCE.getParentElement(node, "li,blockquote")) - { - tinyMCE.switchClassSticky(editor_id + '_outdent', 'mceButtonNormal', false); - } + if (set_w) + iframe.style.width = iw + "px"; - // Has redo levels - if (undo_index != -1 && (undo_index < undo_levels-1 && undo_levels > 0)) - { - tinyMCE.switchClassSticky(editor_id + '_redo', 'mceButtonNormal', false); - } + iframe.style.height = ih + "px"; - // Has undo levels - if (undo_index != -1 && (undo_index > 0 && undo_levels > 0)) - { - tinyMCE.switchClassSticky(editor_id + '_undo', 'mceButtonNormal', false); - } + // Is it to small, make it bigger again + if (set_w) { + var tableBodyElm = tableElm.firstChild; + var minIframeWidth = tableBodyElm.scrollWidth; + if (inst.iframeElement.clientWidth < minIframeWidth) { + dx = minIframeWidth - inst.iframeElement.clientWidth; - // Select class in select box - var selectElm = document.getElementById(editor_id + "_styleSelect"); - - if (selectElm) - { - TinyMCE_advanced_setupCSSClasses(editor_id); + inst.iframeElement.style.width = (iw + dx) + "px"; + } + } + }, - classNode = node; - breakOut = false; - var index = 0; + /** + * Handles resizing events. + */ + _resizeEventHandler : function(e) { + var resizer = TinyMCE_AdvancedTheme._resizer; - do - { - if (classNode && classNode.className) - { - for (var i=0; i"); - else - selectByValue(selectElm, ""); - } + var dx = e.screenX - resizer.downX; + var dy = e.screenY - resizer.downY; + var resizeBox = resizer.resizeBox; + var editorId = resizer.editorId; - // Select fontselect - var selectElm = document.getElementById(editor_id + "_fontNameSelect"); - if (selectElm) { - if (!tinyMCE.isSafari && !(tinyMCE.isMSIE && !tinyMCE.isOpera)) { - var face = inst.queryCommandValue('FontName'); + switch (e.type) { + case "mousemove": + var w, h; - face = face == null || face == "" ? "" : face; + w = resizer.width + dx; + h = resizer.height + dy; - selectByValue(selectElm, face, face != ""); - } else { - var elm = tinyMCE.getParentElement(node, "font", "face"); + w = w < 1 ? 1 : w; + h = h < 1 ? 1 : h; - if (elm) { - var family = tinyMCE.getAttrib(elm, "face"); + if (resizer.horizontal) + resizeBox.style.width = w + "px"; - if (family == '') - family = '' + elm.style.fontFamily; + resizeBox.style.height = h + "px"; + break; - if (!selectByValue(selectElm, family, family != "")) - selectByValue(selectElm, ""); - } else - selectByValue(selectElm, ""); + case "mouseup": + TinyMCE_AdvancedTheme._setResizing(e, editorId, false); + TinyMCE_AdvancedTheme._resizeTo(tinyMCE.getInstanceById(editorId), resizer.width + dx, resizer.height + dy, resizer.horizontal); + + // Expire in a month + if (tinyMCE.getParam("theme_advanced_resizing_use_cookie", true)) { + var expires = new Date(); + expires.setTime(expires.getTime() + 3600000 * 24 * 30); + + // Set the cookies + TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_width", "" + (resizer.horizontal ? resizer.width + dx : ""), expires); + TinyMCE_AdvancedTheme._setCookie("TinyMCE_" + editorId + "_height", "" + (resizer.height + dy), expires); + } + break; } - } + }, - // Select fontsize - var selectElm = document.getElementById(editor_id + "_fontSizeSelect"); - if (selectElm) { - if (!tinyMCE.isSafari && !tinyMCE.isOpera) { - var size = inst.queryCommandValue('FontSize'); - selectByValue(selectElm, size == null || size == "" ? "0" : size); + /** + * Starts/stops the editor resizing. + */ + _setResizing : function(e, editor_id, state) { + e = typeof(e) == "undefined" ? window.event : e; + + var resizer = TinyMCE_AdvancedTheme._resizer; + var editorContainer = document.getElementById(editor_id + '_parent'); + var editorArea = document.getElementById(editor_id + '_parent').firstChild; + var resizeBox = document.getElementById(editor_id + '_resize_box'); + var inst = tinyMCE.getInstanceById(editor_id); + + if (state) { + // Place box over editor area + var width = editorArea.clientWidth; + var height = editorArea.clientHeight; + + resizeBox.style.width = width + "px"; + resizeBox.style.height = height + "px"; + + resizer.iframeWidth = inst.iframeElement.clientWidth; + resizer.iframeHeight = inst.iframeElement.clientHeight; + + // Hide editor and show resize box + editorArea.style.display = "none"; + resizeBox.style.display = "block"; + + // Add event handlers, only once + if (!resizer.eventHandlers) { + if (tinyMCE.isMSIE) + tinyMCE.addEvent(document, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler); + else + tinyMCE.addEvent(window, "mousemove", TinyMCE_AdvancedTheme._resizeEventHandler); + + tinyMCE.addEvent(document, "mouseup", TinyMCE_AdvancedTheme._resizeEventHandler); + + resizer.eventHandlers = true; + } + + resizer.resizing = true; + resizer.downX = e.screenX; + resizer.downY = e.screenY; + resizer.width = parseInt(resizeBox.style.width); + resizer.height = parseInt(resizeBox.style.height); + resizer.editorId = editor_id; + resizer.resizeBox = resizeBox; + resizer.horizontal = tinyMCE.getParam("theme_advanced_resize_horizontal", true); } else { - var elm = tinyMCE.getParentElement(node, "font", "size"); - if (elm) { - var size = tinyMCE.getAttrib(elm, "size"); - - if (size == '') { - var sizes = new Array('', '8px', '10px', '12px', '14px', '18px', '24px', '36px'); - - size = '' + elm.style.fontSize; - - for (var i=0; i'; - case "justify": - tinyMCE.switchClassSticky(editor_id + '_justifyfull', 'mceButtonSelected'); - breakOut = true; - break; - } - } while (!breakOut && (alignNode = alignNode.parentNode) != null); + tinyMCE.execCommand("mceInsertContent", false, html); + } else { + if (!tinyMCE.imgElement && tinyMCE.selectedInstance) { + if (tinyMCE.isSafari) + tinyMCE.execCommand("mceInsertContent", false, ''); + else + tinyMCE.selectedInstance.contentDocument.execCommand("insertimage", false, tinyMCE.uniqueURL); - // Div justification - var div = tinyMCE.getParentElement(node, "div"); - if (div && div.style.textAlign == "center") - tinyMCE.switchClassSticky(editor_id + '_justifycenter', 'mceButtonSelected'); - - // Do special text - if (!setup_content) { - // , "JustifyLeft", "_justifyleft", "JustifyCenter", "justifycenter", "JustifyRight", "justifyright", "JustifyFull", "justifyfull", "InsertUnorderedList", "bullist", "InsertOrderedList", "numlist", "InsertUnorderedList", "bullist", "Outdent", "outdent", "Indent", "indent", "subscript", "sub" - var ar = new Array("Bold", "_bold", "Italic", "_italic", "Strikethrough", "_strikethrough", "superscript", "_sup", "subscript", "_sub"); - for (var i=0; i' + tinyMCE.selectedInstance.selection.getSelectedHTML() + ''); + } else + tinyMCE.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL); + + tinyMCE.linkElement = tinyMCE.getElementByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL); + + var elementArray = tinyMCE.getElementsByAttributeValue(tinyMCE.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL); - var selectElm = document.getElementById(editor_id + '_styleSelect'); + for (var i=0; i 0) { - selectElm.setAttribute('cssImported', 'true'); + if (tinyMCE.linkElement) { + var mhref = href; + href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement);"); + mhref = tinyMCE.getParam('convert_urls') ? href : mhref; + + tinyMCE.setAttrib(tinyMCE.linkElement, 'href', href); + tinyMCE.setAttrib(tinyMCE.linkElement, 'mce_href', mhref); + tinyMCE.setAttrib(tinyMCE.linkElement, 'target', target); + tinyMCE.setAttrib(tinyMCE.linkElement, 'title', title); + tinyMCE.setAttrib(tinyMCE.linkElement, 'onclick', onclick); + tinyMCE.setAttrib(tinyMCE.linkElement, 'class', style_class); } + + tinyMCE.execCommand('mceEndUndoLevel'); } }; + +tinyMCE.addTheme("advanced", TinyMCE_AdvancedTheme); + +// Add default buttons maps for advanced theme and all internal plugins +tinyMCE.addButtonMap(TinyMCE_AdvancedTheme._buttonMap); diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/image.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/image.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/image.htm 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/image.htm 2006-06-25 16:54:35.000000000 -0400 @@ -2,23 +2,27 @@ {$lang_insert_image_title} + - -
      - - - - -
      - - - + + + + +
      +
      +
      {$lang_insert_image_title}
      - + @@ -28,8 +32,8 @@ if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) { var html = ""; - html += ''; - html += ''; + html += ' - - + + - - + - - + + - - + + - - + + - - + + - - - - -
      {$lang_insert_image_src}: - +
       
      {$lang_image_list}:
      {$lang_insert_image_alt}:
      {$lang_insert_image_align}:
      {$lang_insert_image_dimensions}: + x -
      {$lang_insert_image_border}:
      {$lang_insert_image_vspace}:
      {$lang_insert_image_hspace}:
      -
      + + + + +
      +
      + +
      + +
      + +
      +
      Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/button_menu.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/button_menu.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/buttons.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/buttons.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/center.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/center.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/full.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/full.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/left.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/left.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/menu_check.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/menu_check.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/right.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/right.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/separator.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/separator.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_delete_col.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_delete_col.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_delete_row.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_delete_row.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_col_after.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_col_after.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_col_before.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_col_before.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_row_after.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_row_after.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_row_before.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/images/table_insert_row_before.gif differ diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/about.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/about.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/about.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/about.js 2006-06-25 16:54:25.000000000 -0400 @@ -1,5 +1,8 @@ function init() { + var inst; + tinyMCEPopup.resizeToInnerSize(); + inst = tinyMCE.selectedInstance; // Give FF some time window.setTimeout('insertHelpIFrame();', 10); @@ -20,8 +23,8 @@ html += ''; html += ''; - for (var i=0; i/g, '&gr;'); + name = name.replace(/>/g, '>'); - html = ''; + // Fix for bug #1447335 + if (tinyMCE.isGecko) + html = ''; + else + html = ''; tinyMCEPopup.execCommand("mceInsertContent", false, html); + + // Fix for bug #1447335 force cursor after the anchor element + if (tinyMCE.isGecko) { + e = inst.getDoc().getElementById('mceNewAnchor'); + + if (e) { + inst.selection.selectNode(e, true, false, false); + e.removeAttribute('id'); + } + } + tinyMCE.handleVisualAid(inst.getBody(), true, inst.visualAid, inst); } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/charmap.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/charmap.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/charmap.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/charmap.js 2006-06-25 16:54:25.000000000 -0400 @@ -170,7 +170,7 @@ ['ý', 'ý', true, 'y - acute'], ['þ', 'þ', true, 'thorn'], ['ÿ', 'ÿ', true, 'y - diaeresis'], -// ['Α', 'Α', true, 'Alpha'], + ['Α', 'Α', true, 'Alpha'], ['Β', 'Β', true, 'Beta'], ['Γ', 'Γ', true, 'Gamma'], ['Δ', 'Δ', true, 'Delta'], @@ -279,9 +279,9 @@ cols++; html += '' + '' + charmap[i][1] + ''; @@ -299,11 +299,13 @@ } function insertChar(chr) { - tinyMCEPopup.execCommand('mceInsertContent', false, '\&#' + chr + ';'); + tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';'); // Refocus in window if (tinyMCEPopup.isWindow) window.focus(); + + tinyMCEPopup.close(); } function previewChar(codeA, codeB, codeN) { diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/color_picker.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/color_picker.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/color_picker.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/color_picker.js 2006-06-25 16:54:25.000000000 -0400 @@ -99,7 +99,8 @@ + '' + '' + '' - + '' + + '
      ' + + '
      ' + '' + ''; diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/image.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/image.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/image.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/image.js 2006-06-25 16:54:25.000000000 -0400 @@ -18,7 +18,7 @@ var align = document.forms[0].align.options[document.forms[0].align.selectedIndex].value; tinyMCEPopup.restoreSelection(); - tinyMCE.insertImage(src, alt, border, hspace, vspace, width, height, align); + tinyMCE.themes['advanced']._insertImage(src, alt, border, hspace, vspace, width, height, align); tinyMCEPopup.close(); } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/link.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/link.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/link.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/link.js 2006-06-25 16:54:25.000000000 -0400 @@ -12,6 +12,10 @@ document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','theme_advanced_link'); + // Handle file browser + if (isVisible('hrefbrowser')) + document.getElementById('href').style.width = '180px'; + var formObj = document.forms[0]; for (var i=0; i 0) { var formObj = document.forms[0]; @@ -53,7 +54,7 @@ var href = document.forms[0].href.value; var target = document.forms[0].target.options[document.forms[0].target.selectedIndex].value; var title = document.forms[0].linktitle.value; - var style_class = document.forms[0].styleSelect.value; + var style_class = document.forms[0].styleSelect ? document.forms[0].styleSelect.value : ""; var dummy; // Make anchors absolute @@ -64,6 +65,6 @@ target = ''; tinyMCEPopup.restoreSelection(); - tinyMCE.insertLink(href, target, title, dummy, style_class); + tinyMCE.themes['advanced']._insertLink(href, target, title, dummy, style_class); tinyMCEPopup.close(); } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/source_editor.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/source_editor.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/source_editor.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/jscripts/source_editor.js 2006-06-25 16:54:25.000000000 -0400 @@ -5,10 +5,10 @@ // Fixes some charcode issues function fixContent(html) { - html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1'); +/* html = html.replace(new RegExp('<(p|hr|table|tr|td|ol|ul|object|embed|li|blockquote)', 'gi'),'\n<$1'); html = html.replace(new RegExp('<\/(p|ol|ul|li|table|tr|td|blockquote|object)>', 'gi'),'\n'); html = tinyMCE.regexpReplace(html, '
      ','
      \n','gi'); - html = tinyMCE.regexpReplace(html, '\n\n','\n','gi'); + html = tinyMCE.regexpReplace(html, '\n\n','\n','gi');*/ return html; } @@ -17,12 +17,25 @@ document.forms[0].htmlSource.value = fixContent(tinyMCE.getContent(tinyMCE.getWindowArg('editor_id'))); resizeInputs(); - setWrap('off'); + + if (tinyMCE.getParam("theme_advanced_source_editor_wrap", true)) { + setWrap('soft'); + document.forms[0].wraped.checked = true; + } } function setWrap(val) { - // hard soft off - document.forms[0].htmlSource.wrap = val; + var s = document.forms[0].htmlSource; + + s.wrap = val; + + if (tinyMCE.isGecko) { + var v = s.value; + var n = s.cloneNode(false); + n.setAttribute("wrap", val); + s.parentNode.replaceChild(n, s); + n.value = v; + } } function toggleWordWrap(elm) { @@ -48,6 +61,6 @@ } function renderWordWrap() { - if (tinyMCE.isMSIE) + if (tinyMCE.isMSIE || tinyMCE.isGecko) document.write(''); } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js 2006-06-25 16:54:25.000000000 -0400 @@ -38,6 +38,11 @@ theme_h4 : 'Heading 4', theme_h5 : 'Heading 5', theme_h6 : 'Heading 6', +theme_blockquote : 'Blockquote', +theme_code : 'Code', +theme_samp : 'Code sample', +theme_dt : 'Definition term ', +theme_dd : 'Definition description', theme_colorpicker_title : 'Select a color', theme_colorpicker_apply : 'Apply', theme_forecolor_desc : 'Select text color', diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/link.htm joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/link.htm --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/link.htm 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/advanced/link.htm 2006-06-25 16:54:35.000000000 -0400 @@ -2,34 +2,39 @@ {$lang_insert_link_title} + - -
      - - - ', ''); - html = tinyMCE.regexpReplace(html, '

      \\s*
      \\s*

      ', '

       

      '); - html = tinyMCE.regexpReplace(html, '

      \\s* \\s*
      \\s* \\s*

      ', '

       

      '); - html = tinyMCE.regexpReplace(html, '

      \\s* \\s*
      \\s*

      ', '

       

      '); - html = tinyMCE.regexpReplace(html, '

      \\s*
      \\s* \\s*

      ', '

       

      '); + getWin : function() { + return this.contentWindow; + }, - // Remove empty anchors - html = html.replace(new RegExp('(.*?)', 'gi'), '$1'); + addShortcut : function(m, k, d, cmd, ui, va) { + var n = typeof(k) == "number", ie = tinyMCE.isMSIE, c, sc, i; + var scl = this.shortcuts; - // Remove some mozilla crap - if (!tinyMCE.isMSIE) - html = html.replace(new RegExp('', 'g'), ""); + if (!tinyMCE.getParam('custom_shortcuts')) + return false; - if (tinyMCE.settings['remove_linebreaks']) - html = html.replace(new RegExp('\r|\n', 'g'), ' '); + m = m.toLowerCase(); + k = ie && !n ? k.toUpperCase() : k; + c = n ? null : k.charCodeAt(0); + d = d && d.indexOf('lang_') == 0 ? tinyMCE.getLang(d) : d; + + sc = { + alt : m.indexOf('alt') != -1, + ctrl : m.indexOf('ctrl') != -1, + shift : m.indexOf('shift') != -1, + charCode : c, + keyCode : n ? k : (ie ? c : null), + desc : d, + cmd : cmd, + ui : ui, + val : va + }; + + for (i=0; i]*)>', 'g'), "\n<$1$2>\n"); - html = html.replace(new RegExp('<\/(p|div)([^>]*)>', 'g'), "\n\n"); - html = html.replace(new RegExp('
      ', 'g'), "
      \n"); - } + scl[scl.length] = sc; - if (tinyMCE.settings['force_br_newlines']) { - var re = new RegExp('

       

      ', 'g'); - html = html.replace(re, "
      "); - } + return true; + }, - if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) { - // Remove weridness! - var re = new RegExp('<>', 'g'); - html = html.replace(re, ""); - } + handleShortcut : function(e) { + var i, s = this.shortcuts, o; - // Call custom cleanup code - html = tinyMCE._customCleanup(inst, on_save ? "get_from_editor" : "insert_to_editor", html); + for (i=0; i" || chk == "
      " || chk == "

       

      " || chk == "

       

      " || chk == "

      ") - html = ""; + tinyMCE.cancelEvent(e); + return true; + } + } - if (tinyMCE.settings["preformatted"]) - return "
      " + html + "
      "; + return false; + }, - return html; -}; + autoResetDesignMode : function() { + // Add fix for tab/style.display none/block problems in Gecko + if (!tinyMCE.isMSIE && this.isHidden() && tinyMCE.getParam('auto_reset_designmode')) + eval('try { this.getDoc().designMode = "On"; } catch(e) {}'); + }, -TinyMCE.prototype.insertLink = function(href, target, title, onclick, style_class) { - tinyMCE.execCommand('mceBeginUndoLevel'); + isHidden : function() { + if (tinyMCE.isMSIE) + return false; - if (this.selectedInstance && this.selectedElement && this.selectedElement.nodeName.toLowerCase() == "img") { - var doc = this.selectedInstance.getDoc(); - var linkElement = tinyMCE.getParentElement(this.selectedElement, "a"); - var newLink = false; + var s = this.getSel(); - if (!linkElement) { - linkElement = doc.createElement("a"); - newLink = true; + // Weird, wheres that cursor selection? + return (!s || !s.rangeCount || s.rangeCount == 0); + }, + + isDirty : function() { + // Is content modified and not in a submit procedure + return this.startContent != tinyMCE.trim(this.getBody().innerHTML) && !tinyMCE.isNotDirty; + }, + + _mergeElements : function(scmd, pa, ch, override) { + if (scmd == "removeformat") { + pa.className = ""; + pa.style.cssText = ""; + ch.className = ""; + ch.style.cssText = ""; + return; } - var mhref = href; - var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, linkElement);"); - mhref = tinyMCE.getParam('convert_urls') ? href : mhref; + var st = tinyMCE.parseStyle(tinyMCE.getAttrib(pa, "style")); + var stc = tinyMCE.parseStyle(tinyMCE.getAttrib(ch, "style")); + var className = tinyMCE.getAttrib(pa, "class"); + + className += " " + tinyMCE.getAttrib(ch, "class"); + + if (override) { + for (var n in st) { + if (typeof(st[n]) == 'function') + continue; - tinyMCE.setAttrib(linkElement, 'href', thref); - tinyMCE.setAttrib(linkElement, 'mce_href', mhref); - tinyMCE.setAttrib(linkElement, 'target', target); - tinyMCE.setAttrib(linkElement, 'title', title); - tinyMCE.setAttrib(linkElement, 'onclick', onclick); - tinyMCE.setAttrib(linkElement, 'class', style_class); + stc[n] = st[n]; + } + } else { + for (var n in stc) { + if (typeof(stc[n]) == 'function') + continue; - if (newLink) { - linkElement.appendChild(this.selectedElement.cloneNode(true)); - this.selectedElement.parentNode.replaceChild(linkElement, this.selectedElement); + st[n] = stc[n]; + } } - return; - } + tinyMCE.setAttrib(pa, "style", tinyMCE.serializeStyle(st)); + tinyMCE.setAttrib(pa, "class", tinyMCE.trim(className)); + ch.className = ""; + ch.style.cssText = ""; + ch.removeAttribute("class"); + ch.removeAttribute("style"); + }, - if (!this.linkElement && this.selectedInstance) { - if (tinyMCE.isSafari) { - tinyMCE.execCommand("mceInsertContent", false, '' + this.selectedInstance.getSelectedHTML() + ''); - } else - this.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL); + _setUseCSS : function(b) { + var d = this.getDoc(); - tinyMCE.linkElement = this.getElementByAttributeValue(this.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL); + try {d.execCommand("useCSS", false, !b);} catch (ex) {} + try {d.execCommand("styleWithCSS", false, b);} catch (ex) {} - var elementArray = this.getElementsByAttributeValue(this.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL); + if (!tinyMCE.getParam("table_inline_editing")) + try {d.execCommand('enableInlineTableEditing', false, "false");} catch (ex) {} - for (var i=0; i'; + case "JustifyCenter": + img.removeAttribute('align'); - tinyMCE.execCommand("mceInsertContent", false, html); - } else { - if (!this.imgElement && this.selectedInstance) { - if (tinyMCE.isSafari) - tinyMCE.execCommand("mceInsertContent", false, ''); - else - this.selectedInstance.contentDocument.execCommand("insertimage", false, tinyMCE.uniqueURL); + // Is centered + var div = tinyMCE.getParentElement(focusElm, "div"); + if (div && div.style.textAlign == "center") { + // Remove div + if (div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode) + div.parentNode.replaceChild(img, div); + } else { + // Add div + var div = this.getDoc().createElement("div"); + div.style.textAlign = 'center'; + div.appendChild(img); + focusElm.parentNode.replaceChild(div, focusElm); + } - tinyMCE.imgElement = this.getElementByAttributeValue(this.selectedInstance.contentDocument.body, "img", "src", tinyMCE.uniqueURL); + this.selection.selectNode(img); + this.repaint(); + tinyMCE.triggerNodeChange(); + return; + + case "JustifyRight": + if (align == 'right') + img.removeAttribute('align'); + else + img.setAttribute('align', 'right'); + + // Remove the div + var div = focusElm.parentNode; + if (div && div.nodeName == "DIV" && div.childNodes.length == 1 && div.parentNode) + div.parentNode.replaceChild(img, div); + + this.selection.selectNode(img); + this.repaint(); + tinyMCE.triggerNodeChange(); + return; + } } - } - if (this.imgElement) { - var needsRepaint = false; - var msrc = src; + if (tinyMCE.settings['force_br_newlines']) { + var alignValue = ""; - src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, tinyMCE.imgElement);"); + if (doc.selection.type != "Control") { + switch (command) { + case "JustifyLeft": + alignValue = "left"; + break; - if (tinyMCE.getParam('convert_urls')) - msrc = src; + case "JustifyCenter": + alignValue = "center"; + break; - if (onmouseover && onmouseover != "") - onmouseover = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, tinyMCE.imgElement);") + "';"; + case "JustifyFull": + alignValue = "justify"; + break; - if (onmouseout && onmouseout != "") - onmouseout = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, tinyMCE.imgElement);") + "';"; + case "JustifyRight": + alignValue = "right"; + break; + } - // Use alt as title if it's undefined - if (typeof(title) == "undefined") - title = alt; + if (alignValue != "") { + var rng = doc.selection.createRange(); - if (width != this.imgElement.getAttribute("width") || height != this.imgElement.getAttribute("height") || align != this.imgElement.getAttribute("align")) - needsRepaint = true; + if ((divElm = tinyMCE.getParentElement(rng.parentElement(), "div")) != null) + divElm.setAttribute("align", alignValue); + else if (rng.pasteHTML && rng.htmlText.length > 0) + rng.pasteHTML('
      ' + rng.htmlText + "
      "); - tinyMCE.setAttrib(this.imgElement, 'src', src); - tinyMCE.setAttrib(this.imgElement, 'mce_src', msrc); - tinyMCE.setAttrib(this.imgElement, 'alt', alt); - tinyMCE.setAttrib(this.imgElement, 'title', title); - tinyMCE.setAttrib(this.imgElement, 'align', align); - tinyMCE.setAttrib(this.imgElement, 'border', border, true); - tinyMCE.setAttrib(this.imgElement, 'hspace', hspace, true); - tinyMCE.setAttrib(this.imgElement, 'vspace', vspace, true); - tinyMCE.setAttrib(this.imgElement, 'width', width, true); - tinyMCE.setAttrib(this.imgElement, 'height', height, true); - tinyMCE.setAttrib(this.imgElement, 'onmouseover', onmouseover); - tinyMCE.setAttrib(this.imgElement, 'onmouseout', onmouseout); + tinyMCE.triggerNodeChange(); + return; + } + } + } - // Fix for bug #989846 - Image resize bug - if (width && width != "") - this.imgElement.style.pixelWidth = width; + switch (command) { + case "mceRepaint": + this.repaint(); + return true; - if (height && height != "") - this.imgElement.style.pixelHeight = height; + case "InsertUnorderedList": + case "InsertOrderedList": + var tag = (command == "InsertUnorderedList") ? "ul" : "ol"; - if (needsRepaint) - tinyMCE.selectedInstance.repaint(); - } + if (tinyMCE.isSafari) + this.execCommand("mceInsertContent", false, "<" + tag + ">
    1.  
    2. <" + tag + ">"); + else + this.getDoc().execCommand(command, user_interface, value); - tinyMCE.execCommand('mceEndUndoLevel'); -}; + tinyMCE.triggerNodeChange(); + break; -TinyMCE.prototype.getElementByAttributeValue = function(node, element_name, attrib, value) { - var elements = this.getElementsByAttributeValue(node, element_name, attrib, value); - if (elements.length == 0) - return null; + case "Strikethrough": + if (tinyMCE.isSafari) + this.execCommand("mceInsertContent", false, "" + this.selection.getSelectedHTML() + ""); + else + this.getDoc().execCommand(command, user_interface, value); - return elements[0]; -}; + tinyMCE.triggerNodeChange(); + break; -TinyMCE.prototype.getElementsByAttributeValue = function(node, element_name, attrib, value) { - var elements = new Array(); + case "mceSelectNode": + this.selection.selectNode(value); + tinyMCE.triggerNodeChange(); + tinyMCE.selectedNode = value; + break; - if (node && node.nodeName.toLowerCase() == element_name) { - if (node.getAttribute(attrib) && node.getAttribute(attrib).indexOf(value) != -1) - elements[elements.length] = node; - } + case "FormatBlock": + if (value == null || value == "") { + var elm = tinyMCE.getParentElement(this.getFocusElement(), "p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp"); - if (node && node.hasChildNodes()) { - for (var x=0, n=node.childNodes.length; x', 'gi').test(value)) + value = value.replace(/[^a-z]/gi, ''); - return elements; -}; + if (tinyMCE.isMSIE && new RegExp('blockquote|code|samp', 'gi').test(value)) { + var b = this.selection.getBookmark(); + this.getDoc().execCommand("FormatBlock", false, '

      '); + tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()), value); + this.selection.moveToBookmark(b); + } else + this.getDoc().execCommand("FormatBlock", false, value); + } -TinyMCE.prototype.isBlockElement = function(node) { - return node != null && node.nodeType == 1 && this.blockRegExp.test(node.nodeName); -}; + tinyMCE.triggerNodeChange(); -TinyMCE.prototype.getParentBlockElement = function(node) { - // Search up the tree for block element - while (node) { - if (this.blockRegExp.test(node.nodeName)) - return node; + break; - node = node.parentNode; - } + case "mceRemoveNode": + if (!value) + value = tinyMCE.getParentElement(this.getFocusElement()); - return null; -}; + if (tinyMCE.isMSIE) { + value.outerHTML = value.innerHTML; + } else { + var rng = value.ownerDocument.createRange(); + rng.setStartBefore(value); + rng.setEndAfter(value); + rng.deleteContents(); + rng.insertNode(rng.createContextualFragment(value.innerHTML)); + } -TinyMCE.prototype.getNodeTree = function(node, node_array, type, node_name) { - if (typeof(type) == "undefined" || node.nodeType == type && (typeof(node_name) == "undefined" || node.nodeName == node_name)) - node_array[node_array.length] = node; + tinyMCE.triggerNodeChange(); - if (node.hasChildNodes()) { - for (var i=0; i=0; i--) { + var elm = nodes[i]; + var isNew = tinyMCE.getAttrib(elm, "mce_new") == "true"; + + elm.removeAttribute("mce_new"); + + // Is only child a element + if (elm.childNodes && elm.childNodes.length == 1 && elm.childNodes[0].nodeType == 1) { + //tinyMCE.debug("merge1" + isNew); + this._mergeElements(scmd, elm, elm.childNodes[0], isNew); + continue; + } - start = prot + "//" + host + portPart + "/"; + // Is I the only child + if (elm.parentNode.childNodes.length == 1 && !invalidRe.test(elm.nodeName) && !invalidRe.test(elm.parentNode.nodeName)) { + //tinyMCE.debug("merge2" + isNew + "," + elm.nodeName + "," + elm.parentNode.nodeName); + if (invalidParentsRe == null || !invalidParentsRe.test(elm.parentNode.nodeName)) + this._mergeElements(scmd, elm.parentNode, elm, false); + } + } - if (url.indexOf(start) == 0) - url = url.substring(start.length-1); - } + // Remove empty wrappers + var nodes = doc.getElementsByTagName(wrapper); + for (var i=nodes.length-1; i>=0; i--) { + var elm = nodes[i]; + var isEmpty = true; + + // Check if it has any attribs + var tmp = doc.createElement("body"); + tmp.appendChild(elm.cloneNode(false)); + + // Is empty span, remove it + tmp.innerHTML = tmp.innerHTML.replace(new RegExp('style=""|class=""', 'gi'), ''); + //tinyMCE.debug(tmp.innerHTML); + if (new RegExp('', 'gi').test(tmp.innerHTML)) { + for (var x=0; x 0) { + value = tinyMCE.replaceVar(value, "selection", selectedText); + tinyMCE.execCommand('mceInsertContent', false, value); + } - if (up['host']) - url += up['host']; + tinyMCE.triggerNodeChange(); + break; - if (up['port']) - url += ":" + up['port']; + case "mceSetAttribute": + if (typeof(value) == 'object') { + var targetElms = (typeof(value['targets']) == "undefined") ? "p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address" : value['targets']; + var targetNode = tinyMCE.getParentElement(this.getFocusElement(), targetElms); + + if (targetNode) { + targetNode.setAttribute(value['name'], value['value']); + tinyMCE.triggerNodeChange(); + } + } + break; - if (up['path']) - url += up['path']; + case "mceSetCSSClass": + this.execCommand("SetStyleInfo", false, {command : "setattrib", name : "class", value : value}); + break; - if (up['query']) - url += "?" + up['query']; + case "mceInsertRawHTML": + var key = 'tiny_mce_marker'; - if (up['anchor']) - url += "#" + up['anchor']; + this.execCommand('mceBeginUndoLevel'); - return url; -}; + // Insert marker key + this.execCommand('mceInsertContent', false, key); -/** - * Converts an absolute path to relative path. - */ -TinyMCE.prototype.convertAbsoluteURLToRelativeURL = function(base_url, url_to_relative) { - var baseURL = this.parseURL(base_url); - var targetURL = this.parseURL(url_to_relative); - var strTok1; - var strTok2; - var breakPoint = 0; - var outPath = ""; - var forceSlash = false; + // Store away scroll pos + var scrollX = this.getDoc().body.scrollLeft + this.getDoc().documentElement.scrollLeft; + var scrollY = this.getDoc().body.scrollTop + this.getDoc().documentElement.scrollTop; - if (targetURL.path == "") - targetURL.path = "/"; - else - forceSlash = true; + // Find marker and replace with RAW HTML + var html = this.getBody().innerHTML; + if ((pos = html.indexOf(key)) != -1) + tinyMCE.setInnerHTML(this.getBody(), html.substring(0, pos) + value + html.substring(pos + key.length)); - // Crop away last path part - base_url = baseURL.path.substring(0, baseURL.path.lastIndexOf('/')); - strTok1 = base_url.split('/'); - strTok2 = targetURL.path.split('/'); + // Restore scoll pos + this.contentWindow.scrollTo(scrollX, scrollY); - if (strTok1.length >= strTok2.length) { - for (var i=0; i= strTok2.length || strTok1[i] != strTok2[i]) { - breakPoint = i + 1; - break; - } - } - } + this.execCommand('mceEndUndoLevel'); - if (strTok1.length < strTok2.length) { - for (var i=0; i= strTok1.length || strTok1[i] != strTok2[i]) { - breakPoint = i + 1; break; - } - } - } - if (breakPoint == 1) - return targetURL.path; + case "mceInsertContent": + // Force empty string + if (!value) + value = ''; - for (var i=0; i<(strTok1.length-(breakPoint-1)); i++) - outPath += "../"; + var insertHTMLFailed = false; + this.getWin().focus(); - for (var i=breakPoint-1; i=0; i--) { - if (baseURLParts[i].length == 0) - continue; + rng.selectNode(value); + rng.collapse(false); - newBaseURLParts[newBaseURLParts.length] = baseURLParts[i]; - } - baseURLParts = newBaseURLParts.reverse(); + sel.addRange(rng); + } else + rng.collapse(false); - // Merge relURLParts chunks - var newRelURLParts = new Array(); - var numBack = 0; - for (var i=relURLParts.length-1; i>=0; i--) { - if (relURLParts[i].length == 0 || relURLParts[i] == ".") - continue; + tinyMCE.fixGeckoBaseHREFBug(2, this.getDoc(), value); + } else { + var rng = doc.selection.createRange(); + var c = value.indexOf('"; } - } - return h; -}; + if (hc) { + cn = n.childNodes; -TinyMCE.prototype.getOuterHTML = function(e) { - if (tinyMCE.isMSIE) - return e.outerHTML; + for (i=0, l=cn.length; i'; - var d = e.ownerDocument.createElement("body"); - d.innerHTML = h; - e.parentNode.replaceChild(d.firstChild, e); -}; + return h; + }, -TinyMCE.prototype.insertAfter = function(nc, rc){ - if (rc.nextSibling) - rc.parentNode.insertBefore(nc, rc.nextSibling); - else - rc.parentNode.appendChild(nc); -}; + _serializeAttribute : function(n, r, an) { + var av = '', t, os = this.settings.on_save; -TinyMCE.prototype.cleanupAnchors = function(doc) { - var an = doc.getElementsByTagName("a"); + if (os && (an.indexOf('mce_') == 0 || an.indexOf('_moz') == 0)) + return ''; - for (var i=0; i=0; x--) - tinyMCE.insertAfter(cn[x], an[i]); + if (os && this.mceAttribs[an]) + av = this._getAttrib(n, this.mceAttribs[an]); + + if (av.length == 0) + av = this._getAttrib(n, an); + + if (av.length == 0 && r.defaultAttribs && (t = r.defaultAttribs[an])) { + av = t; + + if (av == "mce_empty") + return " " + an + '=""'; } - } -}; -TinyMCE.prototype._setHTML = function(doc, html_content) { - // Force closed anchors open - //html_content = html_content.replace(new RegExp('', 'gi'), ''); + if (r.forceAttribs && (t = r.forceAttribs[an])) + av = t; - html_content = tinyMCE.cleanupHTMLCode(html_content); + if (os && av.length != 0 && this.settings.url_converter.length != 0 && /^(src|href|longdesc)$/.test(an)) + av = eval(this.settings.url_converter + '(this, n, av)'); - // Try innerHTML if it fails use pasteHTML in MSIE - try { - tinyMCE.setInnerHTML(doc.body, html_content); - } catch (e) { - if (this.isMSIE) - doc.body.createTextRange().pasteHTML(html_content); - } + if (av.length != 0 && r.validAttribValues && r.validAttribValues[an] && !r.validAttribValues[an].test(av)) + return ""; + + if (av.length != 0 && av == "{$uid}") + av = "uid_" + (this.idCount++); + + if (av.length != 0) + return " " + an + "=" + '"' + this.xmlEncode(av) + '"'; + + return ""; + }, + + formatHTML : function(h) { + var s = this.settings, p = '', i = 0, li = 0, o = '', l; + + h = h.replace(/\r/g, ''); // Windows sux, isn't carriage return a thing of the past :) + h = '\n' + h; + h = h.replace(new RegExp('\\n\\s+', 'gi'), '\n'); // Remove previous formatting + h = h.replace(this.nlBeforeRe, '\n<$1$2>'); + h = h.replace(this.nlAfterRe, '<$1$2>\n'); + h = h.replace(this.nlBeforeAfterRe, '\n<$1$2$3>\n'); + h += '\n'; + + //tinyMCE.debug(h); + + while ((i = h.indexOf('\n', i + 1)) != -1) { + if ((l = h.substring(li + 1, i)).length != 0) { + if (this.ouRe.test(l) && p.length >= s.indent_levels) + p = p.substring(s.indent_levels); - // Content duplication bug fix - if (tinyMCE.isMSIE && tinyMCE.settings['fix_content_duplication']) { - // Remove P elements in P elements - var paras = doc.getElementsByTagName("P"); - for (var i=0; i 127 || c == 60 || c == 62 || c == 38 || c == 39 || c == 34) + o += '&#' + c + ";"; + else + o += String.fromCharCode(c); + } + + return o; + } + + return s; + }, + + split : function(re, s) { + var c = s.split(re); + var i, l, o = new Array(); + + for (i=0, l=c.length; i<\/o:p>", "
      "); - html = tinyMCE.regexpReplace(html, " <\/o:p>", ""); - html = tinyMCE.regexpReplace(html, "", ""); - html = tinyMCE.regexpReplace(html, "

      <\/p>", ""); - html = tinyMCE.regexpReplace(html, "

      <\/p>\r\n

      <\/p>", ""); - html = tinyMCE.regexpReplace(html, "

       <\/p>", "
      "); - html = tinyMCE.regexpReplace(html, "

      \s*(

      \s*)?", "

      "); - html = tinyMCE.regexpReplace(html, "<\/p>\s*(<\/p>\s*)?", "

      "); + this.entitiesDone = true; } + }, - // Always set the htmlText output - tinyMCE.setInnerHTML(doc.body, html); - } - - tinyMCE.cleanupAnchors(doc); - - if (tinyMCE.getParam("convert_fonts_to_spans")) - tinyMCE.convertSpansToFonts(doc); -}; - -TinyMCE.prototype.getImageSrc = function(str) { - var pos = -1; + _setupRules : function() { + var s = this.settings; - if (!str) - return ""; + // Setup default rule + if (!this.rulesDone) { + this.addRuleStr(s.valid_elements); + this.addRuleStr(s.extended_valid_elements); - if ((pos = str.indexOf('this.src=')) != -1) { - var src = str.substring(pos + 10); + this.rulesDone = true; + } + }, - src = src.substring(0, src.indexOf('\'')); + _isDuplicate : function(n) { + var i; - return src; - } + if (!this.settings.fix_content_duplication) + return false; - return ""; -}; + if (tinyMCE.isMSIE && !tinyMCE.isOpera && n.nodeType == 1) { + // Mark elements + if (n.mce_serialized == this.serializationId) + return true; -TinyMCE.prototype._getElementById = function(element_id) { - var elm = document.getElementById(element_id); - if (!elm) { - // Check for element in forms - for (var j=0; j gets converted to
      . + h = h.replace(/\s\/>/g, '>'); + + // Since MSIE auto generated emtpy P tags some times we must tell it to keep the real ones + h = h.replace(/]*)>\u00A0?<\/p>/gi, ' 

      '); // Keep empty paragraphs + h = h.replace(/]*)>\s* \s*<\/p>/gi, ' 

      '); // Keep empty paragraphs + h = h.replace(/]*)>\s+<\/p>/gi, ' 

      '); // Keep empty paragraphs - if (typeof(editor_id) == "undefined" && typeof(doc) == "undefined") { - var instance; + // Remove first comment + e.innerHTML = tinyMCE.uniqueTag + h; + e.firstChild.removeNode(true); - for (var instanceName in tinyMCE.instances) { - instance = tinyMCE.instances[instanceName]; - if (!tinyMCE.isInstance(instance)) - continue; + // Remove weird auto generated empty paragraphs unless it's supposed to be there + nl = e.getElementsByTagName("p"); + for (i=nl.length-1; i>=0; i--) { + n = nl[i]; - break; + if (n.nodeName == 'P' && !n.hasChildNodes() && !n.mce_keep) + n.parentNode.removeChild(n); } - - doc = instance.getDoc(); - } - - if (typeof(doc) == "undefined") { - var instance = tinyMCE.getInstanceById(editor_id); - doc = instance.getDoc(); + } else { + h = this.fixGeckoBaseHREFBug(1, e, h); + e.innerHTML = h; + this.fixGeckoBaseHREFBug(2, e, h); } +}; - if (doc) { - var styles = tinyMCE.isMSIE ? doc.styleSheets : doc.styleSheets; +TinyMCE_Engine.prototype.getOuterHTML = function(e) { + if (tinyMCE.isMSIE) + return e.outerHTML; - if (styles && styles.length > 0) { - for (var x=0; x 0) - tinyMCE.cssClasses = output; - - return output; + return e; }; -TinyMCE.prototype.regexpReplace = function(in_str, reg_exp, replace_str, opts) { - if (in_str == null) - return in_str; - - if (typeof(opts) == "undefined") - opts = 'g'; - - var re = new RegExp(reg_exp, opts); - return in_str.replace(re, replace_str); -}; +TinyMCE_Engine.prototype.getNodeTree = function(n, na, t, nn) { + var i; -TinyMCE.prototype.trim = function(str) { - return str.replace(/^\s*|\s*$/g, ""); -}; + if (typeof(t) == "undefined" || n.nodeType == t && (typeof(nn) == "undefined" || n.nodeName == nn)) + na[na.length] = n; -TinyMCE.prototype.cleanupEventStr = function(str) { - str = "" + str; - str = str.replace('function anonymous()\n{\n', ''); - str = str.replace('\n}', ''); - str = str.replace(/^return true;/gi, ''); // Remove event blocker + if (n.hasChildNodes()) { + for (i=0; i=0; i--) { - templateFunction = 'TinyMCE_' + themePlugins[i] + "_getControlHTML"; - if (eval("typeof(" + templateFunction + ")") != 'undefined') { - var html = eval(templateFunction + "('" + control_name + "');"); - if (html != "") - return tinyMCE.replaceVar(html, "pluginurl", tinyMCE.baseURL + "/plugins/" + themePlugins[i]); + do { + for (var i=0; i=0; i--) { - templateFunction = 'TinyMCE_' + themePlugins[i] + "_execCommand"; - if (eval("typeof(" + templateFunction + ")") != 'undefined') { - if (eval(templateFunction + "(editor_id, element, command, user_interface, value);")) - return true; - } + n = n.parentNode; } - // Theme funtion - templateFunction = 'TinyMCE_' + tinyMCE.settings['theme'] + "_execCommand"; - if (eval("typeof(" + templateFunction + ")") != 'undefined') - return eval(templateFunction + "(editor_id, element, command, user_interface, value);"); - - // Pass to normal - return false; + return null; }; -TinyMCE.prototype._getThemeFunction = function(suffix, skip_plugins) { - if (skip_plugins) - return 'TinyMCE_' + tinyMCE.settings['theme'] + suffix; +TinyMCE_Engine.prototype.getAttrib = function(elm, name, default_value) { + if (typeof(default_value) == "undefined") + default_value = ""; - var themePlugins = tinyMCE.getParam('plugins', '', true, ','); - var templateFunction; + // Not a element + if (!elm || elm.nodeType != 1) + return default_value; - // Is it defined in any plugins - for (var i=themePlugins.length; i>=0; i--) { - templateFunction = 'TinyMCE_' + themePlugins[i] + suffix; - if (eval("typeof(" + templateFunction + ")") != 'undefined') - return templateFunction; - } + var v = elm.getAttribute(name); - return 'TinyMCE_' + tinyMCE.settings['theme'] + suffix; -}; + // Try className for class attrib + if (name == "class" && !v) + v = elm.className; + // Workaround for a issue with Firefox 1.5rc2+ + if (tinyMCE.isGecko && name == "src" && elm.src != null && elm.src != "") + v = elm.src; -TinyMCE.prototype.isFunc = function(func_name) { - if (func_name == null || func_name == "") - return false; + // Workaround for a issue with Firefox 1.5rc2+ + if (tinyMCE.isGecko && name == "href" && elm.href != null && elm.href != "") + v = elm.href; + + if (name == "http-equiv" && tinyMCE.isMSIE) + v = elm.httpEquiv; - return eval("typeof(" + func_name + ")") != "undefined"; + if (name == "style" && !tinyMCE.isOpera) + v = elm.style.cssText; + + return (v && v != "") ? v : default_value; }; -TinyMCE.prototype.exec = function(func_name, args) { - var str = func_name + '('; +TinyMCE_Engine.prototype.setAttrib = function(element, name, value, fix_value) { + if (typeof(value) == "number" && value != null) + value = "" + value; - // Add all arguments - for (var i=3; i 1 && tinyMCE.currentConfig != this.settings['index']) { - tinyMCE.settings = this.settings; - tinyMCE.currentConfig = this.settings['index']; - } + return a; }; -TinyMCEControl.prototype.convertAllRelativeURLs = function() { - var body = this.getBody(); +TinyMCE_Engine.prototype.addCSSClass = function(e, c, b) { + var o = this.removeCSSClass(e, c); - // Convert all image URL:s to absolute URL - var elms = body.getElementsByTagName("img"); - for (var i=0; i-1; i--) { + if (ar[i].specified && ar[i].nodeValue) + ne.setAttribute(ar[i].nodeName.toLowerCase(), ar[i].nodeValue); } - } -}; -TinyMCEControl.prototype.getSelectedHTML = function() { - if (tinyMCE.isSafari) { - // Not realy perfect!! + ar = e.childNodes; + for (i=0; i= strTok2.length) { + for (var i=0; i= strTok2.length || strTok1[i] != strTok2[i]) { + breakPoint = i + 1; + break; + } } - } else { - var sel = this.getSel(); - - if (!sel) - return; - - if (tinyMCE.isSafari) { - sel.realSelection.setBaseAndExtent(node, 0, node, node.innerText.length); + } - if (collapse) { - if (to_start) - sel.realSelection.collapseToStart(); - else - sel.realSelection.collapseToEnd(); + if (strTok1.length < strTok2.length) { + for (var i=0; i= strTok1.length || strTok1[i] != strTok2[i]) { + breakPoint = i + 1; + break; } - - this.scrollToNode(node); - - return; } + } - var rng = this.getDoc().createRange(); - - if (select_text_node) { - // Find first textnode in tree - var nodes = tinyMCE.getNodeTree(node, new Array(), 3); - if (nodes.length > 0) - rng.selectNodeContents(nodes[0]); - else - rng.selectNodeContents(node); - } else - rng.selectNode(node); + if (breakPoint == 1) + return targetURL.path; - if (collapse) { - // Special treatment of textnode collapse - if (!to_start && node.nodeType == 3) { - rng.setStart(node, node.nodeValue.length); - rng.setEnd(node, node.nodeValue.length); - } else - rng.collapse(to_start); - } + for (var i=0; i<(strTok1.length-(breakPoint-1)); i++) + outPath += "../"; - sel.removeAllRanges(); - sel.addRange(rng); + for (var i=breakPoint-1; i scrollY && pos.absTop < (scrollY - 25 + height))) - this.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); -}; + if ((pos = fileName.lastIndexOf('/')) != -1) + fileName = fileName.substring(pos + 1); -TinyMCEControl.prototype.getBody = function() { - return this.getDoc().body; -}; + // Is local anchor + if (fileName == targetURL.path && targetURL.anchor != "") + targetURL.path = ""; -TinyMCEControl.prototype.getDoc = function() { - return this.contentWindow.document; -}; + // If empty and not local anchor force filename or slash + if (targetURL.path == "" && !targetURL.anchor) + targetURL.path = fileName != "" ? fileName : "/"; -TinyMCEControl.prototype.getWin = function() { - return this.contentWindow; + return this.serializeURL(targetURL); }; -TinyMCEControl.prototype.getSel = function() { - if (tinyMCE.isMSIE && !tinyMCE.isOpera) - return this.getDoc().selection; - - var sel = this.contentWindow.getSelection(); - - // Fake getRangeAt - if (tinyMCE.isSafari && !sel.getRangeAt) { - var newSel = new Object(); - var doc = this.getDoc(); - - function getRangeAt(idx) { - var rng = new Object(); +TinyMCE_Engine.prototype.convertRelativeToAbsoluteURL = function(base_url, relative_url) { + var baseURL = this.parseURL(base_url); + var relURL = this.parseURL(relative_url); - rng.startContainer = this.focusNode; - rng.endContainer = this.anchorNode; - rng.commonAncestorContainer = this.focusNode; - rng.createContextualFragment = function (html) { - // Seems to be a tag - if (html.charAt(0) == '<') { - var elm = doc.createElement("div"); + if (relative_url == "" || relative_url.charAt(0) == '/' || relative_url.indexOf('://') != -1 || relative_url.indexOf('mailto:') != -1 || relative_url.indexOf('javascript:') != -1) + return relative_url; - elm.innerHTML = html; + // Split parts + baseURLParts = baseURL['path'].split('/'); + relURLParts = relURL['path'].split('/'); - return elm.firstChild; - } + // Remove empty chunks + var newBaseURLParts = new Array(); + for (var i=baseURLParts.length-1; i>=0; i--) { + if (baseURLParts[i].length == 0) + continue; - return doc.createTextNode("UNSUPPORTED, DUE TO LIMITATIONS IN SAFARI!"); - }; + newBaseURLParts[newBaseURLParts.length] = baseURLParts[i]; + } + baseURLParts = newBaseURLParts.reverse(); - rng.deleteContents = function () { - doc.execCommand("Delete", false, ""); - }; + // Merge relURLParts chunks + var newRelURLParts = new Array(); + var numBack = 0; + for (var i=relURLParts.length-1; i>=0; i--) { + if (relURLParts[i].length == 0 || relURLParts[i] == ".") + continue; - return rng; + if (relURLParts[i] == '..') { + numBack++; + continue; } - // Patch selection - - newSel.focusNode = sel.baseNode; - newSel.focusOffset = sel.baseOffset; - newSel.anchorNode = sel.extentNode; - newSel.anchorOffset = sel.extentOffset; - newSel.getRangeAt = getRangeAt; - newSel.text = "" + sel; - newSel.realSelection = sel; - - newSel.toString = function () {return this.text;}; + if (numBack > 0) { + numBack--; + continue; + } - return newSel; + newRelURLParts[newRelURLParts.length] = relURLParts[i]; } - return sel; -}; - -TinyMCEControl.prototype.getRng = function() { - var sel = this.getSel(); - if (sel == null) - return null; + relURLParts = newRelURLParts.reverse(); - if (tinyMCE.isMSIE && !tinyMCE.isOpera) - return sel.createRange(); + // Remove end from absolute path + var len = baseURLParts.length-numBack; + var absPath = (len <= 0 ? "" : "/") + baseURLParts.slice(0, len).join('/') + "/" + relURLParts.join('/'); + var start = "", end = ""; - if (tinyMCE.isSafari) { - var rng = this.getDoc().createRange(); - var sel = this.getSel().realSelection; + // Build output URL + relURL.protocol = baseURL.protocol; + relURL.host = baseURL.host; + relURL.port = baseURL.port; - rng.setStart(sel.baseNode, sel.baseOffset); - rng.setEnd(sel.extentNode, sel.extentOffset); + // Re-add trailing slash if it's removed + if (relURL.path.charAt(relURL.path.length-1) == "/") + absPath += "/"; - return rng; - } + relURL.path = absPath; - return this.getSel().getRangeAt(0); + return this.serializeURL(relURL); }; -TinyMCEControl.prototype._insertPara = function(e) { - function isEmpty(para) { - function isEmptyHTML(html) { - return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == ""; - } - - // Check for images - if (para.getElementsByTagName("img").length > 0) - return false; - - // Check for tables - if (para.getElementsByTagName("table").length > 0) - return false; - - // Check for HRs - if (para.getElementsByTagName("hr").length > 0) - return false; - - // Check all textnodes - var nodes = tinyMCE.getNodeTree(para, new Array(), 3); - for (var i=0; i <" + blockName + "> "; - paraAfter = body.childNodes[1]; + if (href && href != "") { + href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], href); + elms[i].setAttribute("href", href); } + } +}; - this.selectNode(paraAfter, true, true); +/* file:jscripts/tiny_mce/classes/TinyMCE_Array.class.js */ - return true; - } +TinyMCE_Engine.prototype.clearArray = function(a) { + for (var k in a) + a[k] = null; - // Place first part within new paragraph - if (startChop.nodeName == blockName) - rngBefore.setStart(startChop, 0); - else - rngBefore.setStartBefore(startChop); + return a; +}; - rngBefore.setEnd(startNode, startOffset); - paraBefore.appendChild(rngBefore.cloneContents()); +/* file:jscripts/tiny_mce/classes/TinyMCE_Event.class.js */ - // Place secound part within new paragraph - rngAfter.setEndAfter(endChop); - rngAfter.setStart(endNode, endOffset); - var contents = rngAfter.cloneContents(); - - if (contents.firstChild && contents.firstChild.nodeName == blockName) { -/* var nodes = contents.firstChild.childNodes; - for (var i=0; i 0) - rng.pasteHTML('
      ' + rng.htmlText + "
      "); + if (rng.item) { + e = rng.item(0); - tinyMCE.triggerNodeChange(); - return; + nl = doc.getElementsByTagName(e.nodeName); + for (i=0; i
    3.  
    4. <" + tag + ">"); - else - this.getDoc().execCommand(command, user_interface, value); - - tinyMCE.triggerNodeChange(); - break; + if (tinyMCE.isGecko) { + s = tinyMCE.getParentElement(rng.startContainer); + for (si=0; si" + this.getSelectedHTML() + ""); - else - this.getDoc().execCommand(command, user_interface, value); + e = tinyMCE.getParentElement(rng.endContainer); + for (ei=0; ei bookmark.index) { + try { + rng.addElement(nl[bookmark.index]); + } catch (ex) { + // Might be thrown if the node no longer exists } } } else { - var felm = this.getFocusElement(); - if (sel.isCollapsed || (/td|tr|tbody|table/ig.test(felm.nodeName) && sel.anchorNode == felm.parentNode)) - parentElm = felm; + rng = inst.getSel().createRange(); + rng.moveToElementText(inst.getBody()); + rng.collapse(true); + rng.moveStart('character', bookmark.start); + rng.moveEnd('character', bookmark.length); } - // Whole element selected - if (parentElm && !invalidRe.test(parentElm.nodeName)) { - if (scmd == "setstyle") - tinyMCE.setStyleAttrib(parentElm, sname, svalue); + rng.select(); - if (scmd == "setattrib") - tinyMCE.setAttrib(parentElm, sname, svalue); + win.scrollTo(bookmark.scrollX, bookmark.scrollY); + return true; + } - if (scmd == "removeformat") { - parentElm.style.cssText = ''; - tinyMCE.setAttrib(parentElm, 'class', ''); - } + if (tinyMCE.isGecko && bookmark.rng) { + sel.removeAllRanges(); + sel.addRange(bookmark.rng); + win.scrollTo(bookmark.scrollX, bookmark.scrollY); + return true; + } - // Remove style/attribs from all children - var ch = tinyMCE.getNodeTree(parentElm, new Array(), 1); - for (var z=0; z bookmark.start) + rng.setStart(nl[bookmark.start].childNodes[bookmark.startIndex], bookmark.startOffset); + + nl = doc.getElementsByTagName(bookmark.endTag); + if (nl.length > bookmark.end) + rng.setEnd(nl[bookmark.end].childNodes[bookmark.endIndex], bookmark.endOffset); + + sel.removeAllRanges(); + sel.addRange(rng); + /* } catch { + // Ignore + }*/ - if (scmd == "setstyle") - tinyMCE.setStyleAttrib(ch[z], sname, ''); + win.scrollTo(bookmark.scrollX, bookmark.scrollY); + return true; + } - if (scmd == "setattrib") - tinyMCE.setAttrib(ch[z], sname, ''); + return false; + }, - if (scmd == "removeformat") { - ch[z].style.cssText = ''; - tinyMCE.setAttrib(ch[z], 'class', ''); - } - } - } else { - doc.execCommand("fontname", false, "#mce_temp_font#"); - var elementArray = tinyMCE.getElementsByAttributeValue(this.getBody(), "font", "face", "#mce_temp_font#"); + selectNode : function(node, collapse, select_text_node, to_start) { + var inst = this.instance, sel, rng, nodes; - // Change them all - for (var x=0; x=0; i--) { - var elm = nodes[i]; - var isNew = tinyMCE.getAttrib(elm, "mce_new") == "true"; - - elm.removeAttribute("mce_new"); - - // Is only child a element - if (elm.childNodes && elm.childNodes.length == 1 && elm.childNodes[0].nodeType == 1) { - //tinyMCE.debug("merge1" + isNew); - this._mergeElements(scmd, elm, elm.childNodes[0], isNew); - continue; + if (collapse) { + if (to_start) + sel.collapseToStart(); + else + sel.collapseToEnd(); } - // Is I the only child - if (elm.parentNode.childNodes.length == 1 && !invalidRe.test(elm.nodeName) && !invalidRe.test(elm.parentNode.nodeName)) { - //tinyMCE.debug("merge2" + isNew + "," + elm.nodeName + "," + elm.parentNode.nodeName); - if (invalidParentsRe == null || !invalidParentsRe.test(elm.parentNode.nodeName)) - this._mergeElements(scmd, elm.parentNode, elm, false); - } - } + this.scrollToNode(node); - // Remove empty wrappers - var nodes = doc.getElementsByTagName(wrapper); - for (var i=nodes.length-1; i>=0; i--) { - var elm = nodes[i]; - var isEmpty = true; + return; + } - // Check if it has any attribs - var tmp = doc.createElement("body"); - tmp.appendChild(elm.cloneNode(false)); + rng = inst.getDoc().createRange(); - // Is empty span, remove it - tmp.innerHTML = tmp.innerHTML.replace(new RegExp('style=""|class=""', 'gi'), ''); - //tinyMCE.debug(tmp.innerHTML); - if (new RegExp('', 'gi').test(tmp.innerHTML)) { - for (var x=0; x 0) + rng.selectNodeContents(nodes[0]); + else + rng.selectNodeContents(node); + } else + rng.selectNode(node); - elm.parentNode.removeChild(elm); - } + if (collapse) { + // Special treatment of textnode collapse + if (!to_start && node.nodeType == 3) { + rng.setStart(node, node.nodeValue.length); + rng.setEnd(node, node.nodeValue.length); + } else + rng.collapse(to_start); } - // Re add the visual aids - if (scmd == "removeformat") - tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this); + sel.removeAllRanges(); + sel.addRange(rng); + } - tinyMCE.triggerNodeChange(); + this.scrollToNode(node); - break; + // Set selected element + tinyMCE.selectedElement = null; + if (node.nodeType == 1) + tinyMCE.selectedElement = node; + }, - case "FontName": - if (value == null) { - var s = this.getSel(); - - // Find font and select it - if (tinyMCE.isGecko && s.isCollapsed) { - var f = tinyMCE.getParentElement(this.getFocusElement(), "font"); - - if (f != null) - this.selectNode(f, false); - } - - // Remove format - this.getDoc().execCommand("RemoveFormat", false, null); - - // Collapse range if font was found - if (f != null && tinyMCE.isGecko) { - var r = this.getRng().cloneRange(); - r.collapse(true); - s.removeAllRanges(); - s.addRange(r); - } - } else - this.getDoc().execCommand('FontName', false, value); + scrollToNode : function(node) { + var inst = this.instance; + var pos, doc, scrollX, scrollY, height; + + // Scroll to node position + pos = tinyMCE.getAbsPosition(node); + doc = inst.getDoc(); + scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft; + scrollY = doc.body.scrollTop + doc.documentElement.scrollTop; + height = tinyMCE.isMSIE ? document.getElementById(inst.editorId).style.pixelHeight : inst.targetElement.clientHeight; + + // Only scroll if out of visible area + if (!tinyMCE.settings['auto_resize'] && !(pos.absTop > scrollY && pos.absTop < (scrollY - 25 + height))) + inst.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); + }, + + getSel : function() { + var inst = this.instance; - if (tinyMCE.isGecko) - window.setTimeout('tinyMCE.triggerNodeChange(false);', 1); + if (tinyMCE.isMSIE && !tinyMCE.isOpera) + return inst.getDoc().selection; - return; + return inst.contentWindow.getSelection(); + }, - case "FontSize": - this.getDoc().execCommand('FontSize', false, value); + getRng : function() { + var inst = this.instance; + var sel = this.getSel(); - if (tinyMCE.isGecko) - window.setTimeout('tinyMCE.triggerNodeChange(false);', 1); + if (sel == null) + return null; - return; + if (tinyMCE.isMSIE && !tinyMCE.isOpera) + return sel.createRange(); - case "forecolor": - this.getDoc().execCommand('forecolor', false, value); - break; + if (tinyMCE.isSafari && !sel.getRangeAt) + return '' + window.getSelection(); - case "HiliteColor": - if (tinyMCE.isGecko) { - this.setUseCSS(true); - this.getDoc().execCommand('hilitecolor', false, value); - this.setUseCSS(false); - } else - this.getDoc().execCommand('BackColor', false, value); - break; + return sel.getRangeAt(0); + }, - case "Cut": - case "Copy": - case "Paste": - var cmdFailed = false; - - // Try executing command - eval('try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}'); - - if (tinyMCE.isOpera && cmdFailed) - alert('Currently not supported by your browser, use keyboard shortcuts instead.'); - - // Alert error in gecko if command failed - if (tinyMCE.isGecko && cmdFailed) { - // Confirm more info - if (confirm(tinyMCE.getLang('lang_clipboard_msg'))) - window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', 'mceExternal'); + getFocusElement : function() { + var inst = this.instance; - return; - } else - tinyMCE.triggerNodeChange(); - break; + if (tinyMCE.isMSIE && !tinyMCE.isOpera) { + var doc = inst.getDoc(); + var rng = doc.selection.createRange(); - case "mceSetContent": - if (!value) - value = ""; - - // Call custom cleanup code - value = tinyMCE.storeAwayURLs(value); - value = tinyMCE._customCleanup(this, "insert_to_editor", value); - tinyMCE._setHTML(doc, value); - tinyMCE.setInnerHTML(doc.body, tinyMCE._cleanupHTML(this, doc, tinyMCE.settings, doc.body)); - this.convertAllRelativeURLs(); - tinyMCE.handleVisualAid(doc.body, true, this.visualAid, this); - tinyMCE._setEventsEnabled(doc.body, false); - return true; + // if (rng.collapse) + // rng.collapse(true); - case "mceLink": - var selectedText = ""; + var elm = rng.item ? rng.item(0) : rng.parentElement(); + } else { + if (inst.isHidden()) + return inst.getBody(); - if (tinyMCE.isMSIE) { - var rng = doc.selection.createRange(); - selectedText = rng.text; - } else - selectedText = this.getSel().toString(); + var sel = this.getSel(); + var rng = this.getRng(); - if (!tinyMCE.linkElement) { - if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0)) - return; + if (!sel || !rng) + return null; + + var elm = rng.commonAncestorContainer; + //var elm = (sel && sel.anchorNode) ? sel.anchorNode : null; + + // Handle selection a image or other control like element such as anchors + if (!rng.collapsed) { + // Is selection small + if (rng.startContainer == rng.endContainer) { + if (rng.startOffset - rng.endOffset < 2) { + if (rng.startContainer.hasChildNodes()) + elm = rng.startContainer.childNodes[rng.startOffset]; + } + } } - var href = "", target = "", title = "", onclick = "", action = "insert", style_class = ""; + // Get the element parent of the node + elm = tinyMCE.getParentElement(elm); - if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a") - tinyMCE.linkElement = tinyMCE.selectedElement; + //if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") + // elm = tinyMCE.selectedElement; + } - // Is anchor not a link - if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "") - tinyMCE.linkElement = null; + return elm; + } +}; - if (tinyMCE.linkElement) { - href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href'); - target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target'); - title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title'); - onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick'); - style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class'); +/* file:jscripts/tiny_mce/classes/TinyMCE_UndoRedo.class.js */ - // Try old onclick to if copy/pasted content - if (onclick == "") - onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick'); +function TinyMCE_UndoRedo(inst) { + this.instance = inst; + this.undoLevels = new Array(); + this.undoIndex = 0; + this.typingUndoIndex = -1; + this.undoRedo = true; +}; - onclick = tinyMCE.cleanupEventStr(onclick); +TinyMCE_UndoRedo.prototype = { + add : function(l) { + var b; - href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);"); + if (l) { + this.undoLevels[this.undoLevels.length] = l; + return true; + } - // Use mce_href if defined - mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href'); - if (mceRealHref != "") { - href = mceRealHref; + var inst = this.instance; - if (tinyMCE.getParam('convert_urls')) - href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);"); - } + if (this.typingUndoIndex != -1) { + this.undoIndex = this.typingUndoIndex; + // tinyMCE.debug("Override: " + this.undoIndex); + } - action = "update"; - } + var newHTML = tinyMCE.trim(inst.getBody().innerHTML); + if (this.undoLevels[this.undoIndex] && newHTML != this.undoLevels[this.undoIndex].content) { + //tinyMCE.debug(newHTML, this.undoLevels[this.undoIndex]); - if (this.settings['insertlink_callback']) { - var returnVal = eval(this.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);"); - if (returnVal && returnVal['href']) - tinyMCE.insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']); - } else { - tinyMCE.openWindow(this.insertLinkTemplate, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes"}); - } - break; + tinyMCE.dispatchCallback(inst, 'onchange_callback', 'onChange', inst); - case "mceImage": - var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = ""; - var title = "", onmouseover = "", onmouseout = "", action = "insert"; - var img = tinyMCE.imgElement; + // Time to compress + var customUndoLevels = tinyMCE.settings['custom_undo_redo_levels']; + if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) { + for (var i=0; i 0) { + this.undoIndex--; + tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content); + inst.repaint(); + if (inst.settings.custom_undo_redo_restore_selection) + inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark); + } - if (tinyMCE.getParam('convert_urls')) - src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);"); - } + // tinyMCE.debug("Undo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex); + }, - if (onmouseover != "") - onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);"); + redo : function() { + var inst = this.instance; - if (onmouseout != "") - onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);"); + tinyMCE.execCommand("mceEndTyping"); - action = "update"; - } + if (this.undoIndex < (this.undoLevels.length-1)) { + this.undoIndex++; + tinyMCE.setInnerHTML(inst.getBody(), this.undoLevels[this.undoIndex].content); + inst.repaint(); +// if (this.undoIndex > 0) +// inst.selection.moveToBookmark(this.undoLevels[this.undoIndex-1].bookmark); + if (inst.settings.custom_undo_redo_restore_selection) + inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark); + // tinyMCE.debug("Redo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex); + } - if (this.settings['insertimage_callback']) { - var returnVal = eval(this.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);"); - if (returnVal && returnVal['src']) - tinyMCE.insertImage(returnVal['src'], returnVal['alt'], returnVal['border'], returnVal['hspace'], returnVal['vspace'], returnVal['width'], returnVal['height'], returnVal['align'], returnVal['title'], returnVal['onmouseover'], returnVal['onmouseout']); - } else - tinyMCE.openWindow(this.insertImageTemplate, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"}); - break; + tinyMCE.triggerNodeChange(); + } +}; - case "mceCleanup": - tinyMCE._setHTML(this.contentDocument, this.getBody().innerHTML); - tinyMCE.setInnerHTML(this.getBody(), tinyMCE._cleanupHTML(this, this.contentDocument, this.settings, this.getBody(), this.visualAid)); - this.convertAllRelativeURLs(); - tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this); - tinyMCE._setEventsEnabled(this.getBody(), false); - this.repaint(); - tinyMCE.triggerNodeChange(); - break; - - case "mceReplaceContent": - this.getWin().focus(); - - var selectedText = ""; - - if (tinyMCE.isMSIE) { - var rng = doc.selection.createRange(); - selectedText = rng.text; - } else - selectedText = this.getSel().toString(); +/* file:jscripts/tiny_mce/classes/TinyMCE_ForceParagraphs.class.js */ - if (selectedText.length > 0) { - value = tinyMCE.replaceVar(value, "selection", selectedText); - tinyMCE.execCommand('mceInsertContent', false, value); +var TinyMCE_ForceParagraphs = { + _insertPara : function(inst, e) { + function isEmpty(para) { + function isEmptyHTML(html) { + return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == ""; } - tinyMCE.triggerNodeChange(); - break; + // Check for images + if (para.getElementsByTagName("img").length > 0) + return false; - case "mceSetAttribute": - if (typeof(value) == 'object') { - var targetElms = (typeof(value['targets']) == "undefined") ? "p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address" : value['targets']; - var targetNode = tinyMCE.getParentElement(this.getFocusElement(), targetElms); + // Check for tables + if (para.getElementsByTagName("table").length > 0) + return false; - if (targetNode) { - targetNode.setAttribute(value['name'], value['value']); - tinyMCE.triggerNodeChange(); - } + // Check for HRs + if (para.getElementsByTagName("hr").length > 0) + return false; + + // Check all textnodes + var nodes = tinyMCE.getNodeTree(para, new Array(), 3); + for (var i=0; i <" + blockName + "> "; + paraAfter = body.childNodes[1]; + } - case "mceAddUndoLevel": - if (tinyMCE.settings['custom_undo_redo'] && this.undoRedo) { - // tinyMCE.debug("add level"); - - if (this.typingUndoIndex != -1) { - this.undoIndex = this.typingUndoIndex; - // tinyMCE.debug("Override: " + this.undoIndex); - } - - var newHTML = tinyMCE.trim(this.getBody().innerHTML); - if (newHTML != this.undoLevels[this.undoIndex]) { - tinyMCE.executeCallback('onchange_callback', '_onchange', 0, this); - - // Time to compress - var customUndoLevels = tinyMCE.settings['custom_undo_redo_levels']; - if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) { - for (var i=0; i 0) { - this.undoIndex--; - tinyMCE.setInnerHTML(this.getBody(), this.undoLevels[this.undoIndex]); - this.repaint(); - } + // Check if it's a empty paragraph + if (isEmpty(paraBefore)) + paraBefore.innerHTML = " "; - // tinyMCE.debug("Undo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex); - tinyMCE.triggerNodeChange(); - } else - this.getDoc().execCommand(command, user_interface, value); - break; + // Check if it's a empty paragraph + if (isEmpty(paraAfter)) + paraAfter.innerHTML = " "; - case "Redo": - if (tinyMCE.settings['custom_undo_redo']) { - tinyMCE.execCommand("mceEndTyping"); + // Create a range around everything + var rng = doc.createRange(); - if (this.undoIndex < (this.undoLevels.length-1)) { - this.undoIndex++; - tinyMCE.setInnerHTML(this.getBody(), this.undoLevels[this.undoIndex]); - this.repaint(); - // tinyMCE.debug("Redo - undo levels:" + this.undoLevels.length + ", undo index: " + this.undoIndex); - } + if (!startChop.previousSibling && startChop.parentNode.nodeName.toUpperCase() == blockName) { + rng.setStartBefore(startChop.parentNode); + } else { + if (rngBefore.startContainer.nodeName.toUpperCase() == blockName && rngBefore.startOffset == 0) + rng.setStartBefore(rngBefore.startContainer); + else + rng.setStart(rngBefore.startContainer, rngBefore.startOffset); + } - tinyMCE.triggerNodeChange(); - } else - this.getDoc().execCommand(command, user_interface, value); - break; + if (!endChop.nextSibling && endChop.parentNode.nodeName.toUpperCase() == blockName) + rng.setEndAfter(endChop.parentNode); + else + rng.setEnd(rngAfter.endContainer, rngAfter.endOffset); - case "mceToggleVisualAid": - this.visualAid = !this.visualAid; - tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this); - tinyMCE.triggerNodeChange(); - break; + // Delete all contents and insert new paragraphs + rng.deleteContents(); + rng.insertNode(paraAfter); + rng.insertNode(paraBefore); + //tinyMCE.debug("2", paraBefore.innerHTML, paraAfter.innerHTML); + + // Normalize + paraAfter.normalize(); + paraBefore.normalize(); - case "Indent": - this.getDoc().execCommand(command, user_interface, value); - tinyMCE.triggerNodeChange(); - if (tinyMCE.isMSIE) { - var n = tinyMCE.getParentElement(this.getFocusElement(), "blockquote"); - do { - if (n && n.nodeName == "BLOCKQUOTE") { - n.removeAttribute("dir"); - n.removeAttribute("style"); - } - } while (n != null && (n = n.parentNode) != null); - } - break; + inst.selection.selectNode(paraAfter, true, true); - case "removeformat": - var text = this.getSelectedText(); + return true; + }, - if (tinyMCE.isOpera) { - this.getDoc().execCommand("RemoveFormat", false, null); - return; - } + _handleBackSpace : function(inst) { + var r = inst.getRng(), sn = r.startContainer, nv, s = false; - if (tinyMCE.isMSIE) { - try { - var rng = doc.selection.createRange(); - rng.execCommand("RemoveFormat", false, null); - } catch (e) { - // Do nothing - } + if (sn && sn.nextSibling && sn.nextSibling.nodeName == "BR") { + nv = sn.nodeValue; - this.execCommand("SetStyleInfo", false, {command : "removeformat"}); - } else { - this.getDoc().execCommand(command, user_interface, value); + // Handle if a backspace is pressed after a space character #bug 1466054 + if (nv != null && nv.length >= r.startOffset && nv.charAt(r.startOffset - 1) == ' ') + s = true; - this.execCommand("SetStyleInfo", false, {command : "removeformat"}); - } + // Only remove BRs if we are at the end of line #bug 1464152 + if (nv != null && r.startOffset == nv.length) + sn.nextSibling.parentNode.removeChild(sn.nextSibling); + } - // Remove class - if (text.length == 0) - this.execCommand("mceSetCSSClass", false, ""); + return s; + } +}; - tinyMCE.triggerNodeChange(); - break; +/* file:jscripts/tiny_mce/classes/TinyMCE_Layer.class.js */ - default: - this.getDoc().execCommand(command, user_interface, value); +function TinyMCE_Layer(id, bm) { + this.id = id; + this.blockerElement = null; + this.events = false; + this.element = null; + this.blockMode = typeof(bm) != 'undefined' ? bm : true; + this.doc = document; +}; - if (tinyMCE.isGecko) - window.setTimeout('tinyMCE.triggerNodeChange(false);', 1); - else - tinyMCE.triggerNodeChange(); - } +TinyMCE_Layer.prototype = { + moveRelativeTo : function(re, p) { + var rep = this.getAbsPosition(re); + var w = parseInt(re.offsetWidth); + var h = parseInt(re.offsetHeight); + var e = this.getElement(); + var ew = parseInt(e.offsetWidth); + var eh = parseInt(e.offsetHeight); + var x, y; - // Add undo level after modification - if (command != "mceAddUndoLevel" && command != "Undo" && command != "Redo" && command != "mceStartTyping" && command != "mceEndTyping") - tinyMCE.execCommand("mceAddUndoLevel"); -}; + switch (p) { + case "tl": + x = rep.absLeft; + y = rep.absTop; + break; -TinyMCEControl.prototype.queryCommandValue = function(command) { - try { - return this.getDoc().queryCommandValue(command); - } catch (ex) { - return null; - } -}; + case "tr": + x = rep.absLeft + w; + y = rep.absTop; + break; -TinyMCEControl.prototype.queryCommandState = function(command) { - return this.getDoc().queryCommandState(command); -}; + case "bl": + x = rep.absLeft; + y = rep.absTop + h; + break; -TinyMCEControl.prototype.onAdd = function(replace_element, form_element_name, target_document) { - var targetDoc = target_document ? target_document : document; + case "br": + x = rep.absLeft + w; + y = rep.absTop + h; + break; - this.targetDoc = targetDoc; + case "cc": + x = rep.absLeft + (w / 2) - (ew / 2); + y = rep.absTop + (h / 2) - (eh / 2); + break; + } - tinyMCE.themeURL = tinyMCE.baseURL + "/themes/" + this.settings['theme']; - this.settings['themeurl'] = tinyMCE.themeURL; + this.moveTo(x, y); + }, - if (!replace_element) { - alert("Error: Could not find the target element."); - return false; - } + moveBy : function(x, y) { + var e = this.getElement(); + this.moveTo(parseInt(e.style.left) + x, parseInt(e.style.top) + y); + }, + + moveTo : function(x, y) { + var e = this.getElement(); + + e.style.left = x + "px"; + e.style.top = y + "px"; + + this.updateBlocker(); + }, + + resizeBy : function(w, h) { + var e = this.getElement(); + this.resizeTo(parseInt(e.style.width) + w, parseInt(e.style.height) + h); + }, + + resizeTo : function(w, h) { + var e = this.getElement(); + + if (w != null) + e.style.width = w + "px"; + + if (h != null) + e.style.height = h + "px"; + + this.updateBlocker(); + }, + + show : function() { + this.getElement().style.display = 'block'; + this.updateBlocker(); + }, + + hide : function() { + this.getElement().style.display = 'none'; + this.updateBlocker(); + }, + + isVisible : function() { + return this.getElement().style.display == 'block'; + }, + + getElement : function() { + if (!this.element) + this.element = this.doc.getElementById(this.id); + + return this.element; + }, + + setBlockMode : function(s) { + this.blockMode = s; + }, + + updateBlocker : function() { + var e, b, x, y, w, h; + + b = this.getBlocker(); + if (b) { + if (this.blockMode) { + e = this.getElement(); + x = this.parseInt(e.style.left); + y = this.parseInt(e.style.top); + w = this.parseInt(e.offsetWidth); + h = this.parseInt(e.offsetHeight); + + b.style.left = x + 'px'; + b.style.top = y + 'px'; + b.style.width = w + 'px'; + b.style.height = h + 'px'; + b.style.display = e.style.display; + } else + b.style.display = 'none'; + } + }, - var templateFunction = tinyMCE._getThemeFunction('_getInsertLinkTemplate'); - if (eval("typeof(" + templateFunction + ")") != 'undefined') - this.insertLinkTemplate = eval(templateFunction + '(this.settings);'); - - var templateFunction = tinyMCE._getThemeFunction('_getInsertImageTemplate'); - if (eval("typeof(" + templateFunction + ")") != 'undefined') - this.insertImageTemplate = eval(templateFunction + '(this.settings);'); - - var templateFunction = tinyMCE._getThemeFunction('_getEditorTemplate'); - if (eval("typeof(" + templateFunction + ")") == 'undefined') { - alert("Error: Could not find the template function: " + templateFunction); - return false; - } + getBlocker : function() { + var d, b; - var editorTemplate = eval(templateFunction + '(this.settings, this.editorId);'); + if (!this.blockerElement && this.blockMode) { + d = this.doc; + b = d.createElement("iframe"); - var deltaWidth = editorTemplate['delta_width'] ? editorTemplate['delta_width'] : 0; - var deltaHeight = editorTemplate['delta_height'] ? editorTemplate['delta_height'] : 0; - var html = '' + editorTemplate['html']; + b.style.cssText = 'display: none; position: absolute; left: 0; top: 0'; + b.src = 'javascript:false;'; + b.frameBorder = '0'; + b.scrolling = 'no'; - var templateFunction = tinyMCE._getThemeFunction('_handleNodeChange', true); - if (eval("typeof(" + templateFunction + ")") != 'undefined') - this.settings['handleNodeChangeCallback'] = templateFunction; + d.body.appendChild(b); + this.blockerElement = b; + } - html = tinyMCE.replaceVar(html, "editor_id", this.editorId); - this.settings['default_document'] = tinyMCE.baseURL + "/blank.htm"; + return this.blockerElement; + }, - this.settings['old_width'] = this.settings['width']; - this.settings['old_height'] = this.settings['height']; + getAbsPosition : function(n) { + var p = {absLeft : 0, absTop : 0}; - // Set default width, height - if (this.settings['width'] == -1) - this.settings['width'] = replace_element.offsetWidth; + while (n) { + p.absLeft += n.offsetLeft; + p.absTop += n.offsetTop; + n = n.offsetParent; + } - if (this.settings['height'] == -1) - this.settings['height'] = replace_element.offsetHeight; + return p; + }, - // Try the style width - if (this.settings['width'] == 0) - this.settings['width'] = replace_element.style.width; + create : function(n, c, p) { + var d = this.doc, e = d.createElement(n); - // Try the style height - if (this.settings['height'] == 0) - this.settings['height'] = replace_element.style.height; + e.setAttribute('id', this.id); - // If no width/height then default to 320x240, better than nothing - if (this.settings['width'] == 0) - this.settings['width'] = 320; + if (c) + e.className = c; - if (this.settings['height'] == 0) - this.settings['height'] = 240; + if (!p) + p = d.body; - this.settings['area_width'] = parseInt(this.settings['width']); - this.settings['area_height'] = parseInt(this.settings['height']); - this.settings['area_width'] += deltaWidth; - this.settings['area_height'] += deltaHeight; + p.appendChild(e); - // Special % handling - if (("" + this.settings['width']).indexOf('%') != -1) - this.settings['area_width'] = "100%"; + return this.element = e; + }, - if (("" + this.settings['height']).indexOf('%') != -1) - this.settings['area_height'] = "100%"; + parseInt : function(s) { + if (s == null || s == '') + return 0; - if (("" + replace_element.style.width).indexOf('%') != -1) { - this.settings['width'] = replace_element.style.width; - this.settings['area_width'] = "100%"; + return parseInt(s); } +}; - if (("" + replace_element.style.height).indexOf('%') != -1) { - this.settings['height'] = replace_element.style.height; - this.settings['area_height'] = "100%"; - } +/* file:jscripts/tiny_mce/classes/TinyMCE_Menu.class.js */ - html = tinyMCE.applyTemplate(html); +function TinyMCE_Menu() { + var id; - this.settings['width'] = this.settings['old_width']; - this.settings['height'] = this.settings['old_height']; + if (typeof(tinyMCE.menuCounter) == "undefined") + tinyMCE.menuCounter = 0; - this.visualAid = this.settings['visual']; - this.formTargetElementId = form_element_name; + id = "mc_menu_" + tinyMCE.menuCounter++; - // Get replace_element contents - if (replace_element.nodeName == "TEXTAREA" || replace_element.nodeName == "INPUT") - this.startContent = replace_element.value; - else - this.startContent = replace_element.innerHTML; + TinyMCE_Layer.call(this, id, true); - // If not text area - if (replace_element.nodeName.toLowerCase() != "textarea") { - this.oldTargetElement = replace_element.cloneNode(true); - - // Debug mode - if (tinyMCE.settings['debug']) - html += ''; - else - html += ''; + this.id = id; + this.items = new Array(); + this.needsUpdate = true; +}; - html += ''; +// Extends the TinyMCE_Layer class +TinyMCE_Menu.prototype = tinyMCE.extend(TinyMCE_Layer.prototype, { + init : function(s) { + var n; - // Output HTML and set editable - if (!tinyMCE.isMSIE) { - var rng = replace_element.ownerDocument.createRange(); - rng.setStartBefore(replace_element); + // Default params + this.settings = { + separator_class : 'mceMenuSeparator', + title_class : 'mceMenuTitle', + disabled_class : 'mceMenuDisabled', + menu_class : 'mceMenu', + drop_menu : true + }; - var fragment = rng.createContextualFragment(html); - replace_element.parentNode.replaceChild(fragment, replace_element); - } else - replace_element.outerHTML = html; - } else { - html += ''; + for (n in s) + this.settings[n] = s[n]; - // Just hide the textarea element - this.oldTargetElement = replace_element; + this.create('div', this.settings.menu_class); + }, - if (!tinyMCE.settings['debug']) - this.oldTargetElement.style.display = "none"; + clear : function() { + this.items = new Array(); + }, - // Output HTML and set editable - if (!tinyMCE.isMSIE) { - var rng = replace_element.ownerDocument.createRange(); - rng.setStartBefore(replace_element); + addTitle : function(t) { + this.add({type : 'title', text : t}); + }, - var fragment = rng.createContextualFragment(html); + addDisabled : function(t) { + this.add({type : 'disabled', text : t}); + }, - if (tinyMCE.isGecko) - tinyMCE.insertAfter(fragment, replace_element); - else - replace_element.parentNode.insertBefore(fragment, replace_element); - } else - replace_element.insertAdjacentHTML("beforeBegin", html); - } + addSeparator : function() { + this.add({type : 'separator'}); + }, - // Setup iframe - var dynamicIFrame = false; - var tElm = targetDoc.getElementById(this.editorId); + addItem : function(t, js) { + this.add({text : t, js : js}); + }, - if (!tinyMCE.isMSIE) { - if (tElm && tElm.nodeName.toLowerCase() == "span") { - tElm = tinyMCE._createIFrame(tElm); - dynamicIFrame = true; - } + add : function(mi) { + this.items[this.items.length] = mi; + this.needsUpdate = true; + }, - this.targetElement = tElm; - this.iframeElement = tElm; - this.contentDocument = tElm.contentDocument; - this.contentWindow = tElm.contentWindow; + update : function() { + var e = this.getElement(), h = '', i, t, m = this.items, s = this.settings; - //this.getDoc().designMode = "on"; - } else { - if (tElm && tElm.nodeName.toLowerCase() == "span") - tElm = tinyMCE._createIFrame(tElm); - else - tElm = targetDoc.frames[this.editorId]; + if (this.settings.drop_menu) + h += ''; - this.targetElement = tElm; - this.iframeElement = targetDoc.getElementById(this.editorId); + h += '
      - - - + + + + +
      +
      + +
      {$lang_insert_link_title}
      - - + + - - + ','');html=tinyMCE.regexpReplace(html,'

      \\s*
      \\s*

      ','

       

      ');html=tinyMCE.regexpReplace(html,'

      \\s* \\s*
      \\s* \\s*

      ','

       

      ');html=tinyMCE.regexpReplace(html,'

      \\s* \\s*
      \\s*

      ','

       

      ');html=tinyMCE.regexpReplace(html,'

      \\s*
      \\s* \\s*

      ','

       

      ');html=html.replace(new RegExp('(.*?)','gi'),'$1');if(!tinyMCE.isMSIE)html=html.replace(new RegExp('','g'),"");if(tinyMCE.settings['remove_linebreaks'])html=html.replace(new RegExp('\r|\n','g'),' ');if(tinyMCE.getParam('apply_source_formatting')){html=html.replace(new RegExp('<(p|div)([^>]*)>','g'),"\n<$1$2>\n");html=html.replace(new RegExp('<\/(p|div)([^>]*)>','g'),"\n\n");html=html.replace(new RegExp('
      ','g'),"
      \n");}if(tinyMCE.settings['force_br_newlines']){var re=new RegExp('

       

      ','g');html=html.replace(re,"
      ");}if(tinyMCE.isGecko&&tinyMCE.settings['remove_lt_gt']){var re=new RegExp('<>','g');html=html.replace(re,"");}html=tinyMCE._customCleanup(inst,on_save?"get_from_editor":"insert_to_editor",html);var chk=tinyMCE.regexpReplace(html,"[ \t\r\n]","").toLowerCase();if(chk=="
      "||chk=="
      "||chk=="

       

      "||chk=="

       

      "||chk=="

      ")html="";if(tinyMCE.settings["preformatted"])return "
      "+html+"
      ";return html;};TinyMCE.prototype.insertLink=function(href,target,title,onclick,style_class){tinyMCE.execCommand('mceBeginUndoLevel');if(this.selectedInstance&&this.selectedElement&&this.selectedElement.nodeName.toLowerCase()=="img"){var doc=this.selectedInstance.getDoc();var linkElement=tinyMCE.getParentElement(this.selectedElement,"a");var newLink=false;if(!linkElement){linkElement=doc.createElement("a");newLink=true;}var mhref=href;var thref=eval(tinyMCE.settings['urlconverter_callback']+"(href, linkElement);");mhref=tinyMCE.getParam('convert_urls')?href:mhref;tinyMCE.setAttrib(linkElement,'href',thref);tinyMCE.setAttrib(linkElement,'mce_href',mhref);tinyMCE.setAttrib(linkElement,'target',target);tinyMCE.setAttrib(linkElement,'title',title);tinyMCE.setAttrib(linkElement,'onclick',onclick);tinyMCE.setAttrib(linkElement,'class',style_class);if(newLink){linkElement.appendChild(this.selectedElement.cloneNode(true));this.selectedElement.parentNode.replaceChild(linkElement,this.selectedElement);}return;}if(!this.linkElement&&this.selectedInstance){if(tinyMCE.isSafari){tinyMCE.execCommand("mceInsertContent",false,''+this.selectedInstance.getSelectedHTML()+'');}else this.selectedInstance.contentDocument.execCommand("createlink",false,tinyMCE.uniqueURL);tinyMCE.linkElement=this.getElementByAttributeValue(this.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);var elementArray=this.getElementsByAttributeValue(this.selectedInstance.contentDocument.body,"a","href",tinyMCE.uniqueURL);for(var i=0;i';tinyMCE.execCommand("mceInsertContent",false,html);}else{if(!this.imgElement&&this.selectedInstance){if(tinyMCE.isSafari)tinyMCE.execCommand("mceInsertContent",false,'');else this.selectedInstance.contentDocument.execCommand("insertimage",false,tinyMCE.uniqueURL);tinyMCE.imgElement=this.getElementByAttributeValue(this.selectedInstance.contentDocument.body,"img","src",tinyMCE.uniqueURL);}}if(this.imgElement){var needsRepaint=false;var msrc=src;src=eval(tinyMCE.settings['urlconverter_callback']+"(src, tinyMCE.imgElement);");if(tinyMCE.getParam('convert_urls'))msrc=src;if(onmouseover&&onmouseover!="")onmouseover="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseover, tinyMCE.imgElement);")+"';";if(onmouseout&&onmouseout!="")onmouseout="this.src='"+eval(tinyMCE.settings['urlconverter_callback']+"(onmouseout, tinyMCE.imgElement);")+"';";if(typeof(title)=="undefined")title=alt;if(width!=this.imgElement.getAttribute("width")||height!=this.imgElement.getAttribute("height")||align!=this.imgElement.getAttribute("align"))needsRepaint=true;tinyMCE.setAttrib(this.imgElement,'src',src);tinyMCE.setAttrib(this.imgElement,'mce_src',msrc);tinyMCE.setAttrib(this.imgElement,'alt',alt);tinyMCE.setAttrib(this.imgElement,'title',title);tinyMCE.setAttrib(this.imgElement,'align',align);tinyMCE.setAttrib(this.imgElement,'border',border,true);tinyMCE.setAttrib(this.imgElement,'hspace',hspace,true);tinyMCE.setAttrib(this.imgElement,'vspace',vspace,true);tinyMCE.setAttrib(this.imgElement,'width',width,true);tinyMCE.setAttrib(this.imgElement,'height',height,true);tinyMCE.setAttrib(this.imgElement,'onmouseover',onmouseover);tinyMCE.setAttrib(this.imgElement,'onmouseout',onmouseout);if(width&&width!="")this.imgElement.style.pixelWidth=width;if(height&&height!="")this.imgElement.style.pixelHeight=height;if(needsRepaint)tinyMCE.selectedInstance.repaint();}tinyMCE.execCommand('mceEndUndoLevel');};TinyMCE.prototype.getElementByAttributeValue=function(node,element_name,attrib,value){var elements=this.getElementsByAttributeValue(node,element_name,attrib,value);if(elements.length==0)return null;return elements[0];};TinyMCE.prototype.getElementsByAttributeValue=function(node,element_name,attrib,value){var elements=new Array();if(node&&node.nodeName.toLowerCase()==element_name){if(node.getAttribute(attrib)&&node.getAttribute(attrib).indexOf(value)!=-1)elements[elements.length]=node;}if(node&&node.hasChildNodes()){for(var x=0,n=node.childNodes.length;x=strTok2.length){for(var i=0;i=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(strTok1.length=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(breakPoint==1)return targetURL.path;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outPath+="../";for(var i=breakPoint-1;i=0;i--){if(baseURLParts[i].length==0)continue;newBaseURLParts[newBaseURLParts.length]=baseURLParts[i];}baseURLParts=newBaseURLParts.reverse();var newRelURLParts=new Array();var numBack=0;for(var i=relURLParts.length-1;i>=0;i--){if(relURLParts[i].length==0||relURLParts[i]==".")continue;if(relURLParts[i]=='..'){numBack++;continue;}if(numBack>0){numBack--;continue;}newRelURLParts[newRelURLParts.length]=relURLParts[i];}relURLParts=newRelURLParts.reverse();var len=baseURLParts.length-numBack;var absPath=(len<=0?"":"/")+baseURLParts.slice(0,len).join('/')+"/"+relURLParts.join('/');var start="",end="";relURL.protocol=baseURL.protocol;relURL.host=baseURL.host;relURL.port=baseURL.port;if(relURL.path.charAt(relURL.path.length-1)=="/")absPath+="/";relURL.path=absPath;return TinyMCE.prototype.serializeURL(relURL);};TinyMCE.prototype.getParam=function(name,default_value,strip_whitespace,split_chr){var value=(typeof(this.settings[name])=="undefined")?default_value:this.settings[name];if(value=="true"||value=="false")return(value=="true");if(strip_whitespace)value=tinyMCE.regexpReplace(value,"[ \t\r\n]","");if(typeof(split_chr)!="undefined"&&split_chr!=null){value=value.split(split_chr);var outArray=new Array();for(var i=0;i0);if(tinyMCE.settings['custom_undo_redo']){undoIndex=inst.undoIndex;undoLevels=inst.undoLevels.length;}tinyMCE.executeCallback('handleNodeChangeCallback','_handleNodeChange',0,editorId,elm,undoIndex,undoLevels,inst.visualAid,anySelection,setup_content);}}if(this.selectedInstance&&(typeof(focus)=="undefined"||focus))this.selectedInstance.contentWindow.focus();};TinyMCE.prototype._customCleanup=function(inst,type,content){var customCleanup=tinyMCE.settings['cleanup_callback'];if(customCleanup!=""&&eval("typeof("+customCleanup+")")!="undefined")content=eval(customCleanup+"(type, content, inst);");var plugins=tinyMCE.getParam('plugins','',true,',');for(var i=0;i0)className+=" ";className+=classNames[i];}return className;};TinyMCE.prototype.handleVisualAid=function(el,deep,state,inst){if(!el)return;var tableElement=null;switch(el.nodeName){case "TABLE":var oldW=el.style.width;var oldH=el.style.height;var bo=tinyMCE.getAttrib(el,"border");bo=bo==""||bo=="0"?true:false;tinyMCE.setAttrib(el,"class",tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el,"class"),state&&bo));el.style.width=oldW;el.style.height=oldH;for(var y=0;y0){tinyMCE.setAttrib(s[i],'size',fSize);s[i].style.fontSize='';}var fFace=s[i].style.fontFamily;if(fFace!=null&&fFace!=""){tinyMCE.setAttrib(s[i],'face',fFace);s[i].style.fontFamily='';}var fColor=s[i].style.color;if(fColor!=null&&fColor!=""){tinyMCE.setAttrib(s[i],'color',tinyMCE.convertRGBToHex(fColor));s[i].style.color='';}}};TinyMCE.prototype.convertFontsToSpans=function(doc){var sizes=tinyMCE.getParam('font_size_style_values').replace(/\s+/,'').split(',');var h=doc.body.innerHTML;h=h.replace(/0&&fSize<8){if(fsClasses!=null)tinyMCE.setAttrib(s[i],'class',fsClasses[fSize-1]);else s[i].style.fontSize=sizes[fSize-1];}s[i].removeAttribute('size');}if(fFace!=""){s[i].style.fontFamily=fFace;s[i].removeAttribute('face');}if(fColor!=""){s[i].style.color=fColor;s[i].removeAttribute('color');}}};TinyMCE.prototype.setInnerHTML=function(e,h){if(tinyMCE.isMSIE&&!tinyMCE.isOpera){e.innerHTML=tinyMCE.uniqueTag+h;e.firstChild.removeNode(true);}else{h=this.fixGeckoBaseHREFBug(1,e,h);e.innerHTML=h;this.fixGeckoBaseHREFBug(2,e,h);}};TinyMCE.prototype.fixGeckoBaseHREFBug=function(m,e,h){if(tinyMCE.isGecko){if(m==1){h=h.replace(/\ssrc=/gi," xsrc=");h=h.replace(/\shref=/gi," xhref=");return h;}else{if(h.indexOf(' xsrc')!=-1){var n=e.getElementsByTagName("img");for(var i=0;i=0;x--)tinyMCE.insertAfter(cn[x],an[i]);}}};TinyMCE.prototype._setHTML=function(doc,html_content){html_content=tinyMCE.cleanupHTMLCode(html_content);try{tinyMCE.setInnerHTML(doc.body,html_content);}catch(e){if(this.isMSIE)doc.body.createTextRange().pasteHTML(html_content);}if(tinyMCE.isMSIE&&tinyMCE.settings['fix_content_duplication']){var paras=doc.getElementsByTagName("P");for(var i=0;i<\/o:p>","
      ");html=tinyMCE.regexpReplace(html," <\/o:p>","");html=tinyMCE.regexpReplace(html,"","");html=tinyMCE.regexpReplace(html,"

      <\/p>","");html=tinyMCE.regexpReplace(html,"

      <\/p>\r\n

      <\/p>","");html=tinyMCE.regexpReplace(html,"

       <\/p>","
      ");html=tinyMCE.regexpReplace(html,"

      \s*(

      \s*)?","

      ");html=tinyMCE.regexpReplace(html,"<\/p>\s*(<\/p>\s*)?","

      ");}tinyMCE.setInnerHTML(doc.body,html);}tinyMCE.cleanupAnchors(doc);if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);};TinyMCE.prototype.getImageSrc=function(str){var pos=-1;if(!str)return "";if((pos=str.indexOf('this.src='))!=-1){var src=str.substring(pos+10);src=src.substring(0,src.indexOf('\''));return src;}return "";};TinyMCE.prototype._getElementById=function(element_id){var elm=document.getElementById(element_id);if(!elm){for(var j=0;j0){for(var x=0;x0)tinyMCE.cssClasses=output;return output;};TinyMCE.prototype.regexpReplace=function(in_str,reg_exp,replace_str,opts){if(in_str==null)return in_str;if(typeof(opts)=="undefined")opts='g';var re=new RegExp(reg_exp,opts);return in_str.replace(re,replace_str);};TinyMCE.prototype.trim=function(str){return str.replace(/^\s*|\s*$/g,"");};TinyMCE.prototype.cleanupEventStr=function(str){str=""+str;str=str.replace('function anonymous()\n{\n','');str=str.replace('\n}','');str=str.replace(/^return true;/gi,'');return str;};TinyMCE.prototype.getAbsPosition=function(node){var pos=new Object();pos.absLeft=pos.absTop=0;var parentNode=node;while(parentNode){pos.absLeft+=parentNode.offsetLeft;pos.absTop+=parentNode.offsetTop;parentNode=parentNode.offsetParent;}return pos;};TinyMCE.prototype.getControlHTML=function(control_name){var themePlugins=tinyMCE.getParam('plugins','',true,',');var templateFunction;for(var i=themePlugins.length;i>=0;i--){templateFunction='TinyMCE_'+themePlugins[i]+"_getControlHTML";if(eval("typeof("+templateFunction+")")!='undefined'){var html=eval(templateFunction+"('"+control_name+"');");if(html!="")return tinyMCE.replaceVar(html,"pluginurl",tinyMCE.baseURL+"/plugins/"+themePlugins[i]);}}return eval('TinyMCE_'+tinyMCE.settings['theme']+"_getControlHTML"+"('"+control_name+"');");};TinyMCE.prototype._themeExecCommand=function(editor_id,element,command,user_interface,value){var themePlugins=tinyMCE.getParam('plugins','',true,',');var templateFunction;for(var i=themePlugins.length;i>=0;i--){templateFunction='TinyMCE_'+themePlugins[i]+"_execCommand";if(eval("typeof("+templateFunction+")")!='undefined'){if(eval(templateFunction+"(editor_id, element, command, user_interface, value);"))return true;}}templateFunction='TinyMCE_'+tinyMCE.settings['theme']+"_execCommand";if(eval("typeof("+templateFunction+")")!='undefined')return eval(templateFunction+"(editor_id, element, command, user_interface, value);");return false;};TinyMCE.prototype._getThemeFunction=function(suffix,skip_plugins){if(skip_plugins)return 'TinyMCE_'+tinyMCE.settings['theme']+suffix;var themePlugins=tinyMCE.getParam('plugins','',true,',');var templateFunction;for(var i=themePlugins.length;i>=0;i--){templateFunction='TinyMCE_'+themePlugins[i]+suffix;if(eval("typeof("+templateFunction+")")!='undefined')return templateFunction;}return 'TinyMCE_'+tinyMCE.settings['theme']+suffix;};TinyMCE.prototype.isFunc=function(func_name){if(func_name==null||func_name=="")return false;return eval("typeof("+func_name+")")!="undefined";};TinyMCE.prototype.exec=function(func_name,args){var str=func_name+'(';for(var i=3;i';document.body.appendChild(debugDiv);elm=document.getElementById("tinymce_debug");}var args=this.debug.arguments;for(var i=0;i1&&tinyMCE.currentConfig!=this.settings['index']){tinyMCE.settings=this.settings;tinyMCE.currentConfig=this.settings['index'];}};TinyMCEControl.prototype.convertAllRelativeURLs=function(){var body=this.getBody();var elms=body.getElementsByTagName("img");for(var i=0;i0)rng.selectNodeContents(nodes[0]);else rng.selectNodeContents(node);}else rng.selectNode(node);if(collapse){if(!to_start&&node.nodeType==3){rng.setStart(node,node.nodeValue.length);rng.setEnd(node,node.nodeValue.length);}else rng.collapse(to_start);}sel.removeAllRanges();sel.addRange(rng);}this.scrollToNode(node);tinyMCE.selectedElement=null;if(node.nodeType==1)tinyMCE.selectedElement=node;};TinyMCEControl.prototype.scrollToNode=function(node){var pos=tinyMCE.getAbsPosition(node);var doc=this.getDoc();var scrollX=doc.body.scrollLeft+doc.documentElement.scrollLeft;var scrollY=doc.body.scrollTop+doc.documentElement.scrollTop;var height=tinyMCE.isMSIE?document.getElementById(this.editorId).style.pixelHeight:this.targetElement.clientHeight;if(!tinyMCE.settings['auto_resize']&&!(pos.absTop>scrollY&&pos.absTop<(scrollY-25+height)))this.contentWindow.scrollTo(pos.absLeft,pos.absTop-height+25);};TinyMCEControl.prototype.getBody=function(){return this.getDoc().body;};TinyMCEControl.prototype.getDoc=function(){return this.contentWindow.document;};TinyMCEControl.prototype.getWin=function(){return this.contentWindow;};TinyMCEControl.prototype.getSel=function(){if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return this.getDoc().selection;var sel=this.contentWindow.getSelection();if(tinyMCE.isSafari&&!sel.getRangeAt){var newSel=new Object();var doc=this.getDoc();function getRangeAt(idx){var rng=new Object();rng.startContainer=this.focusNode;rng.endContainer=this.anchorNode;rng.commonAncestorContainer=this.focusNode;rng.createContextualFragment=function(html){if(html.charAt(0)=='<'){var elm=doc.createElement("div");elm.innerHTML=html;return elm.firstChild;}return doc.createTextNode("UNSUPPORTED, DUE TO LIMITATIONS IN SAFARI!");};rng.deleteContents=function(){doc.execCommand("Delete",false,"");};return rng;}newSel.focusNode=sel.baseNode;newSel.focusOffset=sel.baseOffset;newSel.anchorNode=sel.extentNode;newSel.anchorOffset=sel.extentOffset;newSel.getRangeAt=getRangeAt;newSel.text=""+sel;newSel.realSelection=sel;newSel.toString=function(){return this.text;};return newSel;}return sel;};TinyMCEControl.prototype.getRng=function(){var sel=this.getSel();if(sel==null)return null;if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return sel.createRange();if(tinyMCE.isSafari){var rng=this.getDoc().createRange();var sel=this.getSel().realSelection;rng.setStart(sel.baseNode,sel.baseOffset);rng.setEnd(sel.extentNode,sel.extentOffset);return rng;}return this.getSel().getRangeAt(0);};TinyMCEControl.prototype._insertPara=function(e){function isEmpty(para){function isEmptyHTML(html){return html.replace(new RegExp('[ \t\r\n]+','g'),'').toLowerCase()=="";}if(para.getElementsByTagName("img").length>0)return false;if(para.getElementsByTagName("table").length>0)return false;if(para.getElementsByTagName("hr").length>0)return false;var nodes=tinyMCE.getNodeTree(para,new Array(),3);for(var i=0;i <"+blockName+"> ";paraAfter=body.childNodes[1];}this.selectNode(paraAfter,true,true);return true;}if(startChop.nodeName==blockName)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);rngBefore.setEnd(startNode,startOffset);paraBefore.appendChild(rngBefore.cloneContents());rngAfter.setEndAfter(endChop);rngAfter.setStart(endNode,endOffset);var contents=rngAfter.cloneContents();if(contents.firstChild&&contents.firstChild.nodeName==blockName){paraAfter.innerHTML=contents.firstChild.innerHTML;}else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML=" ";if(isEmpty(paraAfter))paraAfter.innerHTML=" ";var rng=doc.createRange();if(!startChop.previousSibling&&startChop.parentNode.nodeName.toUpperCase()==blockName){rng.setStartBefore(startChop.parentNode);}else{if(rngBefore.startContainer.nodeName.toUpperCase()==blockName&&rngBefore.startOffset==0)rng.setStartBefore(rngBefore.startContainer);else rng.setStart(rngBefore.startContainer,rngBefore.startOffset);}if(!endChop.nextSibling&&endChop.parentNode.nodeName.toUpperCase()==blockName)rng.setEndAfter(endChop.parentNode);else rng.setEnd(rngAfter.endContainer,rngAfter.endOffset);rng.deleteContents();rng.insertNode(paraAfter);rng.insertNode(paraBefore);paraAfter.normalize();paraBefore.normalize();this.selectNode(paraAfter,true,true);return true;};TinyMCEControl.prototype._handleBackSpace=function(evt_type){var doc=this.getDoc();var sel=this.getSel();if(sel==null)return false;var rng=sel.getRangeAt(0);var node=rng.startContainer;var elm=node.nodeType==3?node.parentNode:node;if(node==null)return;if(elm&&elm.nodeName==""){var para=doc.createElement("p");while(elm.firstChild)para.appendChild(elm.firstChild);elm.parentNode.insertBefore(para,elm);elm.parentNode.removeChild(elm);var rng=rng.cloneRange();rng.setStartBefore(node.nextSibling);rng.setEndAfter(node.nextSibling);rng.extractContents();this.selectNode(node.nextSibling,true,true);}var para=tinyMCE.getParentBlockElement(node);if(para!=null&¶.nodeName.toLowerCase()=='p'&&evt_type=="keypress"){var htm=para.innerHTML;var block=tinyMCE.getParentBlockElement(node);if(htm==""||htm==" "||block.nodeName.toLowerCase()=="li"){var prevElm=para.previousSibling;while(prevElm!=null&&prevElm.nodeType!=1)prevElm=prevElm.previousSibling;if(prevElm==null)return false;var nodes=tinyMCE.getNodeTree(prevElm,new Array(),3);var lastTextNode=nodes.length==0?null:nodes[nodes.length-1];if(lastTextNode!=null)this.selectNode(lastTextNode,true,false,false);para.parentNode.removeChild(para);return true;}}return false;};TinyMCEControl.prototype._insertSpace=function(){return true;};TinyMCEControl.prototype.autoResetDesignMode=function(){if(!tinyMCE.isMSIE&&tinyMCE.settings['auto_reset_designmode']&&this.isHidden())eval('try { this.getDoc().designMode = "On"; } catch(e) {}');};TinyMCEControl.prototype.isHidden=function(){if(tinyMCE.isMSIE)return false;var sel=this.getSel();return(!sel||!sel.rangeCount||sel.rangeCount==0);};TinyMCEControl.prototype.isDirty=function(){return this.startContent!=tinyMCE.trim(this.getBody().innerHTML)&&!tinyMCE.isNotDirty;};TinyMCEControl.prototype._mergeElements=function(scmd,pa,ch,override){if(scmd=="removeformat"){pa.className="";pa.style.cssText="";ch.className="";ch.style.cssText="";return;}var st=tinyMCE.parseStyle(tinyMCE.getAttrib(pa,"style"));var stc=tinyMCE.parseStyle(tinyMCE.getAttrib(ch,"style"));var className=tinyMCE.getAttrib(pa,"class");className+=" "+tinyMCE.getAttrib(ch,"class");if(override){for(var n in st){if(typeof(st[n])=='function')continue;stc[n]=st[n];}}else{for(var n in stc){if(typeof(stc[n])=='function')continue;st[n]=stc[n];}}tinyMCE.setAttrib(pa,"style",tinyMCE.serializeStyle(st));tinyMCE.setAttrib(pa,"class",tinyMCE.trim(className));ch.className="";ch.style.cssText="";ch.removeAttribute("class");ch.removeAttribute("style");};TinyMCEControl.prototype.setUseCSS=function(b){var doc=this.getDoc();try{doc.execCommand("useCSS",false,!b);}catch(ex){}try{doc.execCommand("styleWithCSS",false,b);}catch(ex){}if(!tinyMCE.getParam("table_inline_editing"))try{doc.execCommand('enableInlineTableEditing',false,"false");}catch(ex){}if(!tinyMCE.getParam("object_resizing"))try{doc.execCommand('enableObjectResizing',false,"false");}catch(ex){}};TinyMCEControl.prototype.execCommand=function(command,user_interface,value){var doc=this.getDoc();var win=this.getWin();var focusElm=this.getFocusElement();if(this.lastSafariSelection&&!new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel','gi').test(command)){this.moveToBookmark(this.lastSafariSelection);tinyMCE.selectedElement=this.lastSafariSelectedElement;}if(!tinyMCE.isMSIE&&!this.useCSS){this.setUseCSS(false);this.useCSS=true;}this.contentDocument=doc;if(tinyMCE._themeExecCommand(this.editorId,this.getBody(),command,user_interface,value))return;if(focusElm&&focusElm.nodeName=="IMG"){var align=focusElm.getAttribute('align');var img=command=="JustifyCenter"?focusElm.cloneNode(false):focusElm;switch(command){case "JustifyLeft":if(align=='left')img.removeAttribute('align');else img.setAttribute('align','left');var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case "JustifyCenter":img.removeAttribute('align');var div=tinyMCE.getParentElement(focusElm,"div");if(div&&div.style.textAlign=="center"){if(div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);}else{var div=this.getDoc().createElement("div");div.style.textAlign='center';div.appendChild(img);focusElm.parentNode.replaceChild(div,focusElm);}this.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;case "JustifyRight":if(align=='right')img.removeAttribute('align');else img.setAttribute('align','right');var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode)div.parentNode.replaceChild(img,div);this.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return;}}if(tinyMCE.settings['force_br_newlines']){var alignValue="";if(doc.selection.type!="Control"){switch(command){case "JustifyLeft":alignValue="left";break;case "JustifyCenter":alignValue="center";break;case "JustifyFull":alignValue="justify";break;case "JustifyRight":alignValue="right";break;}if(alignValue!=""){var rng=doc.selection.createRange();if((divElm=tinyMCE.getParentElement(rng.parentElement(),"div"))!=null)divElm.setAttribute("align",alignValue);else if(rng.pasteHTML&&rng.htmlText.length>0)rng.pasteHTML('
      '+rng.htmlText+"
      ");tinyMCE.triggerNodeChange();return;}}}switch(command){case "mceRepaint":this.repaint();return true;case "mceStoreSelection":this.selectionBookmark=this.getBookmark();return true;case "mceRestoreSelection":this.moveToBookmark(this.selectionBookmark);return true;case "InsertUnorderedList":case "InsertOrderedList":var tag=(command=="InsertUnorderedList")?"ul":"ol";if(tinyMCE.isSafari)this.execCommand("mceInsertContent",false,"<"+tag+">
    5.  
    6. <"+tag+">");else this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case "Strikethrough":if(tinyMCE.isSafari)this.execCommand("mceInsertContent",false,""+this.getSelectedHTML()+"");else this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case "mceSelectNode":this.selectNode(value);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=value;break;case "FormatBlock":if(value==null||value==""){var elm=tinyMCE.getParentElement(this.getFocusElement(),"p,div,h1,h2,h3,h4,h5,h6,pre,address");if(elm)this.execCommand("mceRemoveNode",false,elm);}else this.getDoc().execCommand("FormatBlock",false,value);tinyMCE.triggerNodeChange();break;case "mceRemoveNode":if(!value)value=tinyMCE.getParentElement(this.getFocusElement());if(tinyMCE.isMSIE){value.outerHTML=value.innerHTML;}else{var rng=value.ownerDocument.createRange();rng.setStartBefore(value);rng.setEndAfter(value);rng.deleteContents();rng.insertNode(rng.createContextualFragment(value.innerHTML));}tinyMCE.triggerNodeChange();break;case "mceSelectNodeDepth":var parentNode=this.getFocusElement();for(var i=0;parentNode;i++){if(parentNode.nodeName.toLowerCase()=="body")break;if(parentNode.nodeName.toLowerCase()=="#text"){i--;parentNode=parentNode.parentNode;continue;}if(i==value){this.selectNode(parentNode,false);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=parentNode;return;}parentNode=parentNode.parentNode;}break;case "SetStyleInfo":var rng=this.getRng();var sel=this.getSel();var scmd=value['command'];var sname=value['name'];var svalue=value['value']==null?'':value['value'];var wrapper=value['wrapper']?value['wrapper']:"span";var parentElm=null;var invalidRe=new RegExp("^BODY|HTML$","g");var invalidParentsRe=tinyMCE.settings['merge_styles_invalid_parents']!=''?new RegExp(tinyMCE.settings['merge_styles_invalid_parents'],"gi"):null;if(tinyMCE.isMSIE){if(rng.item)parentElm=rng.item(0);else{var pelm=rng.parentElement();var prng=doc.selection.createRange();prng.moveToElementText(pelm);if(rng.htmlText==prng.htmlText||rng.boundingWidth==0){if(invalidParentsRe==null||!invalidParentsRe.test(pelm.nodeName))parentElm=pelm;}}}else{var felm=this.getFocusElement();if(sel.isCollapsed||(/td|tr|tbody|table/ig.test(felm.nodeName)&&sel.anchorNode==felm.parentNode))parentElm=felm;}if(parentElm&&!invalidRe.test(parentElm.nodeName)){if(scmd=="setstyle")tinyMCE.setStyleAttrib(parentElm,sname,svalue);if(scmd=="setattrib")tinyMCE.setAttrib(parentElm,sname,svalue);if(scmd=="removeformat"){parentElm.style.cssText='';tinyMCE.setAttrib(parentElm,'class','');}var ch=tinyMCE.getNodeTree(parentElm,new Array(),1);for(var z=0;z=0;i--){var elm=nodes[i];var isNew=tinyMCE.getAttrib(elm,"mce_new")=="true";elm.removeAttribute("mce_new");if(elm.childNodes&&elm.childNodes.length==1&&elm.childNodes[0].nodeType==1){this._mergeElements(scmd,elm,elm.childNodes[0],isNew);continue;}if(elm.parentNode.childNodes.length==1&&!invalidRe.test(elm.nodeName)&&!invalidRe.test(elm.parentNode.nodeName)){if(invalidParentsRe==null||!invalidParentsRe.test(elm.parentNode.nodeName))this._mergeElements(scmd,elm.parentNode,elm,false);}}var nodes=doc.getElementsByTagName(wrapper);for(var i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isEmpty=true;var tmp=doc.createElement("body");tmp.appendChild(elm.cloneNode(false));tmp.innerHTML=tmp.innerHTML.replace(new RegExp('style=""|class=""','gi'),'');if(new RegExp('','gi').test(tmp.innerHTML)){for(var x=0;x0){value=tinyMCE.replaceVar(value,"selection",selectedText);tinyMCE.execCommand('mceInsertContent',false,value);}tinyMCE.triggerNodeChange();break;case "mceSetAttribute":if(typeof(value)=='object'){var targetElms=(typeof(value['targets'])=="undefined")?"p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address":value['targets'];var targetNode=tinyMCE.getParentElement(this.getFocusElement(),targetElms);if(targetNode){targetNode.setAttribute(value['name'],value['value']);tinyMCE.triggerNodeChange();}}break;case "mceSetCSSClass":this.execCommand("SetStyleInfo",false,{command:"setattrib",name:"class",value:value});break;case "mceInsertRawHTML":var key='tiny_mce_marker';this.execCommand('mceBeginUndoLevel');this.execCommand('mceInsertContent',false,key);var scrollX=this.getDoc().body.scrollLeft+this.getDoc().documentElement.scrollLeft;var scrollY=this.getDoc().body.scrollTop+this.getDoc().documentElement.scrollTop;var html=this.getBody().innerHTML;if((pos=html.indexOf(key))!=-1)tinyMCE.setInnerHTML(this.getBody(),html.substring(0,pos)+value+html.substring(pos+key.length));this.contentWindow.scrollTo(scrollX,scrollY);this.execCommand('mceEndUndoLevel');break;case "mceInsertContent":var insertHTMLFailed=false;this.getWin().focus();if(tinyMCE.isGecko||tinyMCE.isOpera){try{if(value.indexOf('<')==-1){var r=this.getRng();var n=this.getDoc().createTextNode(tinyMCE.entityDecode(value));var s=this.getSel();var r2=r.cloneRange();s.removeAllRanges();r.deleteContents();r.insertNode(n);r2.selectNode(n);r2.collapse(false);s.removeAllRanges();s.addRange(r2);}else{value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);this.getDoc().execCommand('inserthtml',false,value);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value);}}catch(ex){insertHTMLFailed=true;}if(!insertHTMLFailed){tinyMCE.triggerNodeChange();return;}}if(tinyMCE.isOpera&&insertHTMLFailed){this.getDoc().execCommand("insertimage",false,tinyMCE.uniqueURL);var ar=tinyMCE.getElementsByAttributeValue(this.getBody(),"img","src",tinyMCE.uniqueURL);ar[0].outerHTML=value;return;}if(!tinyMCE.isMSIE){var isHTML=value.indexOf('<')!=-1;var sel=this.getSel();var rng=this.getRng();if(isHTML){if(tinyMCE.isSafari){var tmpRng=this.getDoc().createRange();tmpRng.setStart(this.getBody(),0);tmpRng.setEnd(this.getBody(),0);value=tmpRng.createContextualFragment(value);}else value=rng.createContextualFragment(value);}else{var el=document.createElement("div");el.innerHTML=value;value=el.firstChild.nodeValue;value=doc.createTextNode(value);}if(tinyMCE.isSafari&&!isHTML){this.execCommand('InsertText',false,value.nodeValue);tinyMCE.triggerNodeChange();return true;}else if(tinyMCE.isSafari&&isHTML){rng.deleteContents();rng.insertNode(value);tinyMCE.triggerNodeChange();return true;}rng.deleteContents();if(rng.startContainer.nodeType==3){var node=rng.startContainer.splitText(rng.startOffset);node.parentNode.insertBefore(value,node);}else rng.insertNode(value);if(!isHTML){sel.selectAllChildren(doc.body);sel.removeAllRanges();var rng=doc.createRange();rng.selectNode(value);rng.collapse(false);sel.addRange(rng);}else rng.collapse(false);}else{var rng=doc.selection.createRange();var c=value.indexOf('";}if(hc){cn=n.childNodes;for(i=0,l=cn.length;i';return h;},_serializeAttribute:function(n,r,an){var av='',t,os=this.settings.on_save;if(os&&(an.indexOf('mce_')==0||an.indexOf('_moz')==0))return'';if(os&&this.mceAttribs[an])av=this._getAttrib(n,this.mceAttribs[an]);if(av.length==0)av=this._getAttrib(n,an);if(av.length==0&&r.defaultAttribs&&(t=r.defaultAttribs[an])){av=t;if(av=="mce_empty")return" "+an+'=""';}if(r.forceAttribs&&(t=r.forceAttribs[an]))av=t;if(os&&av.length!=0&&this.settings.url_converter.length!=0&&/^(src|href|longdesc)$/.test(an))av=eval(this.settings.url_converter+'(this, n, av)');if(av.length!=0&&r.validAttribValues&&r.validAttribValues[an]&&!r.validAttribValues[an].test(av))return"";if(av.length!=0&&av=="{$uid}")av="uid_"+(this.idCount++);if(av.length!=0)return" "+an+"="+'"'+this.xmlEncode(av)+'"';return"";},formatHTML:function(h){var s=this.settings,p='',i=0,li=0,o='',l;h=h.replace(/\r/g,'');h='\n'+h;h=h.replace(new RegExp('\\n\\s+','gi'),'\n');h=h.replace(this.nlBeforeRe,'\n<$1$2>');h=h.replace(this.nlAfterRe,'<$1$2>\n');h=h.replace(this.nlBeforeAfterRe,'\n<$1$2$3>\n');h+='\n';while((i=h.indexOf('\n',i+1))!=-1){if((l=h.substring(li+1,i)).length!=0){if(this.ouRe.test(l)&&p.length>=s.indent_levels)p=p.substring(s.indent_levels);o+=p+l+'\n';if(this.inRe.test(l))p+=this.inStr;}li=i;}return o;},xmlEncode:function(s){var i,l,e,o='',c;this._setupEntities();switch(this.settings.entity_encoding){case"raw":return tinyMCE.xmlEncode(s);case"named":for(i=0,l=s.length;i127||c==60||c==62||c==38||c==39||c==34)o+='&#'+c+";";else o+=String.fromCharCode(c);}return o;}return s;},split:function(re,s){var c=s.split(re);var i,l,o=new Array();for(i=0,l=c.length;i/g,'>');h=h.replace(/]*)>\u00A0?<\/p>/gi,' 

      ');h=h.replace(/]*)>\s* \s*<\/p>/gi,' 

      ');h=h.replace(/]*)>\s+<\/p>/gi,' 

      ');e.innerHTML=tinyMCE.uniqueTag+h;e.firstChild.removeNode(true);nl=e.getElementsByTagName("p");for(i=nl.length-1;i>=0;i--){n=nl[i];if(n.nodeName=='P'&&!n.hasChildNodes()&&!n.mce_keep)n.parentNode.removeChild(n);}}else{h=this.fixGeckoBaseHREFBug(1,e,h);e.innerHTML=h;this.fixGeckoBaseHREFBug(2,e,h);}};TinyMCE_Engine.prototype.getOuterHTML=function(e){if(tinyMCE.isMSIE)return e.outerHTML;var d=e.ownerDocument.createElement("body");d.appendChild(e);return d.innerHTML;};TinyMCE_Engine.prototype.setOuterHTML=function(e,h){if(tinyMCE.isMSIE){e.outerHTML=h;return;}var d=e.ownerDocument.createElement("body");d.innerHTML=h;e.parentNode.replaceChild(d.firstChild,e);};TinyMCE_Engine.prototype._getElementById=function(id,d){var e,i,j,f;if(typeof(d)=="undefined")d=document;e=d.getElementById(id);if(!e){f=d.forms;for(i=0;i-1;i--){if(ar[i].specified&&ar[i].nodeValue)ne.setAttribute(ar[i].nodeName.toLowerCase(),ar[i].nodeValue);}ar=e.childNodes;for(i=0;i=strTok2.length){for(var i=0;i=strTok2.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(strTok1.length=strTok1.length||strTok1[i]!=strTok2[i]){breakPoint=i+1;break;}}}if(breakPoint==1)return targetURL.path;for(var i=0;i<(strTok1.length-(breakPoint-1));i++)outPath+="../";for(var i=breakPoint-1;i=0;i--){if(baseURLParts[i].length==0)continue;newBaseURLParts[newBaseURLParts.length]=baseURLParts[i];}baseURLParts=newBaseURLParts.reverse();var newRelURLParts=new Array();var numBack=0;for(var i=relURLParts.length-1;i>=0;i--){if(relURLParts[i].length==0||relURLParts[i]==".")continue;if(relURLParts[i]=='..'){numBack++;continue;}if(numBack>0){numBack--;continue;}newRelURLParts[newRelURLParts.length]=relURLParts[i];}relURLParts=newRelURLParts.reverse();var len=baseURLParts.length-numBack;var absPath=(len<=0?"":"/")+baseURLParts.slice(0,len).join('/')+"/"+relURLParts.join('/');var start="",end="";relURL.protocol=baseURL.protocol;relURL.host=baseURL.host;relURL.port=baseURL.port;if(relURL.path.charAt(relURL.path.length-1)=="/")absPath+="/";relURL.path=absPath;return this.serializeURL(relURL);};TinyMCE_Engine.prototype.convertURL=function(url,node,on_save){var prot=document.location.protocol;var host=document.location.hostname;var port=document.location.port;if(prot=="file:")return url;url=tinyMCE.regexpReplace(url,'(http|https):///','/');if(url.indexOf('mailto:')!=-1||url.indexOf('javascript:')!=-1||tinyMCE.regexpReplace(url,'[ \t\r\n\+]|%20','').charAt(0)=="#")return url;if(!tinyMCE.isMSIE&&!on_save&&url.indexOf("://")==-1&&url.charAt(0)!='/')return tinyMCE.settings['base_href']+url;if(on_save&&tinyMCE.getParam('relative_urls')){var curl=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(curl.charAt(0)=='/')curl=tinyMCE.settings['document_base_prefix']+curl;var urlParts=tinyMCE.parseURL(curl);var tmpUrlParts=tinyMCE.parseURL(tinyMCE.settings['document_base_url']);if(urlParts['host']==tmpUrlParts['host']&&(urlParts['port']==tmpUrlParts['port']))return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings['document_base_url'],curl);}if(!tinyMCE.getParam('relative_urls')){var urlParts=tinyMCE.parseURL(url);var baseUrlParts=tinyMCE.parseURL(tinyMCE.settings['base_href']);url=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],url);if(urlParts['anchor']&&urlParts['path']==baseUrlParts['path'])return"#"+urlParts['anchor'];}if(tinyMCE.getParam('remove_script_host')){var start="",portPart="";if(port!="")portPart=":"+port;start=prot+"//"+host+portPart+"/";if(url.indexOf(start)==0)url=url.substring(start.length-1);}return url;};TinyMCE_Engine.prototype.convertAllRelativeURLs=function(body){var elms=body.getElementsByTagName("img");for(var i=0;ibookmark.index){try{rng.addElement(nl[bookmark.index]);}catch(ex){}}}else{rng=inst.getSel().createRange();rng.moveToElementText(inst.getBody());rng.collapse(true);rng.moveStart('character',bookmark.start);rng.moveEnd('character',bookmark.length);}rng.select();win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}if(tinyMCE.isGecko&&bookmark.rng){sel.removeAllRanges();sel.addRange(bookmark.rng);win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}if(tinyMCE.isGecko){rng=doc.createRange();nl=doc.getElementsByTagName(bookmark.startTag);if(nl.length>bookmark.start)rng.setStart(nl[bookmark.start].childNodes[bookmark.startIndex],bookmark.startOffset);nl=doc.getElementsByTagName(bookmark.endTag);if(nl.length>bookmark.end)rng.setEnd(nl[bookmark.end].childNodes[bookmark.endIndex],bookmark.endOffset);sel.removeAllRanges();sel.addRange(rng);win.scrollTo(bookmark.scrollX,bookmark.scrollY);return true;}return false;},selectNode:function(node,collapse,select_text_node,to_start){var inst=this.instance,sel,rng,nodes;if(!node)return;if(typeof(collapse)=="undefined")collapse=true;if(typeof(select_text_node)=="undefined")select_text_node=false;if(typeof(to_start)=="undefined")to_start=true;if(tinyMCE.isMSIE){rng=inst.getBody().createTextRange();try{rng.moveToElementText(node);if(collapse)rng.collapse(to_start);rng.select();}catch(e){}}else{sel=this.getSel();if(!sel)return;if(tinyMCE.isSafari){sel.setBaseAndExtent(node,0,node,node.innerText.length);if(collapse){if(to_start)sel.collapseToStart();else sel.collapseToEnd();}this.scrollToNode(node);return;}rng=inst.getDoc().createRange();if(select_text_node){nodes=tinyMCE.getNodeTree(node,new Array(),3);if(nodes.length>0)rng.selectNodeContents(nodes[0]);else rng.selectNodeContents(node);}else rng.selectNode(node);if(collapse){if(!to_start&&node.nodeType==3){rng.setStart(node,node.nodeValue.length);rng.setEnd(node,node.nodeValue.length);}else rng.collapse(to_start);}sel.removeAllRanges();sel.addRange(rng);}this.scrollToNode(node);tinyMCE.selectedElement=null;if(node.nodeType==1)tinyMCE.selectedElement=node;},scrollToNode:function(node){var inst=this.instance;var pos,doc,scrollX,scrollY,height;pos=tinyMCE.getAbsPosition(node);doc=inst.getDoc();scrollX=doc.body.scrollLeft+doc.documentElement.scrollLeft;scrollY=doc.body.scrollTop+doc.documentElement.scrollTop;height=tinyMCE.isMSIE?document.getElementById(inst.editorId).style.pixelHeight:inst.targetElement.clientHeight;if(!tinyMCE.settings['auto_resize']&&!(pos.absTop>scrollY&&pos.absTop<(scrollY-25+height)))inst.contentWindow.scrollTo(pos.absLeft,pos.absTop-height+25);},getSel:function(){var inst=this.instance;if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return inst.getDoc().selection;return inst.contentWindow.getSelection();},getRng:function(){var inst=this.instance;var sel=this.getSel();if(sel==null)return null;if(tinyMCE.isMSIE&&!tinyMCE.isOpera)return sel.createRange();if(tinyMCE.isSafari&&!sel.getRangeAt)return''+window.getSelection();return sel.getRangeAt(0);},getFocusElement:function(){var inst=this.instance;if(tinyMCE.isMSIE&&!tinyMCE.isOpera){var doc=inst.getDoc();var rng=doc.selection.createRange();var elm=rng.item?rng.item(0):rng.parentElement();}else{if(inst.isHidden())return inst.getBody();var sel=this.getSel();var rng=this.getRng();if(!sel||!rng)return null;var elm=rng.commonAncestorContainer;if(!rng.collapsed){if(rng.startContainer==rng.endContainer){if(rng.startOffset-rng.endOffset<2){if(rng.startContainer.hasChildNodes())elm=rng.startContainer.childNodes[rng.startOffset];}}}elm=tinyMCE.getParentElement(elm);}return elm;}};function TinyMCE_UndoRedo(inst){this.instance=inst;this.undoLevels=new Array();this.undoIndex=0;this.typingUndoIndex=-1;this.undoRedo=true;};TinyMCE_UndoRedo.prototype={add:function(l){var b;if(l){this.undoLevels[this.undoLevels.length]=l;return true;}var inst=this.instance;if(this.typingUndoIndex!=-1){this.undoIndex=this.typingUndoIndex;}var newHTML=tinyMCE.trim(inst.getBody().innerHTML);if(this.undoLevels[this.undoIndex]&&newHTML!=this.undoLevels[this.undoIndex].content){tinyMCE.dispatchCallback(inst,'onchange_callback','onChange',inst);var customUndoLevels=tinyMCE.settings['custom_undo_redo_levels'];if(customUndoLevels!=-1&&this.undoLevels.length>customUndoLevels){for(var i=0;i0){this.undoIndex--;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);}},redo:function(){var inst=this.instance;tinyMCE.execCommand("mceEndTyping");if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;tinyMCE.setInnerHTML(inst.getBody(),this.undoLevels[this.undoIndex].content);inst.repaint();if(inst.settings.custom_undo_redo_restore_selection)inst.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark);}tinyMCE.triggerNodeChange();}};var TinyMCE_ForceParagraphs={_insertPara:function(inst,e){function isEmpty(para){function isEmptyHTML(html){return html.replace(new RegExp('[ \t\r\n]+','g'),'').toLowerCase()=="";}if(para.getElementsByTagName("img").length>0)return false;if(para.getElementsByTagName("table").length>0)return false;if(para.getElementsByTagName("hr").length>0)return false;var nodes=tinyMCE.getNodeTree(para,new Array(),3);for(var i=0;i <"+blockName+"> ";paraAfter=body.childNodes[1];}inst.selection.selectNode(paraAfter,true,true);return true;}if(startChop.nodeName==blockName)rngBefore.setStart(startChop,0);else rngBefore.setStartBefore(startChop);rngBefore.setEnd(startNode,startOffset);paraBefore.appendChild(rngBefore.cloneContents());rngAfter.setEndAfter(endChop);rngAfter.setStart(endNode,endOffset);var contents=rngAfter.cloneContents();if(contents.firstChild&&contents.firstChild.nodeName==blockName){paraAfter.innerHTML=contents.firstChild.innerHTML;}else paraAfter.appendChild(contents);if(isEmpty(paraBefore))paraBefore.innerHTML=" ";if(isEmpty(paraAfter))paraAfter.innerHTML=" ";var rng=doc.createRange();if(!startChop.previousSibling&&startChop.parentNode.nodeName.toUpperCase()==blockName){rng.setStartBefore(startChop.parentNode);}else{if(rngBefore.startContainer.nodeName.toUpperCase()==blockName&&rngBefore.startOffset==0)rng.setStartBefore(rngBefore.startContainer);else rng.setStart(rngBefore.startContainer,rngBefore.startOffset);}if(!endChop.nextSibling&&endChop.parentNode.nodeName.toUpperCase()==blockName)rng.setEndAfter(endChop.parentNode);else rng.setEnd(rngAfter.endContainer,rngAfter.endOffset);rng.deleteContents();rng.insertNode(paraAfter);rng.insertNode(paraBefore);paraAfter.normalize();paraBefore.normalize();inst.selection.selectNode(paraAfter,true,true);return true;},_handleBackSpace:function(inst){var r=inst.getRng(),sn=r.startContainer,nv,s=false;if(sn&&sn.nextSibling&&sn.nextSibling.nodeName=="BR"){nv=sn.nodeValue;if(nv!=null&&nv.length>=r.startOffset&&nv.charAt(r.startOffset-1)==' ')s=true;if(nv!=null&&r.startOffset==nv.length)sn.nextSibling.parentNode.removeChild(sn.nextSibling);}return s;}};function TinyMCE_Layer(id,bm){this.id=id;this.blockerElement=null;this.events=false;this.element=null;this.blockMode=typeof(bm)!='undefined'?bm:true;this.doc=document;};TinyMCE_Layer.prototype={moveRelativeTo:function(re,p){var rep=this.getAbsPosition(re);var w=parseInt(re.offsetWidth);var h=parseInt(re.offsetHeight);var e=this.getElement();var ew=parseInt(e.offsetWidth);var eh=parseInt(e.offsetHeight);var x,y;switch(p){case"tl":x=rep.absLeft;y=rep.absTop;break;case"tr":x=rep.absLeft+w;y=rep.absTop;break;case"bl":x=rep.absLeft;y=rep.absTop+h;break;case"br":x=rep.absLeft+w;y=rep.absTop+h;break;case"cc":x=rep.absLeft+(w/2)-(ew/2);y=rep.absTop+(h/2)-(eh/2);break;}this.moveTo(x,y);},moveBy:function(x,y){var e=this.getElement();this.moveTo(parseInt(e.style.left)+x,parseInt(e.style.top)+y);},moveTo:function(x,y){var e=this.getElement();e.style.left=x+"px";e.style.top=y+"px";this.updateBlocker();},resizeBy:function(w,h){var e=this.getElement();this.resizeTo(parseInt(e.style.width)+w,parseInt(e.style.height)+h);},resizeTo:function(w,h){var e=this.getElement();if(w!=null)e.style.width=w+"px";if(h!=null)e.style.height=h+"px";this.updateBlocker();},show:function(){this.getElement().style.display='block';this.updateBlocker();},hide:function(){this.getElement().style.display='none';this.updateBlocker();},isVisible:function(){return this.getElement().style.display=='block';},getElement:function(){if(!this.element)this.element=this.doc.getElementById(this.id);return this.element;},setBlockMode:function(s){this.blockMode=s;},updateBlocker:function(){var e,b,x,y,w,h;b=this.getBlocker();if(b){if(this.blockMode){e=this.getElement();x=this.parseInt(e.style.left);y=this.parseInt(e.style.top);w=this.parseInt(e.offsetWidth);h=this.parseInt(e.offsetHeight);b.style.left=x+'px';b.style.top=y+'px';b.style.width=w+'px';b.style.height=h+'px';b.style.display=e.style.display;}else b.style.display='none';}},getBlocker:function(){var d,b;if(!this.blockerElement&&this.blockMode){d=this.doc;b=d.createElement("iframe");b.style.cssText='display: none; position: absolute; left: 0; top: 0';b.src='javascript:false;';b.frameBorder='0';b.scrolling='no';d.body.appendChild(b);this.blockerElement=b;}return this.blockerElement;},getAbsPosition:function(n){var p={absLeft:0,absTop:0};while(n){p.absLeft+=n.offsetLeft;p.absTop+=n.offsetTop;n=n.offsetParent;}return p;},create:function(n,c,p){var d=this.doc,e=d.createElement(n);e.setAttribute('id',this.id);if(c)e.className=c;if(!p)p=d.body;p.appendChild(e);return this.element=e;},parseInt:function(s){if(s==null||s=='')return 0;return parseInt(s);}};function TinyMCE_Menu(){var id;if(typeof(tinyMCE.menuCounter)=="undefined")tinyMCE.menuCounter=0;id="mc_menu_"+tinyMCE.menuCounter++;TinyMCE_Layer.call(this,id,true);this.id=id;this.items=new Array();this.needsUpdate=true;};TinyMCE_Menu.prototype=tinyMCE.extend(TinyMCE_Layer.prototype,{init:function(s){var n;this.settings={separator_class:'mceMenuSeparator',title_class:'mceMenuTitle',disabled_class:'mceMenuDisabled',menu_class:'mceMenu',drop_menu:true};for(n in s)this.settings[n]=s[n];this.create('div',this.settings.menu_class);},clear:function(){this.items=new Array();},addTitle:function(t){this.add({type:'title',text:t});},addDisabled:function(t){this.add({type:'disabled',text:t});},addSeparator:function(){this.add({type:'separator'});},addItem:function(t,js){this.add({text:t,js:js});},add:function(mi){this.items[this.items.length]=mi;this.needsUpdate=true;},update:function(){var e=this.getElement(),h='',i,t,m=this.items,s=this.settings;if(this.settings.drop_menu)h+='';h+='
      {$lang_insert_link_url}: - - - - -
       
      + + + + +
       
      {$lang_insert_link_target}: +
      diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_content.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_content.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_content.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_content.css 2006-06-25 16:54:36.000000000 -0400 @@ -1,7 +1,19 @@ -body { - background-color: #FFFFFF; +body, td, pre { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; +} + +body { + background-color: #FFFFFF; +} + +.mceVisualAid { + border: 1px dashed #BBBBBB; +} + +/* MSIE specific */ + +* html body { scrollbar-3dlight-color: #F0F0EE; scrollbar-arrow-color: #676662; scrollbar-base-color: #F0F0EE; @@ -9,19 +21,5 @@ scrollbar-face-color: #E0E0DD; scrollbar-highlight-color: #F0F0EE; scrollbar-shadow-color: #F0F0EE; - scrollbar-track-color: #F5F5F5; -} - -td { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -pre { - font-family: Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; -} - -.mceVisualAid { - border: 1px dashed #BBBBBB; + scrollbar-track-color: #F5F5F5; } diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_popup.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_popup.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_popup.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_popup.css 2006-06-25 16:54:36.000000000 -0400 @@ -32,7 +32,7 @@ } .input_noborder { - border: 0px solid #808080; + border: 0; } .title { diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_ui.css joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_ui.css --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_ui.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/css/editor_ui.css 2006-06-25 16:54:36.000000000 -0400 @@ -1,58 +1,8 @@ -.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected { - margin-top: 1px; - margin-left: 1px; -} - -.mceButtonNormal { - border: 1px solid #F0F0EE !important; - cursor: arrow; -} - -.mceButtonOver { - border: 1px solid #0A246A; - cursor: arrow; - background-color: #B6BDD2; -} - -.mceButtonDown { - cursor: arrow; - border: 1px solid #0A246A; - background-color: #8592B5; -} - -.mceButtonSelected { - border: 1px solid; - border-color: #C0C0BB; - cursor: arrow; -} - -.mceButtonDisabled { - filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); - -moz-opacity:0.3; - opacity: 0.3; - border: 1px solid #F0F0EE !important; - cursor: arrow; -} - -.mceSeparator { - border-top: 1px solid buttonhighlight; - border-left: 1px solid buttonhighlight; - border-bottom: 1px solid buttonshadow; - border-right: 1px solid buttonshadow; - margin-right: 2px; - margin-left: 2px; -} - .mceSeparatorLine { - margin:2px; + border: 0; + padding: 0; margin-left: 4px; - background-color: #F0F0EE; - border-top: 1px solid buttonshadow; - border-left: 1px solid buttonshadow; - border-bottom: 1px solid buttonhighlight; - border-right: 1px solid buttonhighlight; - width: 0px; - height: 15px; + margin-right: 2px; } .mceSelectList { @@ -89,4 +39,87 @@ .mceToolbar { background: #F0F0EE; border-top: 1px solid #cccccc; -} \ No newline at end of file + line-height: 1px; + font-size: 1px; + padding-bottom: 1px; +} + +.mceEditorIframe { + border: 0; +} + +/* Button CSS rules */ + +a.mceButtonDisabled img, a.mceButtonNormal img, a.mceButtonSelected img { + width: 20px; + height: 20px; + cursor: default; + margin-top: 1px; + margin-left: 1px; +} + +a.mceButtonDisabled img { + border: 0 !important; +} + +a.mceButtonNormal img, a.mceButtonSelected img { + border: 1px solid #F0F0EE !important; +} + +a.mceButtonSelected img { + border: 1px solid #C0C0BB !important; +} + +a.mceButtonNormal img:hover, a.mceButtonSelected img:hover { + border: 1px solid #0A246A !important; + cursor: default; + background-color: #B6BDD2; +} + +a.mceButtonDisabled img { + -moz-opacity:0.3; + opacity: 0.3; + border: 1px solid #F0F0EE !important; + cursor: default; +} + +a.mceTiledButton img { + background-image: url('../images/buttons.gif'); + background-repeat: no-repeat; +} + +/* MSIE specific rules */ + +* html a.mceButtonNormal img, * html a.mceButtonSelected img, * html a.mceButtonDisabled img { + border: 0px !important; + margin-top: 2px; + margin-bottom: 1px; +} + +* html a.mceButtonDisabled img { + filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30); + border: 0px !important; +} + +* html a.mceButtonDisabled { + border: 1px solid #F0F0EE !important; +} + +* html a.mceButtonNormal, * html a.mceButtonSelected { + border: 1px solid #F0F0EE; + cursor: default; +} + +* html a.mceButtonSelected { + border: 1px solid #C0C0BB; +} + +* html a.mceButtonNormal:hover, * html a.mceButtonSelected:hover { + border: 1px solid #0A246A; + cursor: default; + background-color: #B6BDD2; +} + +* html .mceSelectList { + margin-top: 2px; +} diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template.js 2006-06-25 16:54:36.000000000 -0400 @@ -1,20 +1,4 @@ -function TinyMCE_simple_getEditorTemplate(){var template=new Array();template['html']='\ -\ -\ -\ -
      \ -IFRAME\ -
      \ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -
      ';template['delta_width']=0;template['delta_height']=-20;return template;}function TinyMCE_simple_handleNodeChange(editor_id,node){tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonNormal');do{switch(node.nodeName.toLowerCase()){case "b":case "strong":tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonSelected');break;case "i":case "em":tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonSelected');break;case "u":tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonSelected');break;case "strike":tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonSelected');break;case "ul":tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonSelected');break;case "ol":tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonSelected');break;}}while((node=node.parentNode)!=null);} \ No newline at end of file +var TinyMCE_SimpleTheme={_buttonMap:'bold,bullist,cleanup,italic,numlist,redo,strikethrough,underline,undo',getEditorTemplate:function(){var html='';html+='';html+='';html+='
      ';html+='IFRAME';html+='
      ';html+=tinyMCE.getButtonHTML('bold','lang_bold_desc','{$themeurl}/images/{$lang_bold_img}','Bold');html+=tinyMCE.getButtonHTML('italic','lang_italic_desc','{$themeurl}/images/{$lang_italic_img}','Italic');html+=tinyMCE.getButtonHTML('underline','lang_underline_desc','{$themeurl}/images/{$lang_underline_img}','Underline');html+=tinyMCE.getButtonHTML('strikethrough','lang_striketrough_desc','{$themeurl}/images/strikethrough.gif','Strikethrough');html+='';html+=tinyMCE.getButtonHTML('undo','lang_undo_desc','{$themeurl}/images/undo.gif','Undo');html+=tinyMCE.getButtonHTML('redo','lang_redo_desc','{$themeurl}/images/redo.gif','Redo');html+='';html+=tinyMCE.getButtonHTML('cleanup','lang_cleanup_desc','{$themeurl}/images/cleanup.gif','mceCleanup') +html+='';html+=tinyMCE.getButtonHTML('bullist','lang_bullist_desc','{$themeurl}/images/bullist.gif','InsertUnorderedList') +html+=tinyMCE.getButtonHTML('numlist','lang_numlist_desc','{$themeurl}/images/numlist.gif','InsertOrderedList') +html+='
      ';return{delta_width:0,delta_height:20,html:html};},handleNodeChange:function(editor_id,node){tinyMCE.switchClass(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClass(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClass(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClass(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClass(editor_id+'_numlist','mceButtonNormal');do{switch(node.nodeName.toLowerCase()){case"b":case"strong":tinyMCE.switchClass(editor_id+'_bold','mceButtonSelected');break;case"i":case"em":tinyMCE.switchClass(editor_id+'_italic','mceButtonSelected');break;case"u":tinyMCE.switchClass(editor_id+'_underline','mceButtonSelected');break;case"strike":tinyMCE.switchClass(editor_id+'_strikethrough','mceButtonSelected');break;case"ul":tinyMCE.switchClass(editor_id+'_bullist','mceButtonSelected');break;case"ol":tinyMCE.switchClass(editor_id+'_numlist','mceButtonSelected');break;}}while((node=node.parentNode)!=null);}};tinyMCE.addTheme("simple",TinyMCE_SimpleTheme);tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap); \ No newline at end of file diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/editor_template_src.js 2006-06-25 16:54:36.000000000 -0400 @@ -1,70 +1,86 @@ -function TinyMCE_simple_getEditorTemplate() { - var template = new Array(); +/** + * $RCSfile: editor_template_src.js,v $ + * $Revision: 1.9 $ + * $Date: 2006/04/18 13:32:53 $ + * + * @author Moxiecode + * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved. + */ + +var TinyMCE_SimpleTheme = { + // List of button ids in tile map + _buttonMap : 'bold,bullist,cleanup,italic,numlist,redo,strikethrough,underline,undo', + + getEditorTemplate : function() { + var html = ''; + + html += ''; + html += ''; + html += '
      '; + html += 'IFRAME'; + html += '
      '; + html += tinyMCE.getButtonHTML('bold', 'lang_bold_desc', '{$themeurl}/images/{$lang_bold_img}', 'Bold'); + html += tinyMCE.getButtonHTML('italic', 'lang_italic_desc', '{$themeurl}/images/{$lang_italic_img}', 'Italic'); + html += tinyMCE.getButtonHTML('underline', 'lang_underline_desc', '{$themeurl}/images/{$lang_underline_img}', 'Underline'); + html += tinyMCE.getButtonHTML('strikethrough', 'lang_striketrough_desc', '{$themeurl}/images/strikethrough.gif', 'Strikethrough'); + html += ''; + html += tinyMCE.getButtonHTML('undo', 'lang_undo_desc', '{$themeurl}/images/undo.gif', 'Undo'); + html += tinyMCE.getButtonHTML('redo', 'lang_redo_desc', '{$themeurl}/images/redo.gif', 'Redo'); + html += ''; + html += tinyMCE.getButtonHTML('cleanup', 'lang_cleanup_desc', '{$themeurl}/images/cleanup.gif', 'mceCleanup') + html += ''; + html += tinyMCE.getButtonHTML('bullist', 'lang_bullist_desc', '{$themeurl}/images/bullist.gif', 'InsertUnorderedList') + html += tinyMCE.getButtonHTML('numlist', 'lang_numlist_desc', '{$themeurl}/images/numlist.gif', 'InsertOrderedList') + html += '
      '; + + return { + delta_width : 0, + delta_height : 20, + html : html + }; + }, + + handleNodeChange : function(editor_id, node) { + // Reset old states + tinyMCE.switchClass(editor_id + '_bold', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_italic', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_underline', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonNormal'); + tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonNormal'); + + // Handle elements + do { + switch (node.nodeName.toLowerCase()) { + case "b": + case "strong": + tinyMCE.switchClass(editor_id + '_bold', 'mceButtonSelected'); + break; + + case "i": + case "em": + tinyMCE.switchClass(editor_id + '_italic', 'mceButtonSelected'); + break; + + case "u": + tinyMCE.switchClass(editor_id + '_underline', 'mceButtonSelected'); + break; + + case "strike": + tinyMCE.switchClass(editor_id + '_strikethrough', 'mceButtonSelected'); + break; + + case "ul": + tinyMCE.switchClass(editor_id + '_bullist', 'mceButtonSelected'); + break; + + case "ol": + tinyMCE.switchClass(editor_id + '_numlist', 'mceButtonSelected'); + break; + } + } while ((node = node.parentNode) != null); + } +}; - template['html'] = '\ -\ -\ -\ -
      \ -IFRAME\ -
      \ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -\ -
      '; - - template['delta_width'] = 0; - template['delta_height'] = -20; - - return template; -} - -function TinyMCE_simple_handleNodeChange(editor_id, node) { - // Reset old states - tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonNormal'); - tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonNormal'); - - // Handle elements - do { - switch (node.nodeName.toLowerCase()) { - case "b": - case "strong": - tinyMCE.switchClassSticky(editor_id + '_bold', 'mceButtonSelected'); - break; - - case "i": - case "em": - tinyMCE.switchClassSticky(editor_id + '_italic', 'mceButtonSelected'); - break; - - case "u": - tinyMCE.switchClassSticky(editor_id + '_underline', 'mceButtonSelected'); - break; - - case "strike": - tinyMCE.switchClassSticky(editor_id + '_strikethrough', 'mceButtonSelected'); - break; - - case "ul": - tinyMCE.switchClassSticky(editor_id + '_bullist', 'mceButtonSelected'); - break; - - case "ol": - tinyMCE.switchClassSticky(editor_id + '_numlist', 'mceButtonSelected'); - break; - } - } while ((node = node.parentNode) != null); -} +tinyMCE.addTheme("simple", TinyMCE_SimpleTheme); +tinyMCE.addButtonMap(TinyMCE_SimpleTheme._buttonMap); Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/images/buttons.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/images/buttons.gif differ Binary files joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/images/separator.gif and joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/themes/simple/images/separator.gif differ diff -urN joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce.js joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce.js --- joomla-1.0.7/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce.js 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce/jscripts/tiny_mce/tiny_mce.js 2006-06-25 16:54:36.000000000 -0400 @@ -1,3 +1 @@ -function TinyMCE(){this.majorVersion="2";this.minorVersion="0";this.releaseDate="2005-12-01";this.instances=new Array();this.stickyClassesLookup=new Array();this.windowArgs=new Array();this.loadedFiles=new Array();this.configs=new Array();this.currentConfig=0;this.eventHandlers=new Array();var ua=navigator.userAgent;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(ua.indexOf('MSIE 5')!=-1);this.isMSIE5_0=this.isMSIE&&(ua.indexOf('MSIE 5.0')!=-1);this.isGecko=ua.indexOf('Gecko')!=-1;this.isSafari=ua.indexOf('Safari')!=-1;this.isOpera=ua.indexOf('Opera')!=-1;this.isMac=ua.indexOf('Mac')!=-1;this.isNS7=ua.indexOf('Netscape/7')!=-1;this.isNS71=ua.indexOf('Netscape/7.1')!=-1;this.dialogCounter=0;if(this.isOpera){this.isMSIE=true;this.isGecko=false;this.isSafari=false;}this.idCounter=0;};TinyMCE.prototype.defParam=function(key,def_val){this.settings[key]=tinyMCE.getParam(key,def_val);};TinyMCE.prototype.init=function(settings){var theme;this.settings=settings;if(typeof(document.execCommand)=='undefined')return;if(!tinyMCE.baseURL){var elements=document.getElementsByTagName('script');for(var i=0;i');this.defParam("font_size_classes",'');this.defParam("font_size_style_values",'xx-small,x-small,small,medium,large,x-large,xx-large');this.defParam("event_elements",'a,img');this.defParam("convert_urls",true);this.defParam("table_inline_editing",false);this.defParam("object_resizing",true);if(this.isMSIE&&this.settings['browsers'].indexOf('msie')==-1)return;if(this.isGecko&&this.settings['browsers'].indexOf('gecko')==-1)return;if(this.isSafari&&this.settings['browsers'].indexOf('safari')==-1)return;if(this.isOpera&&this.settings['browsers'].indexOf('opera')==-1)return;var baseHREF=tinyMCE.settings['document_base_url'];var h=document.location.href;var p=h.indexOf('://');if(p>0&&document.location.protocol!="file:"){p=h.indexOf('/',p+3);h=h.substring(0,p);if(baseHREF.indexOf('://')==-1)baseHREF=h+baseHREF;tinyMCE.settings['document_base_url']=baseHREF;tinyMCE.settings['document_base_prefix']=h;}if(baseHREF.indexOf('?')!=-1)baseHREF=baseHREF.substring(0,baseHREF.indexOf('?'));this.settings['base_href']=baseHREF.substring(0,baseHREF.lastIndexOf('/'))+"/";theme=this.settings['theme'];this.blockRegExp=new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dir|fieldset|form|noscript|noframes|menu|isindex)$","i");this.posKeyCodes=new Array(13,45,36,35,33,34,37,38,39,40);this.uniqueURL='http://tinymce.moxiecode.cp/mce_temp_url';this.uniqueTag='';this.settings['theme_href']=tinyMCE.baseURL+"/themes/"+theme;if(!tinyMCE.isMSIE)this.settings['force_br_newlines']=false;if(tinyMCE.getParam("content_css",false)){var cssPath=tinyMCE.getParam("content_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['content_css']=this.documentBasePath+"/"+cssPath;else this.settings['content_css']=cssPath;}else this.settings['content_css']='';if(tinyMCE.getParam("popups_css",false)){var cssPath=tinyMCE.getParam("popups_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['popups_css']=this.documentBasePath+"/"+cssPath;else this.settings['popups_css']=cssPath;}else this.settings['popups_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_popup.css";if(tinyMCE.getParam("editor_css",false)){var cssPath=tinyMCE.getParam("editor_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['editor_css']=this.documentBasePath+"/"+cssPath;else this.settings['editor_css']=cssPath;}else this.settings['editor_css']=tinyMCE.baseURL+"/themes/"+theme+"/css/editor_ui.css";if(tinyMCE.settings['debug']){var msg="Debug: \n";msg+="baseURL: "+this.baseURL+"\n";msg+="documentBasePath: "+this.documentBasePath+"\n";msg+="content_css: "+this.settings['content_css']+"\n";msg+="popups_css: "+this.settings['popups_css']+"\n";msg+="editor_css: "+this.settings['editor_css']+"\n";alert(msg);}this._initCleanup();if(this.configs.length==0){if(this.isSafari&&this.getParam('safari_warning',true))alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false");tinyMCE.addEvent(window,"load",TinyMCE.prototype.onLoad);if(tinyMCE.isMSIE){if(tinyMCE.settings['add_unload_trigger']){tinyMCE.addEvent(window,"unload",TinyMCE.prototype.unloadHandler);tinyMCE.addEvent(window.document,"beforeunload",TinyMCE.prototype.unloadHandler);}}else{if(tinyMCE.settings['add_unload_trigger'])tinyMCE.addEvent(window,"unload",function(){tinyMCE.triggerSave(true,true);});}}this.loadScript(tinyMCE.baseURL+'/themes/'+this.settings['theme']+'/editor_template'+tinyMCE.srcMode+'.js');this.loadScript(tinyMCE.baseURL+'/langs/'+this.settings['language']+'.js');this.loadCSS(this.settings['editor_css']);var themePlugins=tinyMCE.getParam('plugins','',true,',');if(this.settings['plugins']!=''){for(var i=0;i');this.loadedFiles[this.loadedFiles.length]=url;};TinyMCE.prototype.loadCSS=function(url){for(var i=0;i');this.loadedFiles[this.loadedFiles.length]=url;};TinyMCE.prototype.importCSS=function(doc,css_file){if(css_file=='')return;if(typeof(doc.createStyleSheet)=="undefined"){var elm=doc.createElement("link");elm.rel="stylesheet";elm.href=css_file;if((headArr=doc.getElementsByTagName("head"))!=null&&headArr.length>0)headArr[0].appendChild(elm);}else var styleSheet=doc.createStyleSheet(css_file);};TinyMCE.prototype.confirmAdd=function(e,settings){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var elementId=elm.name?elm.name:elm.id;tinyMCE.settings=settings;if(!elm.getAttribute('mce_noask')&&confirm(tinyMCELang['lang_edit_confirm']))tinyMCE.addMCEControl(elm,elementId);elm.setAttribute('mce_noask','true');};TinyMCE.prototype.updateContent=function(form_element_name){var formElement=document.getElementById(form_element_name);for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();if(inst.formElement==formElement){var doc=inst.getDoc();tinyMCE._setHTML(doc,inst.formElement.value);if(!tinyMCE.isMSIE)doc.body.innerHTML=tinyMCE._cleanupHTML(inst,doc,this.settings,doc.body,inst.visualAid);}}};TinyMCE.prototype.addMCEControl=function(replace_element,form_element_name,target_document){var id="mce_editor_"+tinyMCE.idCounter++;var inst=new TinyMCEControl(tinyMCE.settings);inst.editorId=id;this.instances[id]=inst;inst.onAdd(replace_element,form_element_name,target_document);};TinyMCE.prototype.triggerSave=function(skip_cleanup,skip_callback){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;inst.switchSettings();tinyMCE.settings['preformatted']=false;if(typeof(skip_cleanup)=="undefined")skip_cleanup=false;if(typeof(skip_callback)=="undefined")skip_callback=false;tinyMCE._setHTML(inst.getDoc(),inst.getBody().innerHTML);if(inst.settings['cleanup']==false){tinyMCE.handleVisualAid(inst.getBody(),true,false,inst);tinyMCE._setEventsEnabled(inst.getBody(),true);}tinyMCE._customCleanup(inst,"submit_content_dom",inst.contentWindow.document.body);var htm=skip_cleanup?inst.getBody().innerHTML:tinyMCE._cleanupHTML(inst,inst.getDoc(),this.settings,inst.getBody(),this.visualAid,true);htm=tinyMCE._customCleanup(inst,"submit_content",htm);if(tinyMCE.settings["encoding"]=="xml"||tinyMCE.settings["encoding"]=="html")htm=tinyMCE.convertStringToXML(htm);if(!skip_callback&&tinyMCE.settings['save_callback']!="")var content=eval(tinyMCE.settings['save_callback']+"(inst.formTargetElementId,htm,inst.getBody());");if((typeof(content)!="undefined")&&content!=null)htm=content;htm=tinyMCE.regexpReplace(htm,"(","(","gi");htm=tinyMCE.regexpReplace(htm,")",")","gi");htm=tinyMCE.regexpReplace(htm,";",";","gi");htm=tinyMCE.regexpReplace(htm,""",""","gi");htm=tinyMCE.regexpReplace(htm,"^","^","gi");if(inst.formElement)inst.formElement.value=htm;}};TinyMCE.prototype._setEventsEnabled=function(node,state){var events=new Array('onfocus','onblur','onclick','ondblclick','onmousedown','onmouseup','onmouseover','onmousemove','onmouseout','onkeypress','onkeydown','onkeydown','onkeyup');var evs=tinyMCE.settings['event_elements'].split(',');for(var y=0;y","gi");content=tinyMCE.regexpReplace(content,"\r","
      ","gi");content=tinyMCE.regexpReplace(content,"\n","
      ","gi");}content=tinyMCE.storeAwayURLs(content);content=tinyMCE._customCleanup(inst,"insert_to_editor",content);if(tinyMCE.isMSIE){window.setInterval('try{tinyMCE.getCSSClasses(document.frames["'+editor_id+'"].document, "'+editor_id+'");}catch(e){}',500);if(tinyMCE.settings["force_br_newlines"])document.frames[editor_id].document.styleSheets[0].addRule("p","margin: 0px;");var body=document.frames[editor_id].document.body;tinyMCE.addEvent(body,"beforepaste",TinyMCE.prototype.eventPatch);tinyMCE.addEvent(body,"beforecut",TinyMCE.prototype.eventPatch);body.editorId=editor_id;}content=tinyMCE.cleanupHTMLCode(content);if(!tinyMCE.isMSIE){var contentElement=inst.getDoc().createElement("body");var doc=inst.getDoc();contentElement.innerHTML=content;if(tinyMCE.isGecko&&tinyMCE.settings['remove_lt_gt'])content=content.replace(new RegExp('<>','g'),"");if(tinyMCE.settings['cleanup_on_startup'])tinyMCE.setInnerHTML(inst.getBody(),tinyMCE._cleanupHTML(inst,doc,this.settings,contentElement));else{content=tinyMCE.regexpReplace(content,"","","gi");content=tinyMCE.regexpReplace(content,"","","gi");content=tinyMCE.regexpReplace(content,"","","gi");tinyMCE.setInnerHTML(inst.getBody(),content);}inst.convertAllRelativeURLs();}else{if(tinyMCE.settings['cleanup_on_startup']){tinyMCE._setHTML(inst.getDoc(),content);eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}');}else tinyMCE._setHTML(inst.getDoc(),content);}var parentElm=document.getElementById(inst.editorId+'_parent');if(parentElm.lastChild.nodeName=="INPUT")inst.formElement=tinyMCE.isGecko?parentElm.firstChild:parentElm.lastChild;else inst.formElement=tinyMCE.isGecko?parentElm.previousSibling:parentElm.nextSibling;tinyMCE.handleVisualAid(inst.getBody(),true,tinyMCE.settings['visual'],inst);tinyMCE.executeCallback('setupcontent_callback','_setupContent',0,editor_id,inst.getBody(),inst.getDoc());if(!tinyMCE.isMSIE)TinyMCE.prototype.addEventHandlers(editor_id);if(tinyMCE.isMSIE)tinyMCE.addEvent(inst.getBody(),"blur",TinyMCE.prototype.eventPatch);tinyMCE.selectedInstance=inst;tinyMCE.selectedElement=inst.contentWindow.document.body;if(!inst.isHidden())tinyMCE.triggerNodeChange(false,true);tinyMCE._customCleanup(inst,"insert_to_editor_dom",inst.getBody());tinyMCE._customCleanup(inst,"setup_content_dom",inst.getBody());tinyMCE._setEventsEnabled(inst.getBody(),false);tinyMCE.cleanupAnchors(inst.getDoc());if(tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(inst.getDoc());inst.startContent=tinyMCE.trim(inst.getBody().innerHTML);inst.undoLevels[inst.undoLevels.length]=inst.startContent;tinyMCE.operaOpacityCounter=-1;};TinyMCE.prototype.cleanupHTMLCode=function(s){s=s.replace(//gi,'

       

      ');s=s.replace(/

      \s*<\/p>/gi,'

       

      ');s=s.replace(/<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\|>]*?)\/>/gi,'<$1$2$3>');s=s.replace(new RegExp('\\s+><\/(img|br|hr)>/gi,'<$1$2 />');if(tinyMCE.isMSIE)s=s.replace(/

      <\/p>/gi,"


      ");s=s.replace(new RegExp('(href=\"?)(\\s*?#)','gi'),'$1'+tinyMCE.settings['document_base_url']+"#");return s;};TinyMCE.prototype.storeAwayURLs=function(s){s=s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"','gi'),'');s=s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"','gi'),'');s=s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"','gi'),'src="$1" mce_src="$1"');s=s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"','gi'),'href="$1" mce_href="$1"');return s;};TinyMCE.prototype.cancelEvent=function(e){if(tinyMCE.isMSIE){e.returnValue=false;e.cancelBubble=true;}else e.preventDefault();};TinyMCE.prototype.removeTinyMCEFormElements=function(form_obj){if(typeof(form_obj)=="undefined"||form_obj==null)return;if(form_obj.nodeName!="FORM"){if(form_obj.form)form_obj=form_obj.form;else form_obj=tinyMCE.getParentElement(form_obj,"form");}if(form_obj==null)return;for(var i=0;i");rng.collapse(false);rng.select();tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.triggerNodeChange(false);return false;}}if(e.keyCode==8||e.keyCode==46){tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(e.target,"a");tinyMCE.imgElement=tinyMCE.getParentElement(e.target,"img");tinyMCE.triggerNodeChange(false);}return false;break;case "keyup":case "keydown":if(e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];else return;if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();var inst=tinyMCE.selectedInstance;if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(tinyMCE.selectedInstance._handleBackSpace(e.type)){tinyMCE.execCommand("mceAddUndoLevel");e.preventDefault();return false;}}tinyMCE.selectedElement=null;tinyMCE.selectedNode=null;var elm=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(elm,"a");tinyMCE.imgElement=tinyMCE.getParentElement(elm,"img");tinyMCE.selectedElement=elm;if(tinyMCE.isGecko&&e.type=="keyup"&&e.keyCode==9)tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(),true,tinyMCE.settings['visual'],tinyMCE.selectedInstance);if(tinyMCE.isMSIE&&e.type=="keydown"&&e.keyCode==13)tinyMCE.enterKeyElement=tinyMCE.selectedInstance.getFocusElement();if(tinyMCE.isMSIE&&e.type=="keyup"&&e.keyCode==13){var elm=tinyMCE.enterKeyElement;if(elm){var re=new RegExp('^HR|IMG|BR$','g');var dre=new RegExp('^H[1-6]$','g');if(!elm.hasChildNodes()&&!re.test(elm.nodeName)){if(dre.test(elm.nodeName))elm.innerHTML="  ";else elm.innerHTML=" ";}}}var keys=tinyMCE.posKeyCodes;var posKey=false;for(var i=0;i-1)suffix='?rnd='+this.operaOpacityCounter++;element.src=tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/images/opacity.png"+suffix;element.style.backgroundImage="url('"+element.mceOldSrc+"')";}else{if(element.mceOldSrc){element.src=element.mceOldSrc;element.parentNode.style.backgroundImage="";element.mceOldSrc=null;}}}}};TinyMCE.prototype.restoreClass=function(element){if(element!=null&&element.oldClassName&&!element.classLock){element.className=element.oldClassName;element.oldClassName=null;}};TinyMCE.prototype.setClassLock=function(element,lock_state){if(element!=null)element.classLock=lock_state;};TinyMCE.prototype.addEvent=function(obj,name,handler){if(tinyMCE.isMSIE){obj.attachEvent("on"+name,handler);}else obj.addEventListener(name,handler,false);};TinyMCE.prototype.submitPatch=function(){tinyMCE.removeTinyMCEFormElements(this);tinyMCE.triggerSave();this.mceOldSubmit();tinyMCE.isNotDirty=true;};TinyMCE.prototype.onLoad=function(){for(var c=0;c0)return;if(val.indexOf('%')==-1)val+='px';break;case "vspace":case "hspace":elm.style.marginTop=val+"px";elm.style.marginBottom=val+"px";elm.removeAttribute(attrib);return;case "align":if(elm.nodeName=="IMG"){if(tinyMCE.isMSIE)elm.style.styleFloat=val;else elm.style.cssFloat=val;}else elm.style.textAlign=val;elm.removeAttribute(attrib);return;}if(val!=''){eval('elm.style.'+style+' = val;');elm.removeAttribute(attrib);}}}else{if(style=='')return;var val=eval('elm.style.'+style)==''?tinyMCE.getAttrib(elm,attrib):eval('elm.style.'+style);val=val==null?'':''+val;switch(attrib){case "background":if(val.indexOf('url')==-1&&val!='')val="url('"+val+"');";if(val!=''){elm.style.backgroundImage=val;elm.removeAttribute(attrib);}return;case "border":case "width":case "height":val=val.replace('px','');break;case "align":if(tinyMCE.getAttrib(elm,'align')==''){if(elm.nodeName=="IMG"){if(tinyMCE.isMSIE&&elm.style.styleFloat!=''){val=elm.style.styleFloat;style='styleFloat';}else if(tinyMCE.isGecko&&elm.style.cssFloat!=''){val=elm.style.cssFloat;style='cssFloat';}}}break;}if(val!=''){elm.removeAttribute(attrib);elm.setAttribute(attrib,val);eval('elm.style.'+style+' = "";');}}};TinyMCE.prototype._cleanupAttribute=function(valid_attributes,element_name,attribute_node,element_node){var attribName=attribute_node.nodeName.toLowerCase();var attribValue=attribute_node.nodeValue;var attribMustBeValue=null;var verified=false;if(attribName.indexOf('moz_')!=-1)return null;if(!tinyMCE.cleanup_on_save&&(attribName=="mce_href"||attribName=="mce_src"))return{name:attribName,value:attribValue};if(tinyMCE.cleanup_verify_html&&!verified){for(var i=1;i1)val="url('"+eval(tinyMCE.getParam('urlconverter_callback')+"(m[1], null, true);")+"')";}if(tinyMCE.getParam("force_hex_style_colors"))val=tinyMCE.convertRGBToHex(val,true);if(val!="url('')")str+=key.toLowerCase()+": "+val+"; ";}}if(new RegExp('; $').test(str))str=str.substring(0,str.length-2);return str;};TinyMCE.prototype.convertRGBToHex=function(s,k){if(s.toLowerCase().indexOf('rgb')!=-1){var re=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi");var rgb=s.replace(re,"$1,$2,$3,$4,$5").split(',');if(rgb.length==5){r=parseInt(rgb[1]).toString(16);g=parseInt(rgb[2]).toString(16);b=parseInt(rgb[3]).toString(16);r=r.length==1?'0'+r:r;g=g.length==1?'0'+g:g;b=b.length==1?'0'+b:b;s="#"+r+g+b;if(k)s=rgb[0]+s+rgb[4];}}return s;};TinyMCE.prototype.convertHexToRGB=function(s){if(s.indexOf('#')!=-1){s=s.replace(new RegExp('[^0-9A-F]','gi'),'');return "rgb("+parseInt(s.substring(0,2),16)+","+parseInt(s.substring(2,4),16)+","+parseInt(s.substring(4,6),16)+")";}return s;};TinyMCE.prototype._verifyClass=function(node){if(tinyMCE.isGecko){var className=node.getAttribute('class');if(!className)return false;}if(tinyMCE.isMSIE)var className=node.getAttribute('className');if(tinyMCE.cleanup_verify_css_classes&&tinyMCE.cleanup_on_save){var csses=tinyMCE.getCSSClasses();nonDefinedCSS=true;for(var c=0;c'+output;}}var re=new RegExp("^(TABLE|TD|TR)$");if(re.test(node.nodeName)){if((node.nodeName!="TABLE"||tinyMCE.cleanup_inline_styles)&&(width=tinyMCE.getAttrib(node,"width"))!=''){node.style.width=width.indexOf('%')!=-1?width:width.replace(/[^0-9]/gi,'')+"px";node.removeAttribute("width");}if((node.nodeName=="TABLE"&&!tinyMCE.cleanup_inline_styles)&&node.style.width!=''){tinyMCE.setAttrib(node,"width",node.style.width.replace('px',''));node.style.width='';}if((height=tinyMCE.getAttrib(node,"height"))!=''){height=""+height;node.style.height=height.indexOf('%')!=-1?height:height.replace(/[^0-9]/gi,'')+"px";node.removeAttribute("height");}}if(tinyMCE.cleanup_inline_styles){var re=new RegExp("^(TABLE|TD|TR|IMG|HR)$");if(re.test(node.nodeName)&&tinyMCE.getAttrib(node,"class").indexOf('mceItem')==-1){tinyMCE._moveStyle(node,'width','width');tinyMCE._moveStyle(node,'height','height');tinyMCE._moveStyle(node,'borderWidth','border');tinyMCE._moveStyle(node,'','vspace');tinyMCE._moveStyle(node,'','hspace');tinyMCE._moveStyle(node,'textAlign','align');tinyMCE._moveStyle(node,'backgroundColor','bgColor');tinyMCE._moveStyle(node,'borderColor','borderColor');tinyMCE._moveStyle(node,'backgroundImage','background');if(tinyMCE.isMSIE5)node.outerHTML=node.outerHTML;}else if(tinyMCE.isBlockElement(node))tinyMCE._moveStyle(node,'textAlign','align');if(node.nodeName=="FONT")tinyMCE._moveStyle(node,'color','color');}if(elementValidAttribs){for(var a=1;a"+node.innerHTML+"";if(elementName=="table"&&!node.hasChildNodes())return "";if(node.attributes.length>0){var lastAttrib="";for(var i=0;i"+this.convertStringToXML(String.fromCharCode(160))+"";if(tinyMCE.isMSIE&&elementName=="script")return "<"+elementName+elementAttribs+">"+node.text+"";if(node.hasChildNodes()){if(!(elementName=="span"&&elementAttribs==""&&tinyMCE.getParam("trim_span_elements"))){if(elementName=="p"&&tinyMCE.cleanup_force_br_newlines)output+="";else output+="<"+elementName+elementAttribs+">";}for(var i=0;i
      ";else output+="";}}else{if(!nonEmptyTag){if(openTag)output+="<"+elementName+elementAttribs+">";else output+="<"+elementName+elementAttribs+" />";}}return output;case 3:if(node.parentNode.nodeName=="SCRIPT"||node.parentNode.nodeName=="NOSCRIPT"||node.parentNode.nodeName=="STYLE")return node.nodeValue;return this.convertStringToXML(node.nodeValue);case 8:return "";default:return "[UNKNOWN NODETYPE "+node.nodeType+"]";}};TinyMCE.prototype.convertStringToXML=function(html_data){var output="";for(var i=0;i127)output+='&#'+chr+";";else output+=String.fromCharCode(chr);continue;}if(tinyMCE.settings['entity_encoding']=="raw"){output+=String.fromCharCode(chr);continue;}if(typeof(tinyMCE.settings['cleanup_entities']["c"+chr])!='undefined'&&tinyMCE.settings['cleanup_entities']["c"+chr]!='')output+='&'+tinyMCE.settings['cleanup_entities']["c"+chr]+';';else output+=''+String.fromCharCode(chr);}return output;};TinyMCE.prototype._getCleanupElementName=function(chunk){var pos;if(chunk.charAt(0)=='+')chunk=chunk.substring(1);if(chunk.charAt(0)=='-')chunk=chunk.substring(1);if((pos=chunk.indexOf('/'))!=-1)chunk=chunk.substring(0,pos);if((pos=chunk.indexOf('['))!=-1)chunk=chunk.substring(0,pos);return chunk;};TinyMCE.prototype._initCleanup=function(){var validElements=tinyMCE.settings["valid_elements"];validElements=validElements.split(',');var extendedValidElements=tinyMCE.settings["extended_valid_elements"];extendedValidElements=extendedValidElements.split(',');for(var i=0;i/gi,'>');return html;}if(on_save&&tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertFontsToSpans(doc);tinyMCE._customCleanup(inst,on_save?"get_from_editor_dom":"insert_to_editor_dom",doc.body);var n=doc.getElementsByTagName("font");for(var i=0;i[ \n\r]*[ \n\r]*

      ','
      ','gi'));tinyMCE.setInnerHTML(element,tinyMCE.regexpReplace(element.innerHTML,'','','gi'));}var html=this.cleanupNode(element);if(tinyMCE.settings['debug'])tinyMCE.debug("Cleanup process executed in: "+(new Date().getTime()-startTime)+" ms.");html=tinyMCE.regexpReplace(html,'


      ','
      ');html=tinyMCE.regexpReplace(html,'

       


       

      ','
      ');html=tinyMCE.regexpReplace(html,'
      \\s*
      \\s*
       
      ';for(i=0;i';}h+='
      ';break;case'title':h+='
      '+t+'';break;case'disabled':h+='
      '+t+'';break;default:h+='
      '+t+'';}h+='
      ';e.innerHTML=h;this.needsUpdate=false;this.updateBlocker();},show:function(){var nl,i;if(tinyMCE.lastMenu==this)return;if(this.needsUpdate)this.update();if(tinyMCE.lastMenu&&tinyMCE.lastMenu!=this)tinyMCE.lastMenu.hide();TinyMCE_Layer.prototype.show.call(this);if(!tinyMCE.isOpera){}tinyMCE.lastMenu=this;}});TinyMCE_Engine.prototype.debug=function(){var m="",e,a,i;e=document.getElementById("tinymce_debug");if(!e){var d=document.createElement("div");d.setAttribute("className","debugger");d.className="debugger";d.innerHTML='Debug output:';document.body.appendChild(d);e=document.getElementById("tinymce_debug");}a=this.debug.arguments;for(i=0;i -1) { - // Write main script and patch some things - if ($index == 0) { - TinyMCE_echo(file_get_contents(realpath("tiny_mce" . $suffix . ".js"))); - TinyMCE_echo('TinyMCE.prototype.loadScript = function() {};'); - } - - // Do init based on index - TinyMCE_echo("tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);"); - - // Load theme, language pack and theme language packs - if ($theme) { - TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/editor_template" . $suffix . ".js"))); - TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/langs/" . $lang . ".js"))); - } - - if ($language) - TinyMCE_echo(file_get_contents(realpath("langs/" . $language . ".js"))); - - // Load all plugins and their language packs - $plugins = explode(",", $plugins); - foreach ($plugins as $plugin) { - $pluginFile = realpath("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js"); - $languageFile = realpath("plugins/" . $plugin . "/langs/" . $lang . ".js"); - - if ($pluginFile) - TinyMCE_echo(file_get_contents($pluginFile)); - - if ($languageFile) - TinyMCE_echo(file_get_contents($languageFile)); - } - - // Write to cache - if ($diskCache) { - // Calculate compression ratio and debug target output path - if ($debug) { - $ratio = round(100 - strlen(gzencode($cacheData, 9, FORCE_GZIP)) / strlen($cacheData) * 100.0); - TinyMCE_echo("alert('TinyMCE was compressed by " . $ratio . "%.\\nOutput cache file: " . $cacheFile . "');"); - } - - $cacheData = gzencode($cacheData, 9, FORCE_GZIP); - - // Write to file if possible - $fp = @fopen($cacheFile, "wb"); - if ($fp) { - fwrite($fp, $cacheData); - fclose($fp); - } - - // Output - header("Content-Encoding: gzip"); - echo $cacheData; - } - - die; -} -?> - -function TinyMCECompressed() { - this.configs = new Array(); - this.loadedFiles = new Array(); -} - -TinyMCECompressed.prototype.init = function(settings) { - var elements = document.getElementsByTagName('script'); - var scriptURL = ""; - - for (var i=0; i'); -} - -TinyMCECompressed.prototype.getOnce = function(str) { - var ar = str.split(','); - - for (var i=0; i -1) { + // Write main script and patch some things + if ($index == 0) { + TinyMCE_echo(file_get_contents(realpath("tiny_mce" . $suffix . ".js"))); + TinyMCE_echo('TinyMCE.prototype.orgLoadScript = TinyMCE.prototype.loadScript;'); + TinyMCE_echo('TinyMCE.prototype.loadScript = function() {};var realTinyMCE = tinyMCE;'); + } else + TinyMCE_echo('tinyMCE = realTinyMCE;'); + + // Do init based on index + TinyMCE_echo("tinyMCE.init(tinyMCECompressed.configs[" . $index . "]);"); + + // Load external plugins + if ($index == 0) + TinyMCE_echo("tinyMCECompressed.loadPlugins();"); + + // Load theme, language pack and theme language packs + if ($theme) { + TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/editor_template" . $suffix . ".js"))); + TinyMCE_echo(file_get_contents(realpath("themes/" . $theme . "/langs/" . $lang . ".js"))); + } + + if ($language) + TinyMCE_echo(file_get_contents(realpath("langs/" . $language . ".js"))); + + // Load all plugins and their language packs + $plugins = explode(",", $plugins); + foreach ($plugins as $plugin) { + $pluginFile = realpath("plugins/" . $plugin . "/editor_plugin" . $suffix . ".js"); + $languageFile = realpath("plugins/" . $plugin . "/langs/" . $lang . ".js"); + + if ($pluginFile) + TinyMCE_echo(file_get_contents($pluginFile)); + + if ($languageFile) + TinyMCE_echo(file_get_contents($languageFile)); + } + + // Reset tinyMCE compressor engine + TinyMCE_echo("tinyMCE = tinyMCECompressed;"); + + // Write to cache + if ($diskCache) { + // Calculate compression ratio and debug target output path + if ($debug) { + $ratio = round(100 - strlen(gzencode($cacheData, 9, FORCE_GZIP)) / strlen($cacheData) * 100.0); + TinyMCE_echo("alert('TinyMCE was compressed by " . $ratio . "%.\\nOutput cache file: " . $cacheFile . "');"); + } + + $cacheData = gzencode($cacheData, 9, FORCE_GZIP); + + // Write to file if possible + $fp = @fopen($cacheFile, "wb"); + if ($fp) { + fwrite($fp, $cacheData); + fclose($fp); + } + + // Output + header("Content-Encoding: " . $enc); + echo $cacheData; + } + + die; +} +?> + +function TinyMCECompressed() { + this.configs = new Array(); + this.loadedFiles = new Array(); + this.externalPlugins = new Array(); + this.loadAdded = false; + this.isLoaded = false; +} + +TinyMCECompressed.prototype.init = function(settings) { + var elements = document.getElementsByTagName('script'); + var scriptURL = ""; + + for (var i=0; i'); + + if (!this.loadAdded) { + tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCECompressed.prototype.onLoad); + tinyMCE.addEvent(window, "load", TinyMCECompressed.prototype.onLoad); + this.loadAdded = true; + } +} + +TinyMCECompressed.prototype.onLoad = function() { + if (tinyMCE.isLoaded) + return true; + + tinyMCE = realTinyMCE; + TinyMCE_Engine.prototype.onLoad(); + tinyMCE._addUnloadEvents(); + + tinyMCE.isLoaded = true; +} + +TinyMCECompressed.prototype.addEvent = function(o, n, h) { + if (o.attachEvent) + o.attachEvent("on" + n, h); + else + o.addEventListener(n, h, false); +} + +TinyMCECompressed.prototype.getOnce = function(str) { + var ar = str.replace(/\s+/g, '').split(','); + + for (var i=0; i 0) { + elms = document.forms[0].elements; + for (i=0; i'); - this.defParam("font_size_classes", ''); - this.defParam("font_size_style_values", 'xx-small,x-small,small,medium,large,x-large,xx-large'); - this.defParam("event_elements", 'a,img'); - this.defParam("convert_urls", true); - this.defParam("table_inline_editing", false); - this.defParam("object_resizing", true); - - // Browser check IE - if (this.isMSIE && this.settings['browsers'].indexOf('msie') == -1) - return; - - // Browser check Gecko - if (this.isGecko && this.settings['browsers'].indexOf('gecko') == -1) - return; - - // Browser check Safari - if (this.isSafari && this.settings['browsers'].indexOf('safari') == -1) - return; - // Browser check Opera - if (this.isOpera && this.settings['browsers'].indexOf('opera') == -1) - return; - - // If not super absolute make it so - var baseHREF = tinyMCE.settings['document_base_url']; - var h = document.location.href; - var p = h.indexOf('://'); - if (p > 0 && document.location.protocol != "file:") { - p = h.indexOf('/', p + 3); - h = h.substring(0, p); + // Get document base path + this.documentBasePath = document.location.href; + if (this.documentBasePath.indexOf('?') != -1) + this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.indexOf('?')); + this.documentURL = this.documentBasePath; + this.documentBasePath = this.documentBasePath.substring(0, this.documentBasePath.lastIndexOf('/')); + + // If not HTTP absolute + if (tinyMCE.baseURL.indexOf('://') == -1 && tinyMCE.baseURL.charAt(0) != '/') { + // If site absolute + tinyMCE.baseURL = this.documentBasePath + "/" + tinyMCE.baseURL; + } + + // Set default values on settings + this._def("mode", "none"); + this._def("theme", "advanced"); + this._def("plugins", "", true); + this._def("language", "en"); + this._def("docs_language", this.settings['language']); + this._def("elements", ""); + this._def("textarea_trigger", "mce_editable"); + this._def("editor_selector", ""); + this._def("editor_deselector", "mceNoEditor"); + this._def("valid_elements", "+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],-td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang]"); + this._def("extended_valid_elements", ""); + this._def("invalid_elements", ""); + this._def("encoding", ""); + this._def("urlconverter_callback", tinyMCE.getParam("urlconvertor_callback", "TinyMCE_Engine.prototype.convertURL")); + this._def("save_callback", ""); + this._def("debug", false); + this._def("force_br_newlines", false); + this._def("force_p_newlines", true); + this._def("add_form_submit_trigger", true); + this._def("relative_urls", true); + this._def("remove_script_host", true); + this._def("focus_alert", true); + this._def("document_base_url", this.documentURL); + this._def("visual", true); + this._def("visual_table_class", "mceVisualAid"); + this._def("setupcontent_callback", ""); + this._def("fix_content_duplication", true); + this._def("custom_undo_redo", true); + this._def("custom_undo_redo_levels", -1); + this._def("custom_undo_redo_keyboard_shortcuts", true); + this._def("custom_undo_redo_restore_selection", true); + this._def("verify_html", true); + this._def("apply_source_formatting", false); + this._def("directionality", "ltr"); + this._def("cleanup_on_startup", false); + this._def("inline_styles", false); + this._def("convert_newlines_to_brs", false); + this._def("auto_reset_designmode", true); + this._def("entities", "39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro", true); + this._def("entity_encoding", "named"); + this._def("cleanup_callback", ""); + this._def("add_unload_trigger", true); + this._def("ask", false); + this._def("nowrap", false); + this._def("auto_resize", false); + this._def("auto_focus", false); + this._def("cleanup", true); + this._def("remove_linebreaks", true); + this._def("button_tile_map", false); + this._def("submit_patch", true); + this._def("browsers", "msie,safari,gecko,opera", true); + this._def("dialog_type", "window"); + this._def("accessibility_warnings", true); + this._def("accessibility_focus", true); + this._def("merge_styles_invalid_parents", ""); + this._def("force_hex_style_colors", true); + this._def("trim_span_elements", true); + this._def("convert_fonts_to_spans", false); + this._def("doctype", ''); + this._def("font_size_classes", ''); + this._def("font_size_style_values", 'xx-small,x-small,small,medium,large,x-large,xx-large', true); + this._def("event_elements", 'a,img', true); + this._def("convert_urls", true); + this._def("table_inline_editing", false); + this._def("object_resizing", true); + this._def("custom_shortcuts", true); + this._def("convert_on_click", false); + this._def("content_css", ''); + this._def("fix_list_elements", false); + this._def("fix_table_elements", false); + this._def("strict_loading_mode", document.contentType == 'application/xhtml+xml'); + this._def("hidden_tab_class", ''); + this._def("display_tab_class", ''); + + // Force strict loading mode to false on non Gecko browsers + if (this.isMSIE && !this.isOpera) + this.settings.strict_loading_mode = false; - if (baseHREF.indexOf('://') == -1) - baseHREF = h + baseHREF; + // Browser check IE + if (this.isMSIE && this.settings['browsers'].indexOf('msie') == -1) + return; - tinyMCE.settings['document_base_url'] = baseHREF; - tinyMCE.settings['document_base_prefix'] = h; - } + // Browser check Gecko + if (this.isGecko && this.settings['browsers'].indexOf('gecko') == -1) + return; - // Trim away query part - if (baseHREF.indexOf('?') != -1) - baseHREF = baseHREF.substring(0, baseHREF.indexOf('?')); + // Browser check Safari + if (this.isSafari && this.settings['browsers'].indexOf('safari') == -1) + return; - this.settings['base_href'] = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/"; + // Browser check Opera + if (this.isOpera && this.settings['browsers'].indexOf('opera') == -1) + return; - theme = this.settings['theme']; - this.blockRegExp = new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dir|fieldset|form|noscript|noframes|menu|isindex)$", "i"); - this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40); - this.uniqueURL = 'http://tinymce.moxiecode.cp/mce_temp_url'; // Make unique URL non real URL - this.uniqueTag = ''; + // If not super absolute make it so + var baseHREF = tinyMCE.settings['document_base_url']; + var h = document.location.href; + var p = h.indexOf('://'); + if (p > 0 && document.location.protocol != "file:") { + p = h.indexOf('/', p + 3); + h = h.substring(0, p); + + if (baseHREF.indexOf('://') == -1) + baseHREF = h + baseHREF; + + tinyMCE.settings['document_base_url'] = baseHREF; + tinyMCE.settings['document_base_prefix'] = h; + } + + // Trim away query part + if (baseHREF.indexOf('?') != -1) + baseHREF = baseHREF.substring(0, baseHREF.indexOf('?')); + + this.settings['base_href'] = baseHREF.substring(0, baseHREF.lastIndexOf('/')) + "/"; + + theme = this.settings['theme']; + this.blockRegExp = new RegExp("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dt|dd|dir|fieldset|form|noscript|noframes|menu|isindex|samp)$", "i"); + this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40); + this.uniqueURL = 'javascript:TINYMCE_UNIQUEURL();'; // Make unique URL non real URL + this.uniqueTag = ''; + this.callbacks = new Array('onInit', 'getInfo', 'getEditorTemplate', 'setupContent', 'onChange', 'onPageLoad', 'handleNodeChange', 'initInstance', 'execCommand', 'getControlHTML', 'handleEvent', 'cleanup'); + + // Theme url + this.settings['theme_href'] = tinyMCE.baseURL + "/themes/" + theme; + + if (!tinyMCE.isMSIE) + this.settings['force_br_newlines'] = false; + + if (tinyMCE.getParam("popups_css", false)) { + var cssPath = tinyMCE.getParam("popups_css", ""); + + // Is relative + if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/') + this.settings['popups_css'] = this.documentBasePath + "/" + cssPath; + else + this.settings['popups_css'] = cssPath; + } else + this.settings['popups_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_popup.css"; - // Theme url - this.settings['theme_href'] = tinyMCE.baseURL + "/themes/" + theme; + if (tinyMCE.getParam("editor_css", false)) { + var cssPath = tinyMCE.getParam("editor_css", ""); - if (!tinyMCE.isMSIE) - this.settings['force_br_newlines'] = false; + // Is relative + if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/') + this.settings['editor_css'] = this.documentBasePath + "/" + cssPath; + else + this.settings['editor_css'] = cssPath; + } else + this.settings['editor_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css"; - if (tinyMCE.getParam("content_css", false)) { - var cssPath = tinyMCE.getParam("content_css", ""); + if (tinyMCE.settings['debug']) { + var msg = "Debug: \n"; - // Is relative - if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/') - this.settings['content_css'] = this.documentBasePath + "/" + cssPath; - else - this.settings['content_css'] = cssPath; - } else - this.settings['content_css'] = ''; + msg += "baseURL: " + this.baseURL + "\n"; + msg += "documentBasePath: " + this.documentBasePath + "\n"; + msg += "content_css: " + this.settings['content_css'] + "\n"; + msg += "popups_css: " + this.settings['popups_css'] + "\n"; + msg += "editor_css: " + this.settings['editor_css'] + "\n"; - if (tinyMCE.getParam("popups_css", false)) { - var cssPath = tinyMCE.getParam("popups_css", ""); + alert(msg); + } - // Is relative - if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/') - this.settings['popups_css'] = this.documentBasePath + "/" + cssPath; - else - this.settings['popups_css'] = cssPath; - } else - this.settings['popups_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_popup.css"; + // Only do this once + if (this.configs.length == 0) { + // Is Safari enabled + if (this.isSafari && this.getParam('safari_warning', false)) + alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false"); - if (tinyMCE.getParam("editor_css", false)) { - var cssPath = tinyMCE.getParam("editor_css", ""); + if (typeof(TinyMCECompressed) == "undefined") { + tinyMCE.addEvent(window, "DOMContentLoaded", TinyMCE_Engine.prototype.onLoad); - // Is relative - if (cssPath.indexOf('://') == -1 && cssPath.charAt(0) != '/') - this.settings['editor_css'] = this.documentBasePath + "/" + cssPath; - else - this.settings['editor_css'] = cssPath; - } else - this.settings['editor_css'] = tinyMCE.baseURL + "/themes/" + theme + "/css/editor_ui.css"; + if (tinyMCE.isMSIE && !tinyMCE.isOpera) { + if (document.body) + tinyMCE.addEvent(document.body, "readystatechange", TinyMCE_Engine.prototype.onLoad); + else + tinyMCE.addEvent(document, "readystatechange", TinyMCE_Engine.prototype.onLoad); + } - if (tinyMCE.settings['debug']) { - var msg = "Debug: \n"; + tinyMCE.addEvent(window, "load", TinyMCE_Engine.prototype.onLoad); + tinyMCE._addUnloadEvents(); + } + } - msg += "baseURL: " + this.baseURL + "\n"; - msg += "documentBasePath: " + this.documentBasePath + "\n"; - msg += "content_css: " + this.settings['content_css'] + "\n"; - msg += "popups_css: " + this.settings['popups_css'] + "\n"; - msg += "editor_css: " + this.settings['editor_css'] + "\n"; + this.loadScript(tinyMCE.baseURL + '/themes/' + this.settings['theme'] + '/editor_template' + tinyMCE.srcMode + '.js'); + this.loadScript(tinyMCE.baseURL + '/langs/' + this.settings['language'] + '.js'); + this.loadCSS(this.settings['editor_css']); - alert(msg); - } + // Add plugins + var p = tinyMCE.getParam('plugins', '', true, ','); + if (p.length > 0) { + for (var i=0; i'); + v = t ? v.replace(/\s+/g,"") : v; - this.loadedFiles[this.loadedFiles.length] = url; -}; + this.settings[key] = v; + }, -TinyMCE.prototype.loadCSS = function(url) { - for (var i=0; i'); + addPlugin : function(n, p) { + var op = this.plugins[n]; - this.loadedFiles[this.loadedFiles.length] = url; -}; + // Use the previous plugin object base URL used when loading external plugins + p.baseURL = op ? op.baseURL : tinyMCE.baseURL + "/plugins/" + n; + this.plugins[n] = p; -TinyMCE.prototype.importCSS = function(doc, css_file) { - if (css_file == '') - return; + this.loadNextScript(); + }, - if (typeof(doc.createStyleSheet) == "undefined") { - var elm = doc.createElement("link"); + setPluginBaseURL : function(n, u) { + var op = this.plugins[n]; - elm.rel = "stylesheet"; - elm.href = css_file; + if (op) + op.baseURL = u; + else + this.plugins[n] = {baseURL : u}; + }, - if ((headArr = doc.getElementsByTagName("head")) != null && headArr.length > 0) - headArr[0].appendChild(elm); - } else - var styleSheet = doc.createStyleSheet(css_file); -}; + loadPlugin : function(n, u) { + u = u.indexOf('.js') != -1 ? u.substring(0, u.lastIndexOf('/')) : u; + u = u.charAt(u.length-1) == '/' ? u.substring(0, u.length-1) : u; + this.plugins[n] = {baseURL : u}; + this.loadScript(u + "/editor_plugin" + (tinyMCE.srcMode ? '_src' : '') + ".js"); + }, + + hasTheme : function(n) { + return typeof(this.themes[n]) != "undefined" && this.themes[n] != null; + }, + + addTheme : function(n, t) { + this.themes[n] = t; + + this.loadNextScript(); + }, + + addMenu : function(n, m) { + this.menus[n] = m; + }, + + hasMenu : function(n) { + return typeof(this.plugins[n]) != "undefined" && this.plugins[n] != null; + }, -TinyMCE.prototype.confirmAdd = function(e, settings) { - var elm = tinyMCE.isMSIE ? event.srcElement : e.target; - var elementId = elm.name ? elm.name : elm.id; + loadScript : function(url) { + var i; - tinyMCE.settings = settings; + for (i=0; i'); - elm.setAttribute('mce_noask', 'true'); -}; + this.loadedFiles[this.loadedFiles.length] = url; + }, -TinyMCE.prototype.updateContent = function(form_element_name) { - // Find MCE instance linked to given form element and copy it's value - var formElement = document.getElementById(form_element_name); - for (var n in tinyMCE.instances) { - var inst = tinyMCE.instances[n]; - if (!tinyMCE.isInstance(inst)) - continue; + loadNextScript : function() { + var d = document, se; - inst.switchSettings(); + if (!tinyMCE.settings.strict_loading_mode) + return; - if (inst.formElement == formElement) { - var doc = inst.getDoc(); - - tinyMCE._setHTML(doc, inst.formElement.value); + if (this.loadingIndex < this.pendingFiles.length) { + se = d.createElementNS('http://www.w3.org/1999/xhtml', 'script'); + se.setAttribute('language', 'javascript'); + se.setAttribute('type', 'text/javascript'); + se.setAttribute('src', this.pendingFiles[this.loadingIndex++]); - if (!tinyMCE.isMSIE) - doc.body.innerHTML = tinyMCE._cleanupHTML(inst, doc, this.settings, doc.body, inst.visualAid); - } - } -}; + d.getElementsByTagName("head")[0].appendChild(se); + } else + this.loadingIndex = -1; // Done with loading + }, -TinyMCE.prototype.addMCEControl = function(replace_element, form_element_name, target_document) { - var id = "mce_editor_" + tinyMCE.idCounter++; - var inst = new TinyMCEControl(tinyMCE.settings); + loadCSS : function(url) { + var ar = url.replace(/\s+/, '').split(','); + var lflen = 0, csslen = 0; + var skip = false; + var x = 0, i = 0, nl, le; + + for (x = 0,csslen = ar.length; x 0) { + /* Make sure it doesn't exist. */ + for (i=0, lflen=this.loadedFiles.length; i'); -TinyMCE.prototype.triggerSave = function(skip_cleanup, skip_callback) { - // Cleanup and set all form fields - for (var n in tinyMCE.instances) { - var inst = tinyMCE.instances[n]; - if (!tinyMCE.isInstance(inst)) - continue; + this.loadedFiles[this.loadedFiles.length] = ar[x]; + } + } + } + }, - inst.switchSettings(); + importCSS : function(doc, css) { + var css_ary = css.replace(/\s+/, '').split(','); + var csslen, elm, headArr, x, css_file; - tinyMCE.settings['preformatted'] = false; + for (x = 0, csslen = css_ary.length; x 0) { + // Is relative, make absolute + if (css_file.indexOf('://') == -1 && css_file.charAt(0) != '/') + css_file = this.documentBasePath + "/" + css_file; - // Default to false - if (typeof(skip_callback) == "undefined") - skip_callback = false; + if (typeof(doc.createStyleSheet) == "undefined") { + elm = doc.createElement("link"); - tinyMCE._setHTML(inst.getDoc(), inst.getBody().innerHTML); + elm.rel = "stylesheet"; + elm.href = css_file; - // Remove visual aids when cleanup is disabled - if (inst.settings['cleanup'] == false) { - tinyMCE.handleVisualAid(inst.getBody(), true, false, inst); - tinyMCE._setEventsEnabled(inst.getBody(), true); + if ((headArr = doc.getElementsByTagName("head")) != null && headArr.length > 0) + headArr[0].appendChild(elm); + } else + doc.createStyleSheet(css_file); + } } + }, - tinyMCE._customCleanup(inst, "submit_content_dom", inst.contentWindow.document.body); - var htm = skip_cleanup ? inst.getBody().innerHTML : tinyMCE._cleanupHTML(inst, inst.getDoc(), this.settings, inst.getBody(), this.visualAid, true); - htm = tinyMCE._customCleanup(inst, "submit_content", htm); + confirmAdd : function(e, settings) { + var elm = tinyMCE.isMSIE ? event.srcElement : e.target; + var elementId = elm.name ? elm.name : elm.id; - if (tinyMCE.settings["encoding"] == "xml" || tinyMCE.settings["encoding"] == "html") - htm = tinyMCE.convertStringToXML(htm); + tinyMCE.settings = settings; - if (!skip_callback && tinyMCE.settings['save_callback'] != "") - var content = eval(tinyMCE.settings['save_callback'] + "(inst.formTargetElementId,htm,inst.getBody());"); + if (tinyMCE.settings['convert_on_click'] || (!elm.getAttribute('mce_noask') && confirm(tinyMCELang['lang_edit_confirm']))) + tinyMCE.addMCEControl(elm, elementId); - // Use callback content if available - if ((typeof(content) != "undefined") && content != null) - htm = content; + elm.setAttribute('mce_noask', 'true'); + }, - // Replace some weird entities (Bug: #1056343) - htm = tinyMCE.regexpReplace(htm, "(", "(", "gi"); - htm = tinyMCE.regexpReplace(htm, ")", ")", "gi"); - htm = tinyMCE.regexpReplace(htm, ";", ";", "gi"); - htm = tinyMCE.regexpReplace(htm, """, """, "gi"); - htm = tinyMCE.regexpReplace(htm, "^", "^", "gi"); + updateContent : function(form_element_name) { + // Find MCE instance linked to given form element and copy it's value + var formElement = document.getElementById(form_element_name); + for (var n in tinyMCE.instances) { + var inst = tinyMCE.instances[n]; + if (!tinyMCE.isInstance(inst)) + continue; - if (inst.formElement) - inst.formElement.value = htm; - } -}; + inst.switchSettings(); -TinyMCE.prototype._setEventsEnabled = function(node, state) { - var events = new Array('onfocus','onblur','onclick','ondblclick', - 'onmousedown','onmouseup','onmouseover','onmousemove', - 'onmouseout','onkeypress','onkeydown','onkeydown','onkeyup'); + if (inst.formElement == formElement) { + var doc = inst.getDoc(); + + tinyMCE._setHTML(doc, inst.formElement.value); - var evs = tinyMCE.settings['event_elements'].split(','); - for (var y=0; y'); + content = content.replace(/"/g, '"'); + content = content.replace(/&/g, '&'); + } - tinyMCE.addEvent(doc, "keypress", tinyMCE.handleEvent); - tinyMCE.addEvent(doc, "keydown", tinyMCE.handleEvent); - tinyMCE.addEvent(doc, "keyup", tinyMCE.handleEvent); - tinyMCE.addEvent(doc, "click", tinyMCE.handleEvent); - tinyMCE.addEvent(doc, "mouseup", tinyMCE.handleEvent); - tinyMCE.addEvent(doc, "mousedown", tinyMCE.handleEvent); - tinyMCE.addEvent(doc, "focus", tinyMCE.handleEvent); - tinyMCE.addEvent(doc, "blur", tinyMCE.handleEvent); + inst.switchSettings(); - eval('try { doc.designMode = "On"; } catch(e) {}'); - } -}; + // Not loaded correctly hit it again, Mozilla bug #997860 + if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { + // This part will remove the designMode status + // Failes first time in Firefox 1.5b2 on Mac + try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} + window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); + return; + } -TinyMCE.prototype._createIFrame = function(replace_element) { - var iframe = document.createElement("iframe"); - var id = replace_element.getAttribute("id"); - var aw, ah; + if (!head) { + window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); + return; + } - aw = "" + tinyMCE.settings['area_width']; - ah = "" + tinyMCE.settings['area_height']; + // Import theme specific content CSS the user specific + tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); + tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); + tinyMCE.dispatchCallback(inst, 'init_instance_callback', 'initInstance', inst); - if (aw.indexOf('%') == -1) { - aw = parseInt(aw); - aw = aw < 0 ? 300 : aw; - aw = aw + "px"; - } + // Setup keyboard shortcuts + if (tinyMCE.getParam('custom_undo_redo_keyboard_shortcuts')) { + inst.addShortcut('ctrl', 'z', 'lang_undo_desc', 'Undo'); + inst.addShortcut('ctrl', 'y', 'lang_redo_desc', 'Redo'); + } - if (ah.indexOf('%') == -1) { - ah = parseInt(ah); - ah = ah < 0 ? 240 : ah; - ah = ah + "px"; - } + // Add default shortcuts for gecko + if (tinyMCE.isGecko) { + inst.addShortcut('ctrl', 'b', 'lang_bold_desc', 'Bold'); + inst.addShortcut('ctrl', 'i', 'lang_italic_desc', 'Italic'); + inst.addShortcut('ctrl', 'u', 'lang_underline_desc', 'Underline'); + } - iframe.setAttribute("id", id); - //iframe.setAttribute("className", "mceEditorArea"); - iframe.setAttribute("border", "0"); - iframe.setAttribute("frameBorder", "0"); - iframe.setAttribute("marginWidth", "0"); - iframe.setAttribute("marginHeight", "0"); - iframe.setAttribute("leftMargin", "0"); - iframe.setAttribute("topMargin", "0"); - iframe.setAttribute("width", aw); - iframe.setAttribute("height", ah); - iframe.setAttribute("allowtransparency", "true"); + // Setup span styles + if (tinyMCE.getParam("convert_fonts_to_spans")) + inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); - if (tinyMCE.settings["auto_resize"]) - iframe.setAttribute("scrolling", "no"); + if (tinyMCE.settings['nowrap']) + doc.body.style.whiteSpace = "nowrap"; - // Must have a src element in MSIE HTTPs breaks aswell as absoute URLs - if (tinyMCE.isMSIE && !tinyMCE.isOpera) - iframe.setAttribute("src", this.settings['default_document']); + doc.body.dir = this.settings['directionality']; + doc.editorId = editor_id; - iframe.style.width = aw; - iframe.style.height = ah; + // Add on document element in Mozilla + if (!tinyMCE.isMSIE) + doc.documentElement.editorId = editor_id; - // MSIE 5.0 issue - if (tinyMCE.isMSIE && !tinyMCE.isOpera) - replace_element.outerHTML = iframe.outerHTML; - else - replace_element.parentNode.replaceChild(iframe, replace_element); + inst.setBaseHREF(tinyMCE.settings['base_href']); - if (tinyMCE.isMSIE) - return window.frames[id]; - else - return iframe; -}; + // Replace new line characters to BRs + if (tinyMCE.settings['convert_newlines_to_brs']) { + content = tinyMCE.regexpReplace(content, "\r\n", "
      ", "gi"); + content = tinyMCE.regexpReplace(content, "\r", "
      ", "gi"); + content = tinyMCE.regexpReplace(content, "\n", "
      ", "gi"); + } -TinyMCE.prototype.setupContent = function(editor_id) { - var inst = tinyMCE.instances[editor_id]; - var doc = inst.getDoc(); - var head = doc.getElementsByTagName('head').item(0); - var content = inst.startContent; + // Open closed anchors + // content = content.replace(new RegExp('', 'gi'), ''); - tinyMCE.operaOpacityCounter = 100 * tinyMCE.idCounter; + // Call custom cleanup code + content = tinyMCE.storeAwayURLs(content); + content = tinyMCE._customCleanup(inst, "insert_to_editor", content); - inst.switchSettings(); + if (tinyMCE.isMSIE) { + // Ugly!!! + window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["' + editor_id + '"].getDoc(), "' + editor_id + '");}catch(e){}', 500); - // Not loaded correctly hit it again, Mozilla bug #997860 - if (!tinyMCE.isMSIE && tinyMCE.getParam("setupcontent_reload", false) && doc.title != "blank_page") { - // This part will remove the designMode status - // Failes first time in Firefox 1.5b2 on Mac - try {doc.location.href = tinyMCE.baseURL + "/blank.htm";} catch (ex) {} - window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 1000); - return; - } + if (tinyMCE.settings["force_br_newlines"]) + doc.styleSheets[0].addRule("p", "margin: 0;"); - if (!head) { - window.setTimeout("tinyMCE.setupContent('" + editor_id + "');", 10); - return; - } + var body = inst.getBody(); + body.editorId = editor_id; + } - // Import theme specific content CSS the user specific - tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/themes/" + inst.settings['theme'] + "/css/editor_content.css"); - tinyMCE.importCSS(inst.getDoc(), inst.settings['content_css']); - tinyMCE.executeCallback('init_instance_callback', '_initInstance', 0, inst); + content = tinyMCE.cleanupHTMLCode(content); - // Setup span styles - if (tinyMCE.getParam("convert_fonts_to_spans")) - inst.getDoc().body.setAttribute('id', 'mceSpanFonts'); + // Fix for bug #958637 + if (!tinyMCE.isMSIE) { + var contentElement = inst.getDoc().createElement("body"); + var doc = inst.getDoc(); - if (tinyMCE.settings['nowrap']) - doc.body.style.whiteSpace = "nowrap"; + contentElement.innerHTML = content; - doc.body.dir = this.settings['directionality']; - doc.editorId = editor_id; + // Remove weridness! + if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) + content = content.replace(new RegExp('<>', 'g'), ""); + + if (tinyMCE.settings['cleanup_on_startup']) + tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); + else { + // Convert all strong/em to b/i + content = tinyMCE.regexpReplace(content, "", "", "gi"); + content = tinyMCE.regexpReplace(content, "", "", "gi"); + content = tinyMCE.regexpReplace(content, "", "", "gi"); + tinyMCE.setInnerHTML(inst.getBody(), content); + } - // Add on document element in Mozilla - if (!tinyMCE.isMSIE) - doc.documentElement.editorId = editor_id; + tinyMCE.convertAllRelativeURLs(inst.getBody()); + } else { + if (tinyMCE.settings['cleanup_on_startup']) { + tinyMCE._setHTML(inst.getDoc(), content); - // Setup base element - var base = doc.createElement("base"); - base.setAttribute('href', tinyMCE.settings['base_href']); - head.appendChild(base); + // Produces permission denied error in MSIE 5.5 + eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); + } else + tinyMCE._setHTML(inst.getDoc(), content); + } - // Replace new line characters to BRs - if (tinyMCE.settings['convert_newlines_to_brs']) { - content = tinyMCE.regexpReplace(content, "\r\n", "
      ", "gi"); - content = tinyMCE.regexpReplace(content, "\r", "
      ", "gi"); - content = tinyMCE.regexpReplace(content, "\n", "
      ", "gi"); - } + // Fix for bug #957681 + //inst.getDoc().designMode = inst.getDoc().designMode; - // Open closed anchors -// content = content.replace(new RegExp('', 'gi'), ''); + // Setup element references + var parentElm = inst.targetDoc.getElementById(inst.editorId + '_parent'); + inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; - // Call custom cleanup code - content = tinyMCE.storeAwayURLs(content); - content = tinyMCE._customCleanup(inst, "insert_to_editor", content); + tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); + tinyMCE.dispatchCallback(inst, 'setupcontent_callback', 'setupContent', editor_id, inst.getBody(), inst.getDoc()); - if (tinyMCE.isMSIE) { - // Ugly!!! - window.setInterval('try{tinyMCE.getCSSClasses(document.frames["' + editor_id + '"].document, "' + editor_id + '");}catch(e){}', 500); + // Re-add design mode on mozilla + if (!tinyMCE.isMSIE) + tinyMCE.addEventHandlers(inst); - if (tinyMCE.settings["force_br_newlines"]) - document.frames[editor_id].document.styleSheets[0].addRule("p", "margin: 0px;"); + // Add blur handler + if (tinyMCE.isMSIE) { + tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE_Engine.prototype._eventPatch); + tinyMCE.addEvent(inst.getBody(), "beforedeactivate", TinyMCE_Engine.prototype._eventPatch); // Bug #1439953 - var body = document.frames[editor_id].document.body; + // Workaround for drag drop/copy paste base href bug + if (!tinyMCE.isOpera) { + tinyMCE.addEvent(doc.body, "mousemove", TinyMCE_Engine.prototype.onMouseMove); + tinyMCE.addEvent(doc.body, "beforepaste", TinyMCE_Engine.prototype._eventPatch); + tinyMCE.addEvent(doc.body, "drop", TinyMCE_Engine.prototype._eventPatch); + } + } - tinyMCE.addEvent(body, "beforepaste", TinyMCE.prototype.eventPatch); - tinyMCE.addEvent(body, "beforecut", TinyMCE.prototype.eventPatch); + // Trigger node change, this call locks buttons for tables and so forth + tinyMCE.selectedInstance = inst; + tinyMCE.selectedElement = inst.contentWindow.document.body; + + // Call custom DOM cleanup + tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); + tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); + tinyMCE._setEventsEnabled(inst.getBody(), false); + tinyMCE.cleanupAnchors(inst.getDoc()); + + if (tinyMCE.getParam("convert_fonts_to_spans")) + tinyMCE.convertSpansToFonts(inst.getDoc()); + + inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); + inst.undoRedo.add({ content : inst.startContent }); + + // Cleanup any mess left from storyAwayURLs + if (tinyMCE.isGecko) { + // Remove mce_src from textnodes and comments + tinyMCE.selectNodes(inst.getBody(), function(n) { + if (n.nodeType == 3 || n.nodeType == 8) { + n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); + n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); + } - body.editorId = editor_id; - } + return false; + }); + } - content = tinyMCE.cleanupHTMLCode(content); + // Cleanup any mess left from storyAwayURLs + tinyMCE._removeInternal(inst.getBody()); - // Fix for bug #958637 - if (!tinyMCE.isMSIE) { - var contentElement = inst.getDoc().createElement("body"); - var doc = inst.getDoc(); + tinyMCE.selectedInstance = inst; + tinyMCE.triggerNodeChange(false, true); + }, - contentElement.innerHTML = content; + storeAwayURLs : function(s) { + // Remove all mce_src, mce_href and replace them with new ones + // s = s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"', 'gi'), ''); + // s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), ''); + + if (!s.match(/(mce_src|mce_href)/gi, s)) { + s = s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'src="$1" mce_src="$1"'); + s = s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'href="$1" mce_href="$1"'); + } + + return s; + }, + + _removeInternal : function(n) { + if (tinyMCE.isGecko) { + // Remove mce_src from textnodes and comments + tinyMCE.selectNodes(n, function(n) { + if (n.nodeType == 3 || n.nodeType == 8) { + n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_src=\"[^\"]*\"', 'gi'), ""); + n.nodeValue = n.nodeValue.replace(new RegExp('\\smce_href=\"[^\"]*\"', 'gi'), ""); + } - // Remove weridness! - if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) - content = content.replace(new RegExp('<>', 'g'), ""); - - if (tinyMCE.settings['cleanup_on_startup']) - tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, doc, this.settings, contentElement)); - else { - // Convert all strong/em to b/i - content = tinyMCE.regexpReplace(content, "", "", "gi"); - content = tinyMCE.regexpReplace(content, "", "", "gi"); - content = tinyMCE.regexpReplace(content, "", "", "gi"); - tinyMCE.setInnerHTML(inst.getBody(), content); + return false; + }); } + }, - inst.convertAllRelativeURLs(); - } else { - if (tinyMCE.settings['cleanup_on_startup']) { - tinyMCE._setHTML(inst.getDoc(), content); + removeTinyMCEFormElements : function(form_obj) { + // Check if form is valid + if (typeof(form_obj) == "undefined" || form_obj == null) + return; - // Produces permission denied error in MSIE 5.5 - eval('try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}'); - } else - tinyMCE._setHTML(inst.getDoc(), content); - } + // If not a form, find the form + if (form_obj.nodeName != "FORM") { + if (form_obj.form) + form_obj = form_obj.form; + else + form_obj = tinyMCE.getParentElement(form_obj, "form"); + } - // Fix for bug #957681 - //inst.getDoc().designMode = inst.getDoc().designMode; - - // Setup element references - var parentElm = document.getElementById(inst.editorId + '_parent'); - if (parentElm.lastChild.nodeName == "INPUT") - inst.formElement = tinyMCE.isGecko ? parentElm.firstChild : parentElm.lastChild; - else - inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling; - - tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst); - tinyMCE.executeCallback('setupcontent_callback', '_setupContent', 0, editor_id, inst.getBody(), inst.getDoc()); - - // Re-add design mode on mozilla - if (!tinyMCE.isMSIE) - TinyMCE.prototype.addEventHandlers(editor_id); - - // Add blur handler - if (tinyMCE.isMSIE) - tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE.prototype.eventPatch); - - // Trigger node change, this call locks buttons for tables and so forth - tinyMCE.selectedInstance = inst; - tinyMCE.selectedElement = inst.contentWindow.document.body; - - if (!inst.isHidden()) - tinyMCE.triggerNodeChange(false, true); - - // Call custom DOM cleanup - tinyMCE._customCleanup(inst, "insert_to_editor_dom", inst.getBody()); - tinyMCE._customCleanup(inst, "setup_content_dom", inst.getBody()); - tinyMCE._setEventsEnabled(inst.getBody(), false); - tinyMCE.cleanupAnchors(inst.getDoc()); - - if (tinyMCE.getParam("convert_fonts_to_spans")) - tinyMCE.convertSpansToFonts(inst.getDoc()); - - inst.startContent = tinyMCE.trim(inst.getBody().innerHTML); - inst.undoLevels[inst.undoLevels.length] = inst.startContent; - - tinyMCE.operaOpacityCounter = -1; -}; - -TinyMCE.prototype.cleanupHTMLCode = function(s) { - s = s.replace(/

      /gi, '

       

      '); - s = s.replace(/

      \s*<\/p>/gi, '

       

      '); - - // Open closed tags like to -// tinyMCE.debug("f:" + s); - s = s.replace(/<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\|>]*?)\/>/gi, '<$1$2$3>'); -// tinyMCE.debug("e:" + s); - - // Remove trailing space to - s = s.replace(new RegExp('\\s+> to - s = s.replace(/<(img|br|hr)(.*?)><\/(img|br|hr)>/gi, '<$1$2 />'); - - // Weird MSIE bug,


      breaks runtime? - if (tinyMCE.isMSIE) - s = s.replace(/


      <\/p>/gi, "
      "); - - // Convert relative anchors to absolute URLs ex: #something to file.htm#something - s = s.replace(new RegExp('(href=\"?)(\\s*?#)', 'gi'), '$1' + tinyMCE.settings['document_base_url'] + "#"); - - return s; -}; - -TinyMCE.prototype.storeAwayURLs = function(s) { - // Remove all mce_src, mce_href and replace them with new ones - s = s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"', 'gi'), ''); - s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), ''); - s = s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'src="$1" mce_src="$1"'); - s = s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'href="$1" mce_href="$1"'); - - return s; -}; - -TinyMCE.prototype.cancelEvent = function(e) { - if (tinyMCE.isMSIE) { - e.returnValue = false; - e.cancelBubble = true; - } else - e.preventDefault(); -}; - -TinyMCE.prototype.removeTinyMCEFormElements = function(form_obj) { - // Check if form is valid - if (typeof(form_obj) == "undefined" || form_obj == null) - return; - - // If not a form, find the form - if (form_obj.nodeName != "FORM") { - if (form_obj.form) - form_obj = form_obj.form; - else - form_obj = tinyMCE.getParentElement(form_obj, "form"); - } - - // Still nothing - if (form_obj == null) - return; - - // Disable all UI form elements that TinyMCE created - for (var i=0; i"); + rng.collapse(false); + rng.select(); - if (tinyMCE.getParentElement(rng.parentElement(), "li") != null) + tinyMCE.execCommand("mceAddUndoLevel"); + tinyMCE.triggerNodeChange(false); return false; + } + } - // Cancel event - e.returnValue = false; - e.cancelBubble = true; - - // Insert BR element - rng.pasteHTML("
      "); - rng.collapse(false); - rng.select(); - - tinyMCE.execCommand("mceAddUndoLevel"); + // Backspace or delete + if (e.keyCode == 8 || e.keyCode == 46) { + tinyMCE.selectedElement = e.target; + tinyMCE.linkElement = tinyMCE.getParentElement(e.target, "a"); + tinyMCE.imgElement = tinyMCE.getParentElement(e.target, "img"); tinyMCE.triggerNodeChange(false); - return false; } - } - // Backspace or delete - if (e.keyCode == 8 || e.keyCode == 46) { - tinyMCE.selectedElement = e.target; - tinyMCE.linkElement = tinyMCE.getParentElement(e.target, "a"); - tinyMCE.imgElement = tinyMCE.getParentElement(e.target, "img"); - tinyMCE.triggerNodeChange(false); - } + return false; + break; - return false; - break; + case "keyup": + case "keydown": + tinyMCE.hideMenus(); + tinyMCE.hasMouseMoved = false; - case "keyup": - case "keydown": - if (e.target.editorId) - tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId]; - else - return; + if (inst && inst.handleShortcut(e)) + return false; - if (tinyMCE.selectedInstance) - tinyMCE.selectedInstance.switchSettings(); + if (e.target.editorId) + tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId]; + else + return; - var inst = tinyMCE.selectedInstance; + if (tinyMCE.selectedInstance) + tinyMCE.selectedInstance.switchSettings(); - // Handle backspace - if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) { - // Insert P element instead of BR - if (tinyMCE.selectedInstance._handleBackSpace(e.type)) { - // Cancel event - tinyMCE.execCommand("mceAddUndoLevel"); - e.preventDefault(); - return false; - } - } + var inst = tinyMCE.selectedInstance; - tinyMCE.selectedElement = null; - tinyMCE.selectedNode = null; - var elm = tinyMCE.selectedInstance.getFocusElement(); - tinyMCE.linkElement = tinyMCE.getParentElement(elm, "a"); - tinyMCE.imgElement = tinyMCE.getParentElement(elm, "img"); - tinyMCE.selectedElement = elm; - - // Update visualaids on tabs - if (tinyMCE.isGecko && e.type == "keyup" && e.keyCode == 9) - tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(), true, tinyMCE.settings['visual'], tinyMCE.selectedInstance); - - // Fix empty elements on return/enter, check where enter occured - if (tinyMCE.isMSIE && e.type == "keydown" && e.keyCode == 13) - tinyMCE.enterKeyElement = tinyMCE.selectedInstance.getFocusElement(); - - // Fix empty elements on return/enter - if (tinyMCE.isMSIE && e.type == "keyup" && e.keyCode == 13) { - var elm = tinyMCE.enterKeyElement; - if (elm) { - var re = new RegExp('^HR|IMG|BR$','g'); // Skip these - var dre = new RegExp('^H[1-6]$','g'); // Add double on these - - if (!elm.hasChildNodes() && !re.test(elm.nodeName)) { - if (dre.test(elm.nodeName)) - elm.innerHTML = "  "; - else - elm.innerHTML = " "; + // Handle backspace + if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) { + // Insert P element instead of BR + if (TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance, e.type)) { + // Cancel event + tinyMCE.execCommand("mceAddUndoLevel"); + e.preventDefault(); + return false; } } - } - // Check if it's a position key - var keys = tinyMCE.posKeyCodes; - var posKey = false; - for (var i=0; i'; + h += ''; + h += ''; + } else { + // Normal button + h += ''; + h += ''; + h += ''; + } + + return h; + }, + + addButtonMap : function(m) { + var i, a = m.replace(/\s+/, '').split(','); + + for (i=0; i -1) - suffix = '?rnd=' + this.operaOpacityCounter++; + for (var c=0; c 0); - // Remove element - var replaceElement = document.getElementById(editor_id + "_parent"); - var oldTargetElement = inst.oldTargetElement; - var targetName = oldTargetElement.nodeName.toLowerCase(); - - if (targetName == "textarea" || targetName == "input") { - // Just show the old text area - replaceElement.parentNode.removeChild(replaceElement); - oldTargetElement.style.display = "inline"; - oldTargetElement.value = html; - } else { - oldTargetElement.innerHTML = html; + if (tinyMCE.settings['custom_undo_redo']) { + undoIndex = inst.undoRedo.undoIndex; + undoLevels = inst.undoRedo.undoLevels.length; + } - replaceElement.parentNode.insertBefore(oldTargetElement, replaceElement); - replaceElement.parentNode.removeChild(replaceElement); + tinyMCE.dispatchCallback(inst, 'handle_node_change_callback', 'handleNodeChange', editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection, setup_content); } - } -}; -TinyMCE.prototype._cleanupElementName = function(element_name, element) { - var name = ""; + if (this.selectedInstance && (typeof(focus) == "undefined" || focus)) + this.selectedInstance.contentWindow.focus(); + }, - element_name = element_name.toLowerCase(); + _customCleanup : function(inst, type, content) { + var pl, po, i; - // Never include body - if (element_name == "body") - return null; + // Call custom cleanup + var customCleanup = tinyMCE.settings['cleanup_callback']; + if (customCleanup != "" && eval("typeof(" + customCleanup + ")") != "undefined") + content = eval(customCleanup + "(type, content, inst);"); - // If verification mode - if (tinyMCE.cleanup_verify_html) { - // Check if invalid element - for (var i=0; i 0) { + for (i=ar.length-1; i>=0; i--) { + s = ar[i].substring(2, ar[i].length-1); - if (val != '') { - val = '' + val; + if (s.indexOf('lang_') == 0 && tinyMCELang[s]) + h = tinyMCE.replaceVar(h, s, tinyMCELang[s]); + else if (as && as[s]) + h = tinyMCE.replaceVar(h, s, as[s]); + else if (tinyMCE.settings[s]) + h = tinyMCE.replaceVar(h, s, tinyMCE.settings[s]); + } + } - switch (attrib) { - case "background": - val = "url('" + val + "')"; - break; + h = tinyMCE.replaceVar(h, "themeurl", tinyMCE.themeURL); - case "bordercolor": - if (elm.style.borderStyle == '' || elm.style.borderStyle == 'none') - elm.style.borderStyle = 'solid'; - break; + return h; + }, - case "border": - case "width": - case "height": - if (attrib == "border" && elm.style.borderWidth > 0) - return; + replaceVar : function(h, r, v) { + return h.replace(new RegExp('{\\\$' + r + '}', 'g'), v); + }, - if (val.indexOf('%') == -1) - val += 'px'; - break; + openWindow : function(template, args) { + var html, width, height, x, y, resizable, scrollbars, url; - case "vspace": - case "hspace": - elm.style.marginTop = val + "px"; - elm.style.marginBottom = val + "px"; - elm.removeAttribute(attrib); - return; + args['mce_template_file'] = template['file']; + args['mce_width'] = template['width']; + args['mce_height'] = template['height']; + tinyMCE.windowArgs = args; - case "align": - if (elm.nodeName == "IMG") { - if (tinyMCE.isMSIE) - elm.style.styleFloat = val; - else - elm.style.cssFloat = val; - } else - elm.style.textAlign = val; + html = template['html']; + if (!(width = parseInt(template['width']))) + width = 320; - elm.removeAttribute(attrib); - return; - } + if (!(height = parseInt(template['height']))) + height = 200; - if (val != '') { - eval('elm.style.' + style + ' = val;'); - elm.removeAttribute(attrib); - } - } - } else { - if (style == '') - return; + // Add to height in M$ due to SP2 WHY DON'T YOU GUYS IMPLEMENT innerWidth of windows!! + if (tinyMCE.isMSIE) + height += 40; + else + height += 20; - var val = eval('elm.style.' + style) == '' ? tinyMCE.getAttrib(elm, attrib) : eval('elm.style.' + style); - val = val == null ? '' : '' + val; + x = parseInt(screen.width / 2.0) - (width / 2.0); + y = parseInt(screen.height / 2.0) - (height / 2.0); - switch (attrib) { - // Always move background to style - case "background": - if (val.indexOf('url') == -1 && val != '') - val = "url('" + val + "');"; - - if (val != '') { - elm.style.backgroundImage = val; - elm.removeAttribute(attrib); - } - return; + resizable = (args && args['resizable']) ? args['resizable'] : "no"; + scrollbars = (args && args['scrollbars']) ? args['scrollbars'] : "no"; - case "border": - case "width": - case "height": - val = val.replace('px', ''); - break; + if (template['file'].charAt(0) != '/' && template['file'].indexOf('://') == -1) + url = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/" + template['file']; + else + url = template['file']; - case "align": - if (tinyMCE.getAttrib(elm, 'align') == '') { - if (elm.nodeName == "IMG") { - if (tinyMCE.isMSIE && elm.style.styleFloat != '') { - val = elm.style.styleFloat; - style = 'styleFloat'; - } else if (tinyMCE.isGecko && elm.style.cssFloat != '') { - val = elm.style.cssFloat; - style = 'cssFloat'; - } - } - } - break; - } + // Replace all args as variables in URL + for (var name in args) { + if (typeof(args[name]) == 'function') + continue; - if (val != '') { - elm.removeAttribute(attrib); - elm.setAttribute(attrib, val); - eval('elm.style.' + style + ' = "";'); + url = tinyMCE.replaceVar(url, name, escape(args[name])); } - } -}; -TinyMCE.prototype._cleanupAttribute = function(valid_attributes, element_name, attribute_node, element_node) { - var attribName = attribute_node.nodeName.toLowerCase(); - var attribValue = attribute_node.nodeValue; - var attribMustBeValue = null; - var verified = false; + if (html) { + html = tinyMCE.replaceVar(html, "css", this.settings['popups_css']); + html = tinyMCE.applyTemplate(html, args); - // Mozilla attibute, remove them - if (attribName.indexOf('moz_') != -1) - return null; + var win = window.open("", "mcePopup" + new Date().getTime(), "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=yes,minimizable=" + resizable + ",modal=yes,width=" + width + ",height=" + height + ",resizable=" + resizable); + if (win == null) { + alert(tinyMCELang['lang_popup_blocked']); + return; + } - if (!tinyMCE.cleanup_on_save && (attribName == "mce_href" || attribName == "mce_src")) - return {name : attribName, value : attribValue}; + win.document.write(html); + win.document.close(); + win.resizeTo(width, height); + win.focus(); + } else { + if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && resizable != 'yes' && tinyMCE.settings["dialog_type"] == "modal") { + height += 10; - // Verify attrib - if (tinyMCE.cleanup_verify_html && !verified) { - for (var i=1; i 0) + className += " "; - break; + className += classNames[i]; + } - case "colspan": - case "rowspan": - // Not needed - if (attribValue == "1") - return null; - break; + return className; + }, - // Skip these - case "_moz-userdefined": - case "editorid": - case "mce_href": - case "mce_src": - return null; - } + handleVisualAid : function(el, deep, state, inst, skip_dispatch) { + if (!el) + return; - // Not the must be value - if (attribMustBeValue != null) { - var isCorrect = false; - for (var i=0; i 1) - val = "url('" + eval(tinyMCE.getParam('urlconverter_callback') + "(m[1], null, true);") + "')"; - } + n[i].removeAttribute("mce_thref"); + } + } + } - // Force HEX colors - if (tinyMCE.getParam("force_hex_style_colors")) - val = tinyMCE.convertRGBToHex(val, true); + el = tinyMCE.selectNodes(e, function(n) { + if (n.nodeType == 3 || n.nodeType == 8) { + n.nodeValue = n.nodeValue.replace(/\smce_tsrc=/gi, " src="); + n.nodeValue = n.nodeValue.replace(/\smce_thref=/gi, " href="); + } - if (val != "url('')") - str += key.toLowerCase() + ": " + val + "; "; + return false; + }); + } } - } - if (new RegExp('; $').test(str)) - str = str.substring(0, str.length - 2); + return h; + }, - return str; -}; + _setHTML : function(doc, html_content) { + // Force closed anchors open + //html_content = html_content.replace(new RegExp('', 'gi'), ''); -TinyMCE.prototype.convertRGBToHex = function(s, k) { - if (s.toLowerCase().indexOf('rgb') != -1) { - var re = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi"); - var rgb = s.replace(re, "$1,$2,$3,$4,$5").split(','); - if (rgb.length == 5) { - r = parseInt(rgb[1]).toString(16); - g = parseInt(rgb[2]).toString(16); - b = parseInt(rgb[3]).toString(16); + html_content = tinyMCE.cleanupHTMLCode(html_content); - r = r.length == 1 ? '0' + r : r; - g = g.length == 1 ? '0' + g : g; - b = b.length == 1 ? '0' + b : b; + // Try innerHTML if it fails use pasteHTML in MSIE + try { + tinyMCE.setInnerHTML(doc.body, html_content); + } catch (e) { + if (this.isMSIE) + doc.body.createTextRange().pasteHTML(html_content); + } - s = "#" + r + g + b; + // Content duplication bug fix + if (tinyMCE.isMSIE && tinyMCE.settings['fix_content_duplication']) { + // Remove P elements in P elements + var paras = doc.getElementsByTagName("P"); + for (var i=0; i<\/o:p>", "
      "); + html = tinyMCE.regexpReplace(html, " <\/o:p>", ""); + html = tinyMCE.regexpReplace(html, "", ""); + html = tinyMCE.regexpReplace(html, "

      <\/p>", ""); + html = tinyMCE.regexpReplace(html, "

      <\/p>\r\n

      <\/p>", ""); + html = tinyMCE.regexpReplace(html, "

       <\/p>", "
      "); + html = tinyMCE.regexpReplace(html, "

      \s*(

      \s*)?", "

      "); + html = tinyMCE.regexpReplace(html, "<\/p>\s*(<\/p>\s*)?", "

      "); + }*/ + + // Always set the htmlText output + tinyMCE.setInnerHTML(doc.body, html); } - } - return s; -}; + tinyMCE.cleanupAnchors(doc); -TinyMCE.prototype.convertHexToRGB = function(s) { - if (s.indexOf('#') != -1) { - s = s.replace(new RegExp('[^0-9A-F]', 'gi'), ''); - return "rgb(" + parseInt(s.substring(0, 2), 16) + "," + parseInt(s.substring(2, 4), 16) + "," + parseInt(s.substring(4, 6), 16) + ")"; - } + if (tinyMCE.getParam("convert_fonts_to_spans")) + tinyMCE.convertSpansToFonts(doc); + }, - return s; -}; + getEditorId : function(form_element) { + var inst = this.getInstanceById(form_element); + if (!inst) + return null; -TinyMCE.prototype._verifyClass = function(node) { - // Sometimes the class gets set to null, weird Gecko bug? - if (tinyMCE.isGecko) { - var className = node.getAttribute('class'); - if (!className) - return false; - } + return inst.editorId; + }, - // Trim CSS class - if (tinyMCE.isMSIE) - var className = node.getAttribute('className'); + getInstanceById : function(editor_id) { + var inst = this.instances[editor_id]; + if (!inst) { + for (var n in tinyMCE.instances) { + var instance = tinyMCE.instances[n]; + if (!tinyMCE.isInstance(instance)) + continue; - if (tinyMCE.cleanup_verify_css_classes && tinyMCE.cleanup_on_save) { - var csses = tinyMCE.getCSSClasses(); - nonDefinedCSS = true; - for (var c=0; c' + output; - } + break; } - // Remove deprecated attributes - var re = new RegExp("^(TABLE|TD|TR)$"); - if (re.test(node.nodeName)) { - // Move attrib to style - if ((node.nodeName != "TABLE" || tinyMCE.cleanup_inline_styles) && (width = tinyMCE.getAttrib(node, "width")) != '') { - node.style.width = width.indexOf('%') != -1 ? width : width.replace(/[^0-9]/gi, '') + "px"; - node.removeAttribute("width"); - } - - // Is table and not inline - if ((node.nodeName == "TABLE" && !tinyMCE.cleanup_inline_styles) && node.style.width != '') { - tinyMCE.setAttrib(node, "width", node.style.width.replace('px','')); - node.style.width = ''; - } + doc = instance.getDoc(); + } - // Move attrib to style - if ((height = tinyMCE.getAttrib(node, "height")) != '') { - height = "" + height; // Force string - node.style.height = height.indexOf('%') != -1 ? height : height.replace(/[^0-9]/gi, '') + "px"; - node.removeAttribute("height"); - } - } + if (typeof(doc) == "undefined") { + var instance = tinyMCE.getInstanceById(editor_id); + doc = instance.getDoc(); + } - // Handle inline/outline styles - if (tinyMCE.cleanup_inline_styles) { - var re = new RegExp("^(TABLE|TD|TR|IMG|HR)$"); - if (re.test(node.nodeName) && tinyMCE.getAttrib(node, "class").indexOf('mceItem') == -1) { - tinyMCE._moveStyle(node, 'width', 'width'); - tinyMCE._moveStyle(node, 'height', 'height'); - tinyMCE._moveStyle(node, 'borderWidth', 'border'); - tinyMCE._moveStyle(node, '', 'vspace'); - tinyMCE._moveStyle(node, '', 'hspace'); - tinyMCE._moveStyle(node, 'textAlign', 'align'); - tinyMCE._moveStyle(node, 'backgroundColor', 'bgColor'); - tinyMCE._moveStyle(node, 'borderColor', 'borderColor'); - tinyMCE._moveStyle(node, 'backgroundImage', 'background'); + if (doc) { + var styles = doc.styleSheets; - // Refresh element in old MSIE - if (tinyMCE.isMSIE5) - node.outerHTML = node.outerHTML; - } else if (tinyMCE.isBlockElement(node)) - tinyMCE._moveStyle(node, 'textAlign', 'align'); + if (styles && styles.length > 0) { + for (var x=0; x" + node.innerHTML + ""; + // Cache em + if (output.length > 0) + tinyMCE.cssClasses = output; - // Remove empty tables - if (elementName == "table" && !node.hasChildNodes()) - return ""; + return output; + }, - // Handle element attributes - if (node.attributes.length > 0) { - var lastAttrib = ""; + regexpReplace : function(in_str, reg_exp, replace_str, opts) { + if (in_str == null) + return in_str; - for (var i=0; i" + this.convertStringToXML(String.fromCharCode(160)) + ""; + return ''; + }, - // Is MSIE script element - if (tinyMCE.isMSIE && elementName == "script") - return "<" + elementName + elementAttribs + ">" + node.text + ""; + evalFunc : function(f, idx, a) { + var s = '(', i; - // Clean up children - if (node.hasChildNodes()) { - // If not empty span - if (!(elementName == "span" && elementAttribs == "" && tinyMCE.getParam("trim_span_elements"))) { - // Force BR - if (elementName == "p" && tinyMCE.cleanup_force_br_newlines) - output += ""; - else - output += "<" + elementName + elementAttribs + ">"; - } + for (i=idx; i"; - } - } else { - if (!nonEmptyTag) { - if (openTag) - output += "<" + elementName + elementAttribs + ">"; - else - output += "<" + elementName + elementAttribs + " />"; - } - } + s += ');'; - return output; + return eval("f" + s); + }, - case 3: // Text - // Do not convert script elements - if (node.parentNode.nodeName == "SCRIPT" || node.parentNode.nodeName == "NOSCRIPT" || node.parentNode.nodeName == "STYLE") - return node.nodeValue; + dispatchCallback : function(i, p, n) { + return this.callFunc(i, p, n, 0, this.dispatchCallback.arguments); + }, - return this.convertStringToXML(node.nodeValue); + executeCallback : function(i, p, n) { + return this.callFunc(i, p, n, 1, this.executeCallback.arguments); + }, - case 8: // Comment - return ""; + execCommandCallback : function(i, p, n) { + return this.callFunc(i, p, n, 2, this.execCommandCallback.arguments); + }, - default: // Unknown - return "[UNKNOWN NODETYPE " + node.nodeType + "]"; - } -}; + callFunc : function(ins, p, n, m, a) { + var l, i, on, o, s, v; -TinyMCE.prototype.convertStringToXML = function(html_data) { - var output = ""; + s = m == 2; - for (var i=0; i 127) - output += '&#' + chr + ";"; - else - output += String.fromCharCode(chr); + if (l != '' && (v = tinyMCE.evalFunc(typeof(l) == "function" ? l : eval(l), 3, a)) == s && m > 0) + return true; - continue; + if (ins != null) { + for (i=0, l = ins.plugins; i 0) + return true; + } } - // Raw entities - if (tinyMCE.settings['entity_encoding'] == "raw") { - output += String.fromCharCode(chr); - continue; + l = tinyMCE.themes; + for (on in l) { + o = l[on]; + + if (o[n] && (v = tinyMCE.evalFunc(o[n], 3, a)) == s && m > 0) + return true; } - // Named entities - if (typeof(tinyMCE.settings['cleanup_entities']["c" + chr]) != 'undefined' && tinyMCE.settings['cleanup_entities']["c" + chr] != '') - output += '&' + tinyMCE.settings['cleanup_entities']["c" + chr] + ';'; - else - output += '' + String.fromCharCode(chr); - } + return false; + }, - return output; -}; + xmlEncode : function(s) { + s = "" + s; + s = s.replace(/&/g, '&'); + s = s.replace(new RegExp('"', 'g'), '"'); + s = s.replace(/\'/g, '''); // ' is not working in MSIE + s = s.replace(//g, '>'); -TinyMCE.prototype._getCleanupElementName = function(chunk) { - var pos; + return s; + }, - if (chunk.charAt(0) == '+') - chunk = chunk.substring(1); + extend : function(p, np) { + var o = {}; - if (chunk.charAt(0) == '-') - chunk = chunk.substring(1); + o.parent = p; - if ((pos = chunk.indexOf('/')) != -1) - chunk = chunk.substring(0, pos); + for (n in p) + o[n] = p[n]; - if ((pos = chunk.indexOf('[')) != -1) - chunk = chunk.substring(0, pos); - - return chunk; -}; - -TinyMCE.prototype._initCleanup = function() { - // Parse valid elements and attributes - var validElements = tinyMCE.settings["valid_elements"]; - validElements = validElements.split(','); - - // Handle extended valid elements - var extendedValidElements = tinyMCE.settings["extended_valid_elements"]; - extendedValidElements = extendedValidElements.split(','); - for (var i=0; i 0) { + for (i=0; i/gi, '>'); + tinyMCE.addPlugin(pn, to); + } - return html; + this.plugins[this.plugins.length] = pn; + } } +}; - if (on_save && tinyMCE.getParam("convert_fonts_to_spans")) - tinyMCE.convertFontsToSpans(doc); - - // Call custom cleanup code - tinyMCE._customCleanup(inst, on_save ? "get_from_editor_dom" : "insert_to_editor_dom", doc.body); +TinyMCE_Control.prototype = { + hasPlugin : function(n) { + var i; - // Move bgcolor to style - var n = doc.getElementsByTagName("font"); - for (var i=0; i[ \n\r]*[ \n\r]*

      ', '
      ', 'gi')); - tinyMCE.setInnerHTML(element, tinyMCE.regexpReplace(element.innerHTML, '', '', 'gi')); - } + switchSettings : function() { + if (tinyMCE.configs.length > 1 && tinyMCE.currentConfig != this.settings['index']) { + tinyMCE.settings = this.settings; + tinyMCE.currentConfig = this.settings['index']; + } + }, - var html = this.cleanupNode(element); + getBody : function() { + return this.getDoc().body; + }, - if (tinyMCE.settings['debug']) - tinyMCE.debug("Cleanup process executed in: " + (new Date().getTime()-startTime) + " ms."); + getDoc : function() { + return this.contentWindow.document; + }, - // Remove pesky HR paragraphs and other crap - html = tinyMCE.regexpReplace(html, '


      ', '
      '); - html = tinyMCE.regexpReplace(html, '

       


       

      ', '
      '); - html = tinyMCE.regexpReplace(html, '
      \\s*
      \\s*
       
      '; - if (tinyMCE.isOpera) { - this.contentDocument = this.iframeElement.contentDocument; - this.contentWindow = this.iframeElement.contentWindow; - dynamicIFrame = true; - } else { - this.contentDocument = tElm.window.document; - this.contentWindow = tElm.window; - } + for (i=0; i'; } - } - // This timeout is needed in MSIE 5.5 for some odd reason - // it seems that the document.frames isn't initialized yet? - if (tinyMCE.isMSIE) - window.setTimeout("TinyMCE.prototype.addEventHandlers('" + this.editorId + "');", 1); + h += '
      '; + break; - // Setup base HTML - var doc = this.contentDocument; - if (dynamicIFrame) { - var html = tinyMCE.getParam('doctype') + 'blank_page'; + case 'title': + h += '
      ' + t + ''; + break; - try { - if (!this.isHidden()) - this.getDoc().designMode = "on"; + case 'disabled': + h += '
      ' + t + ''; + break; - doc.open(); - doc.write(html); - doc.close(); - } catch (e) { - // Failed Mozilla 1.3 - this.getDoc().location.href = tinyMCE.baseURL + "/blank.htm"; + default: + h += '
      ' + t + ''; + } + + h += '
      '; - tinyMCE.setupContent(this.editorId, true); + e.innerHTML = h; - return true; -}; + this.needsUpdate = false; + this.updateBlocker(); + }, -TinyMCEControl.prototype.getFocusElement = function() { - if (tinyMCE.isMSIE && !tinyMCE.isOpera) { - var doc = this.getDoc(); - var rng = doc.selection.createRange(); + show : function() { + var nl, i; -// if (rng.collapse) -// rng.collapse(true); + if (tinyMCE.lastMenu == this) + return; - var elm = rng.item ? rng.item(0) : rng.parentElement(); - } else { - if (this.isHidden()) - return this.getBody(); + if (this.needsUpdate) + this.update(); - var sel = this.getSel(); - var rng = this.getRng(); + if (tinyMCE.lastMenu && tinyMCE.lastMenu != this) + tinyMCE.lastMenu.hide(); - var elm = rng.commonAncestorContainer; - //var elm = (sel && sel.anchorNode) ? sel.anchorNode : null; + TinyMCE_Layer.prototype.show.call(this); - // Handle selection a image or other control like element such as anchors - if (!rng.collapsed) { - // Is selection small - if (rng.startContainer == rng.endContainer) { - if (rng.startOffset - rng.endOffset < 2) { - if (rng.startContainer.hasChildNodes()) - elm = rng.startContainer.childNodes[rng.startOffset]; - } - } + if (!tinyMCE.isOpera) { + // Accessibility stuff +/* nl = this.getElement().getElementsByTagName("a"); + if (nl.length > 0) + nl[0].focus();*/ } - // Get the element parent of the node - elm = tinyMCE.getParentElement(elm); + tinyMCE.lastMenu = this; + } +}); + +/* file:jscripts/tiny_mce/classes/TinyMCE_Debug.class.js */ + +TinyMCE_Engine.prototype.debug = function() { + var m = "", e, a, i; + + e = document.getElementById("tinymce_debug"); + if (!e) { + var d = document.createElement("div"); + d.setAttribute("className", "debugger"); + d.className = "debugger"; + d.innerHTML = 'Debug output:'; - //if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") - // elm = tinyMCE.selectedElement; + document.body.appendChild(d); + e = document.getElementById("tinymce_debug"); } - return elm; -}; + a = this.debug.arguments; + for (i=0; i'; - html += ''; @@ -57,10 +57,10 @@ var html = ""; html += ''; - html += ''; @@ -74,7 +74,7 @@ tinyMCEPopup.openBrowser(target_form_element, type, option); } -function selectByValue(form_obj, field_name, value, add_custom) { +function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { if (!form_obj || !form_obj.elements[field_name]) return; @@ -84,7 +84,7 @@ for (var i=0; i x && mx < x + w && my > y && my < y + h)) { + MCLayer.visibleLayer = null; + + if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my)) + return true; + + l.hide(); + } + } + }, + + addCSSClass : function(e, c) { + this.removeCSSClass(e, c); + var a = this.explode(' ', e.className); + a[a.length] = c; + e.className = a.join(' '); + }, + + removeCSSClass : function(e, c) { + var a = this.explode(' ', e.className), i; + + for (i=0; isetQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); + $database->loadObject($mambot); + $params = new mosParameters( $mambot->params ); $theme = $params->get( 'theme', 'advanced' ); @@ -51,8 +50,10 @@ $invalid_elements = $params->def( 'invalid_elements', 'script,applet,iframe' ); $newlines = $params->def( 'newlines', 0 ); $cleanup = $params->def( 'cleanup', 1 ); + $cleanup_startup = $params->def( 'cleanup_startup', 0 ); $compressed = $params->def( 'compressed', 0 ); - + $relative_urls = $params->def( 'relative_urls', 0 ); + // Plugins // preview $preview = $params->def( 'preview', 1 ); @@ -76,6 +77,18 @@ $hr = $params->def( 'hr', 1 ); // fullscreen $fullscreen = $params->def( 'fullscreen', 1 ); + // autosave + $autosave = $params->def( 'autosave', 0 ); + // layer + $layer = $params->def( 'layer', 1 ); + // style + $style = $params->def( 'style', 1 ); + + if ( $relative_urls ) { + $relative_urls = 'true'; + } else { + $relative_urls = 'false'; + } if ( $content_css_custom ) { $content_css = 'content_css : "'. $content_css_custom .'", '; @@ -110,10 +123,16 @@ $elements[] = ''; if ( $cleanup ) { - $cleanup = 'true'; + $cleanup = 'true'; } else { - $cleanup = 'false'; + $cleanup = 'false'; } + + if ( $cleanup_startup ) { + $cleanup_startup = 'true'; + } else { + $cleanup_startup = 'false'; + } if ( $newlines ) { $br_newlines = 'true'; @@ -178,11 +197,28 @@ $plugins[] = 'fullscreen'; $buttons3[] = 'fullscreen'; } - - $buttons2 = implode( ',', $buttons2 ); - $buttons3 = implode( ',', $buttons3 ); - $plugins = implode( ',', $plugins ); - $elements = implode( ',', $elements ); + // autosave + if ( $autosave ) { + $plugins[] = 'autosave'; + } + // layer + if ( $layer ) { + $plugins[] = 'layer'; + $buttons2[] = 'insertlayer'; + $buttons2[] = 'moveforward'; + $buttons2[] = 'movebackward'; + $buttons2[] = 'absolute'; + } + // style + if ( $style ) { + $plugins[] = 'style'; + $buttons3[] = 'styleprops'; + } + + $buttons2 = implode( ', ', $buttons2 ); + $buttons3 = implode( ', ', $buttons3 ); + $plugins = implode( ', ', $plugins ); + $elements = implode( ', ', $elements ); return <<'; + $buttons[] = ''.$result[1].''; } } $buttons = implode( "", $buttons ); diff -urN joomla-1.0.7/mambots/editors/tinymce.xml joomla-1.0.10/mambots/editors/tinymce.xml --- joomla-1.0.7/mambots/editors/tinymce.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/editors/tinymce.xml 2006-06-25 16:54:36.000000000 -0400 @@ -15,7 +15,15 @@ - + + + + + + + + + @@ -28,6 +36,10 @@ + + + + @@ -60,6 +72,14 @@ + + + + + + + + @@ -67,7 +87,7 @@ - + diff -urN joomla-1.0.7/mambots/search/categories.searchbot.php joomla-1.0.10/mambots/search/categories.searchbot.php --- joomla-1.0.7/mambots/search/categories.searchbot.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/search/categories.searchbot.php 2006-06-25 16:54:19.000000000 -0400 @@ -1,6 +1,6 @@ _search_mambot_params['categories']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'categories.searchbot'" + . "\n AND folder = 'search'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_search_mambot_params['categories'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_search_mambot_params['categories']; - // load mambot params info - $query = "SELECT id" - . "\n FROM #__mambots" - . "\n WHERE element = 'categories.searchbot'" - . "\n AND folder = 'search'" - ; - $database->setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); $botParams = new mosParameters( $mambot->params ); $limit = $botParams->def( 'search_limit', 50 ); @@ -75,7 +83,9 @@ . "\n OR a.title LIKE '%$text%'" . "\n OR a.description LIKE '%$text%' )" . "\n AND a.published = 1" + . "\n AND s.published = 1" . "\n AND a.access <= $my->gid" + . "\n AND s.access <= $my->gid" . "\n AND ( m.type = 'content_section' OR m.type = 'content_blog_section'" . "\n OR m.type = 'content_category' OR m.type = 'content_blog_category')" . "\n GROUP BY a.id" diff -urN joomla-1.0.7/mambots/search/contacts.searchbot.php joomla-1.0.10/mambots/search/contacts.searchbot.php --- joomla-1.0.7/mambots/search/contacts.searchbot.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/search/contacts.searchbot.php 2006-06-25 16:54:19.000000000 -0400 @@ -1,6 +1,6 @@ _search_mambot_params['contacts']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'contacts.searchbot'" + . "\n AND folder = 'search'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_search_mambot_params['contacts'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_search_mambot_params['contacts']; - // load mambot params info - $query = "SELECT id" - . "\n FROM #__mambots" - . "\n WHERE element = 'contacts.searchbot'" - . "\n AND folder = 'search'" - ; - $database->setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); $botParams = new mosParameters( $mambot->params ); $limit = $botParams->def( 'search_limit', 50 ); @@ -71,9 +79,9 @@ . "\n '' AS created," . "\n CONCAT_WS( ' / ', '$section', b.title ) AS section," . "\n '2' AS browsernav," - . "\n CONCAT( 'index.php?option=com_contact&task=view&&contact_id=', a.id ) AS href" + . "\n CONCAT( 'index.php?option=com_contact&task=view&contact_id=', a.id ) AS href" . "\n FROM #__contact_details AS a" - . "\n INNER JOIN #__categories AS b ON b.id = a.catid AND b.access <= '$my->gid'" + . "\n INNER JOIN #__categories AS b ON b.id = a.catid" . "\n WHERE ( a.name LIKE '%$text%'" . "\n OR a.misc LIKE '%$text%'" . "\n OR a.con_position LIKE '%$text%'" @@ -85,6 +93,9 @@ . "\n OR a.telephone LIKE '%$text%'" . "\n OR a.fax LIKE '%$text%' )" . "\n AND a.published = 1" + . "\n AND b.published = 1" + . "\n AND a.access <= $my->gid" + . "\n AND b.access <= $my->gid" . "\n GROUP BY a.id" . "\n ORDER BY $order" ; diff -urN joomla-1.0.7/mambots/search/content.searchbot.php joomla-1.0.10/mambots/search/content.searchbot.php --- joomla-1.0.7/mambots/search/content.searchbot.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/search/content.searchbot.php 2006-06-25 16:54:19.000000000 -0400 @@ -1,6 +1,6 @@ setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); + global $database, $my, $_MAMBOTS; + + // check if param query has previously been processed + if ( !isset($_MAMBOTS->_search_mambot_params['content']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'content.searchbot'" + . "\n AND folder = 'search'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_search_mambot_params['content'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_search_mambot_params['content']; + $botParams = new mosParameters( $mambot->params ); $limit = $botParams->def( 'search_limit', 50 ); + $nonmenu = $botParams->def( 'nonmenu', 1 ); $nullDate = $database->getNullDate(); - $now = date( 'Y-m-d H:i:s', time()+$mosConfig_offset*60*60 ); + $now = _CURRENT_SERVER_TIME; $text = trim( $text ); if ($text == '') { @@ -112,17 +120,20 @@ . "\n CONCAT(a.introtext, a.fulltext) AS text," . "\n CONCAT_WS( '/', u.title, b.title ) AS section," . "\n CONCAT( 'index.php?option=com_content&task=view&id=', a.id ) AS href," - . "\n '2' AS browsernav" + . "\n '2' AS browsernav," + . "\n 'content' AS type" . "\n FROM #__content AS a" - . "\n INNER JOIN #__categories AS b ON b.id=a.catid AND b.access <= '$my->gid'" - . "\n LEFT JOIN #__sections AS u ON u.id = a.sectionid" + . "\n INNER JOIN #__categories AS b ON b.id=a.catid" + . "\n INNER JOIN #__sections AS u ON u.id = a.sectionid" . "\n WHERE ( $where )" - . "\n AND a.state = '1'" - . "\n AND a.access <= '$my->gid'" - . "\n AND u.published = '1'" - . "\n AND b.published = '1'" - . "\n AND ( publish_up = '$nullDate' OR publish_up <= '$now' )" - . "\n AND ( publish_down = '$nullDate' OR publish_down >= '$now' )" + . "\n AND a.state = 1" + . "\n AND u.published = 1" + . "\n AND b.published = 1" + . "\n AND a.access <= $my->gid" + . "\n AND b.access <= $my->gid" + . "\n AND u.access <= $my->gid" + . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" + . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" . "\n GROUP BY a.id" . "\n ORDER BY $order" ; @@ -130,18 +141,21 @@ $list = $database->loadObjectList(); // search static content - $query = "SELECT a.title AS title, a.created AS created," + $query = "SELECT a.title AS title," + . "\n a.created AS created," . "\n a.introtext AS text," + . "\n '". _STATIC_CONTENT ."' AS section," . "\n CONCAT( 'index.php?option=com_content&task=view&id=', a.id, '&Itemid=', m.id ) AS href," - . "\n '2' as browsernav, 'Menu' AS section" + . "\n '2' AS browsernav," + . "\n a.id" . "\n FROM #__content AS a" . "\n LEFT JOIN #__menu AS m ON m.componentid = a.id" . "\n WHERE ($where)" . "\n AND a.state = 1" . "\n AND a.access <= $my->gid" . "\n AND m.type = 'content_typed'" - . "\n AND ( publish_up = '0000-00-00 00:00:00' OR publish_up <= '$now' )" - . "\n AND ( publish_down = '0000-00-00 00:00:00' OR publish_down >= '$now' )" + . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" + . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" . "\n ORDER BY ". ($morder ? $morder : $order) ; $database->setQuery( $query, 0, $limit ); @@ -153,20 +167,60 @@ . "\n a.introtext AS text," . "\n CONCAT_WS( '/', '". _SEARCH_ARCHIVED ." ', u.title, b.title ) AS section," . "\n CONCAT('index.php?option=com_content&task=view&id=',a.id) AS href," - . "\n '2' AS browsernav" + . "\n '2' AS browsernav," + . "\n 'content' AS type" . "\n FROM #__content AS a" - . "\n INNER JOIN #__categories AS b ON b.id=a.catid AND b.access <='$my->gid'" - . "\n LEFT JOIN #__sections AS u ON u.id = a.sectionid" + . "\n INNER JOIN #__categories AS b ON b.id=a.catid" + . "\n INNER JOIN #__sections AS u ON u.id = a.sectionid" . "\n WHERE ( $where )" . "\n AND a.state = -1" + . "\n AND u.published = 1" + . "\n AND b.published = 1" . "\n AND a.access <= $my->gid" - . "\n AND ( publish_up = '0000-00-00 00:00:00' OR publish_up <= '$now' )" - . "\n AND ( publish_down = '0000-00-00 00:00:00' OR publish_down >= '$now' )" + . "\n AND b.access <= $my->gid" + . "\n AND u.access <= $my->gid" + . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" + . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" . "\n ORDER BY $order" ; $database->setQuery( $query, 0, $limit ); $list3 = $database->loadObjectList(); - return array_merge( $list, $list2, $list3 ); + // check if search of nonmenu linked static content is allowed + if ($nonmenu) { + // collect ids of static content items linked to menu items + // so they can be removed from query that follows + $ids = null; + if(count($list2)) { + foreach($list2 as $static) { + $ids[] = $static->id; + } + $ids = implode( '\',\'', $ids ); + } + + // search static content not connected to a menu + $query = "SELECT a.title AS title," + . "\n a.created AS created," + . "\n a.introtext AS text," + . "\n '2' as browsernav, '". _STATIC_CONTENT ."' AS section," + . "\n CONCAT( 'index.php?option=com_content&task=view&id=', a.id ) AS href," + . "\n a.id" + . "\n FROM #__content AS a" + . "\n WHERE ($where)" + . "\n AND a.id NOT IN ( '$ids' )" + . "\n AND a.state = 1" + . "\n AND a.access <= $my->gid" + . "\n AND a.sectionid = 0" + . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" + . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" + . "\n ORDER BY $order" + ; + $database->setQuery( $query, 0, $limit ); + $list4 = $database->loadObjectList(); + } else { + $list4 = array(); + } + + return array_merge( $list, $list2, $list3, $list4 ); } ?> \ No newline at end of file diff -urN joomla-1.0.7/mambots/search/content.searchbot.xml joomla-1.0.10/mambots/search/content.searchbot.xml --- joomla-1.0.7/mambots/search/content.searchbot.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/search/content.searchbot.xml 2006-06-25 16:54:19.000000000 -0400 @@ -14,5 +14,9 @@ + + + + diff -urN joomla-1.0.7/mambots/search/newsfeeds.searchbot.php joomla-1.0.10/mambots/search/newsfeeds.searchbot.php --- joomla-1.0.7/mambots/search/newsfeeds.searchbot.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/search/newsfeeds.searchbot.php 2006-06-25 16:54:19.000000000 -0400 @@ -1,6 +1,6 @@ _search_mambot_params['newsfeeds']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'newsfeeds.searchbot'" + . "\n AND folder = 'search'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_search_mambot_params['newsfeeds'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_search_mambot_params['newsfeeds']; - // load mambot params info - $query = "SELECT id" - . "\n FROM #__mambots" - . "\n WHERE element = 'newsfeeds.searchbot'" - . "\n AND folder = 'search'" - ; - $database->setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); $botParams = new mosParameters( $mambot->params ); $limit = $botParams->def( 'search_limit', 50 ); @@ -95,9 +103,11 @@ . "\n CONCAT( 'index.php?option=com_newsfeeds&task=view&feedid=', a.id ) AS href," . "\n '1' AS browsernav" . "\n FROM #__newsfeeds AS a" - . "\n INNER JOIN #__categories AS b ON b.id = a.catid AND b.access <= '$my->gid'" + . "\n INNER JOIN #__categories AS b ON b.id = a.catid" . "\n WHERE ( $where )" . "\n AND a.published = 1" + . "\n AND b.published = 1" + . "\n AND b.access <= $my->gid" . "\n ORDER BY $order" ; $database->setQuery( $query, 0, $limit ); diff -urN joomla-1.0.7/mambots/search/sections.searchbot.php joomla-1.0.10/mambots/search/sections.searchbot.php --- joomla-1.0.7/mambots/search/sections.searchbot.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/search/sections.searchbot.php 2006-06-25 16:54:19.000000000 -0400 @@ -1,6 +1,6 @@ _search_mambot_params['sections']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'sections.searchbot'" + . "\n AND folder = 'search'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_search_mambot_params['sections'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_search_mambot_params['sections']; - // load mambot params info - $query = "SELECT id" - . "\n FROM #__mambots" - . "\n WHERE element = 'sections.searchbot'" - . "\n AND folder = 'search'" - ; - $database->setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); $botParams = new mosParameters( $mambot->params ); $limit = $botParams->def( 'search_limit', 50 ); diff -urN joomla-1.0.7/mambots/search/weblinks.searchbot.php joomla-1.0.10/mambots/search/weblinks.searchbot.php --- joomla-1.0.7/mambots/search/weblinks.searchbot.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/mambots/search/weblinks.searchbot.php 2006-06-25 16:54:19.000000000 -0400 @@ -1,6 +1,6 @@ _search_mambot_params['weblinks']) ) { + // load mambot params info + $query = "SELECT params" + . "\n FROM #__mambots" + . "\n WHERE element = 'weblinks.searchbot'" + . "\n AND folder = 'search'" + ; + $database->setQuery( $query ); + $database->loadObject($mambot); + + // save query to class variable + $_MAMBOTS->_search_mambot_params['weblinks'] = $mambot; + } + + // pull query data from class variable + $mambot = $_MAMBOTS->_search_mambot_params['weblinks']; - // load mambot params info - $query = "SELECT id" - . "\n FROM #__mambots" - . "\n WHERE element = 'weblinks.searchbot'" - . "\n AND folder = 'search'" - ; - $database->setQuery( $query ); - $id = $database->loadResult(); - $mambot = new mosMambot( $database ); - $mambot->load( $id ); $botParams = new mosParameters( $mambot->params ); $limit = $botParams->def( 'search_limit', 50 ); @@ -104,9 +112,11 @@ . "\n '1' AS browsernav," . "\n a.url AS href" . "\n FROM #__weblinks AS a" - . "\n INNER JOIN #__categories AS b ON b.id = a.catid AND b.access <= '$my->gid'" + . "\n INNER JOIN #__categories AS b ON b.id = a.catid" . "\n WHERE ($where)" . "\n AND a.published = 1" + . "\n AND b.published = 1" + . "\n AND b.access <= $my->gid" . "\n ORDER BY $order" ; $database->setQuery( $query, 0, $limit ); diff -urN joomla-1.0.7/modules/custom.xml joomla-1.0.10/modules/custom.xml --- joomla-1.0.7/modules/custom.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/custom.xml 2006-06-25 16:54:37.000000000 -0400 @@ -11,6 +11,11 @@ Custom Module + + + + + @@ -30,9 +35,6 @@ - - - - + diff -urN joomla-1.0.7/modules/mod_archive.php joomla-1.0.10/modules/mod_archive.php --- joomla-1.0.7/modules/mod_archive.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_archive.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ def( 'count', 10 ) ); -$now = date( 'Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60 ); +$now = _CURRENT_SERVER_TIME; $query = "SELECT MONTH( created ) AS created_month, created, id, sectionid, title, YEAR(created) AS created_year" . "\n FROM #__content" diff -urN joomla-1.0.7/modules/mod_banners.php joomla-1.0.10/modules/mod_banners.php --- joomla-1.0.7/modules/mod_banners.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_banners.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ setQuery( $query ); -$numrows = $database->loadResult(); -if ($numrows === null) { - echo $database->stderr( true ); - return; -} +$banners = $database->loadObjectList(); +$numrows = count( $banners ); $bannum = 0; if ($numrows > 1) { @@ -43,61 +41,53 @@ } if ($numrows){ - $query = "SELECT *" - . "\n FROM #__banner WHERE showBanner=1 " - . $where - . "\n LIMIT $bannum, 1"; - $database->setQuery( $query ); - if ($database->loadObject( $banner )) { - - $query = "UPDATE #__banner" - . "\n SET impmade = impmade + 1" - . "\n WHERE bid = $banner->bid" - ; - $database->setQuery( $query ); - if(!$database->query()) { - echo $database->stderr( true ); - return; - } - $banner->impmade++; - - if ($numrows > 0) { - // Check if this impression is the last one and print the banner - if ($banner->imptotal == $banner->impmade) { - - $query = "INSERT INTO #__bannerfinish ( cid, type, name, impressions, clicks, imageurl, datestart, dateend )" - . "\n VALUES ( $banner->cid, '$banner->type', '$banner->name', $banner->impmade, $banner->clicks, '$banner->imageurl', '$banner->date', 'now()' )" - ; - $database->setQuery($query); - if(!$database->query()) { - die($database->stderr(true)); - } - - $query = "DELETE FROM #__banner" - . "\n WHERE bid = $banner->bid" - ; - $database->setQuery($query); - if(!$database->query()) { - die($database->stderr(true)); - } - } - - if (trim( $banner->custombannercode )) { - echo $banner->custombannercode; - } else if (eregi( "(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$", $banner->imageurl )) { - $imageurl = $mosConfig_live_site .'/images/banners/'. $banner->imageurl; - $link = sefRelToAbs( 'index.php?option=com_banners&task=click&bid='. $banner->bid ); - echo 'Advertisement'; - - } else if (eregi("\.swf$", $banner->imageurl)) { - $imageurl = "$mosConfig_live_site/images/banners/".$banner->imageurl; - echo " - "; - } - } - } else { - echo " "; - } + $banner = $banners[$bannum]; + + $query = "UPDATE #__banner" + . "\n SET impmade = impmade + 1" + . "\n WHERE bid = $banner->bid" + ; + $database->setQuery( $query ); + if(!$database->query()) { + echo $database->stderr( true ); + return; + } + $banner->impmade++; + + if ($numrows > 0) { + // Check if this impression is the last one and print the banner + if ($banner->imptotal == $banner->impmade) { + + $query = "INSERT INTO #__bannerfinish ( cid, type, name, impressions, clicks, imageurl, datestart, dateend )" + . "\n VALUES ( $banner->cid, '$banner->type', '$banner->name', $banner->impmade, $banner->clicks, '$banner->imageurl', '$banner->date', 'now()' )" + ; + $database->setQuery($query); + if(!$database->query()) { + die($database->stderr(true)); + } + + $query = "DELETE FROM #__banner" + . "\n WHERE bid = $banner->bid" + ; + $database->setQuery($query); + if(!$database->query()) { + die($database->stderr(true)); + } + } + + if (trim( $banner->custombannercode )) { + echo $banner->custombannercode; + } else if (eregi( "(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$", $banner->imageurl )) { + $imageurl = $mosConfig_live_site .'/images/banners/'. $banner->imageurl; + $link = sefRelToAbs( 'index.php?option=com_banners&task=click&bid='. $banner->bid ); + echo 'Advertisement'; + + } else if (eregi("\.swf$", $banner->imageurl)) { + $imageurl = "$mosConfig_live_site/images/banners/".$banner->imageurl; + echo " + "; + } + } } else { echo " "; } diff -urN joomla-1.0.7/modules/mod_banners.xml joomla-1.0.10/modules/mod_banners.xml --- joomla-1.0.7/modules/mod_banners.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_banners.xml 2006-06-25 16:54:37.000000000 -0400 @@ -14,6 +14,6 @@ - + diff -urN joomla-1.0.7/modules/mod_latestnews.php joomla-1.0.10/modules/mod_latestnews.php --- joomla-1.0.7/modules/mod_latestnews.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_latestnews.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ get( 'catid' ) ); $secid = trim( $params->get( 'secid' ) ); $show_front = $params->get( 'show_front', 1 ); -$now = date( 'Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60 ); + +$now = _CURRENT_SERVER_TIME; $access = !$mainframe->getCfg( 'shownoauth' ); +$nullDate = $database->getNullDate(); -$nullDate = $database->getNullDate(); // select between Content Items, Static Content or both switch ( $type ) { case 2: @@ -38,27 +39,39 @@ . "\n ORDER BY a.created DESC" . "\n LIMIT $count" ; + $database->setQuery( $query ); + $rows = $database->loadObjectList(); break; case 3: //Both - $query = "SELECT a.id, a.title, a.sectionid, a.catid" + $query = "SELECT a.id, a.title, a.sectionid, a.catid, cc.access AS cat_access, s.access AS sec_access, cc.published AS cat_state, s.published AS sec_state" . "\n FROM #__content AS a" . "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id" - . "\n INNER JOIN #__categories AS cc ON cc.id = a.catid" - . "\n INNER JOIN #__sections AS s ON s.id = a.sectionid" + . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" + . "\n LEFT JOIN #__sections AS s ON s.id = a.sectionid" . "\n WHERE a.state = 1" . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" - . ( $access ? "\n AND a.access <= '$my->gid'" : '' ) + . ( $access ? "\n AND a.access <= $my->gid" : '' ) . ( $catid ? "\n AND ( a.catid IN ( $catid ) )" : '' ) . ( $secid ? "\n AND ( a.sectionid IN ( $secid ) )" : '' ) . ( $show_front == '0' ? "\n AND f.content_id IS NULL" : '' ) - . "\n AND s.published = 1" - . "\n AND cc.published = 1" . "\n ORDER BY a.created DESC" . "\n LIMIT $count" ; + $database->setQuery( $query ); + $temp = $database->loadObjectList(); + + $rows = array(); + if (count($temp)) { + foreach ($temp as $row ) { + if (($row->cat_state == 1 || $row->cat_state == '') && ($row->sec_state == 1 || $row->sec_state == '') && ($row->cat_access <= $my->gid || $row->cat_access == '' || !$access) && ($row->sec_access <= $my->gid || $row->sec_access == '' || !$access)) { + $rows[] = $row; + } + } + } + unset($temp); break; case 1: @@ -72,7 +85,7 @@ . "\n WHERE ( a.state = 1 AND a.sectionid > 0 )" . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" - . ( $access ? "\n AND a.access <= '$my->gid'" : '' ) + . ( $access ? "\n AND a.access <= $my->gid AND cc.access <= $my->gid AND s.access <= $my->gid" : '' ) . ( $catid ? "\n AND ( a.catid IN ( $catid ) )" : '' ) . ( $secid ? "\n AND ( a.sectionid IN ( $secid ) )" : '' ) . ( $show_front == '0' ? "\n AND f.content_id IS NULL" : '' ) @@ -81,11 +94,11 @@ . "\n ORDER BY a.created DESC" . "\n LIMIT $count" ; + $database->setQuery( $query ); + $rows = $database->loadObjectList(); break; } -$database->setQuery( $query ); -$rows = $database->loadObjectList(); // needed to reduce queries used by getItemid for Content Items if ( ( $type == 1 ) || ( $type == 3 ) ) { diff -urN joomla-1.0.7/modules/mod_login.php joomla-1.0.10/modules/mod_login.php --- joomla-1.0.7/modules/mod_login.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_login.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ getCfg( 'allowUserRegistration' ); -$message_login = $params->def( 'login_message', 0 ); -$message_logout = $params->def( 'logout_message', 0 ); +$message_login = $params->def( 'login_message', 0 ); +$message_logout = $params->def( 'logout_message', 0 ); +$login = $params->def( 'login', $return ); +$logout = $params->def( 'logout', $return ); +$name = $params->def( 'name', 1 ); +$greeting = $params->def( 'greeting', 1 ); $pretext = $params->get( 'pretext' ); $posttext = $params->get( 'posttext' ); -$login = $params->def( 'login', $return ); -$logout = $params->def( 'logout', $return ); -$name = $params->def( 'name', 1 ); -$greeting = $params->def( 'greeting', 1 ); - -if ( $name ) { - $query = "SELECT name" - . "\n FROM #__users" - . "\n WHERE id = $my->id" - ; - $database->setQuery( $query ); - $name = $database->loadResult(); -} else { - $name = $my->username; -} if ( $my->id ) { // Logout output // ie HTML when already logged in and trying to logout + if ( $name ) { + $name = $my->name; + } else { + $name = $my->username; + } ?> - +
      +
      + @@ -64,11 +87,14 @@ } else { // Login output // ie HTML when not logged in and trying to login + // used for spoof hardening + $validate = josSpoofValue(1); ?> + + + type) { case 'separator': case 'component_item_link': - break; - case 'content_item_link': - $temp = split("&task=view&id=", $mitem->link); - $mitem->link .= '&Itemid='. $mainframe->getItemid($temp[1]); - break; + break; + case 'url': - if ( eregi( 'index.php\?', $mitem->link ) ) { - if ( !eregi( 'Itemid=', $mitem->link ) ) { - $mitem->link .= '&Itemid='. $mitem->id; + if ( eregi( 'index.php\?', $mitem->link ) ) { + if ( !eregi( 'Itemid=', $mitem->link ) ) { + $mitem->link .= '&Itemid='. $mitem->id; + } } - } - break; + break; + + case 'content_item_link': case 'content_typed': + // load menu params + $menuparams = new mosParameters( $mitem->params, $mainframe->getPath( 'menu_xml', $mitem->type ), 'menu' ); + + $unique_itemid = $menuparams->get( 'unique_itemid', 1 ); + + if ( $unique_itemid ) { + $mitem->link .= '&Itemid='. $mitem->id; + } else { + $temp = split('&task=view&id=', $mitem->link); + + if ( $mitem->type == 'content_typed' ) { + $mitem->link .= '&Itemid='. $mainframe->getItemid($temp[1], 1, 0); + } else { + $mitem->link .= '&Itemid='. $mainframe->getItemid($temp[1], 0, 1); + } + } + break; + default: - $mitem->link .= '&Itemid='. $mitem->id; - break; + $mitem->link .= '&Itemid='. $mitem->id; + break; } // Active Menu highlighting @@ -58,44 +76,68 @@ $id = ''; } + if ( $params->get( 'full_active_id' ) ) { + // support for `active_menu` of 'Link - Component Item' + if ( $id == '' && $mitem->type == 'component_item_link' ) { + parse_str( $mitem->link, $url ); + if ( $url['Itemid'] == $current_itemid ) { + $id = 'id="active_menu'. $params->get( 'class_sfx' ) .'"'; + } + } + + // support for `active_menu` of 'Link - Url' if link is relative + if ( $id == '' && $mitem->type == 'url' && strpos( 'http', $mitem->link ) === false) { + parse_str( $mitem->link, $url ); + if ( isset( $url['Itemid'] ) ) { + if ( $url['Itemid'] == $current_itemid ) { + $id = 'id="active_menu'. $params->get( 'class_sfx' ) .'"'; + } + } + } + } + + // replace & with amp; for xhtml compliance $mitem->link = ampReplace( $mitem->link ); - if ( strcasecmp( substr( $mitem->link,0,4 ), 'http' ) ) { - $mitem->link = sefRelToAbs( $mitem->link ); - } + // run through SEF convertor + $mitem->link = sefRelToAbs( $mitem->link ); $menuclass = 'mainlevel'. $params->get( 'class_sfx' ); if ($level > 0) { $menuclass = 'sublevel'. $params->get( 'class_sfx'); } + + // replace & with amp; for xhtml compliance + // remove slashes from excaped characters + $mitem->name = stripslashes( ampReplace($mitem->name) ); switch ($mitem->browserNav) { // cases are slightly different case 1: - // open in a new window - $txt = ''. $mitem->name .''; - break; + // open in a new window + $txt = ''. $mitem->name .''; + break; case 2: - // open in a popup window - $txt = "link ."', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"$menuclass\" ". $id .">". $mitem->name ."\n"; - break; + // open in a popup window + $txt = "link ."', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false\" class=\"$menuclass\" ". $id .">". $mitem->name ."\n"; + break; case 3: - // don't link it - $txt = ''. $mitem->name .''; - break; - - default: // formerly case 2 - // open in parent window - $txt = ''. $mitem->name .''; - break; + // don't link it + $txt = ''. $mitem->name .''; + break; + + default: + // open in parent window + $txt = ''. $mitem->name .''; + break; } if ( $params->get( 'menu_images' ) ) { - $menu_params = new stdClass(); - $menu_params = new mosParameters( $mitem->params ); - $menu_image = $menu_params->def( 'menu_image', -1 ); + $menu_params = new stdClass(); + $menu_params = new mosParameters( $mitem->params ); + $menu_image = $menu_params->def( 'menu_image', -1 ); if ( ( $menu_image != '-1' ) && $menu_image ) { $image = ''. $mitem->name .''; if ( $params->get( 'menu_images_align' ) ) { @@ -153,83 +195,83 @@ $intUserType = 0; } - if ($mosConfig_shownoauth) { - $sql = "SELECT m.*" - . "\n FROM #__menu AS m" - . "\n WHERE menutype = '". $params->get( 'menutype' ) ."'" - . "\n AND published = 1" - . "\n ORDER BY parent, ordering"; - } else { - $sql = "SELECT m.*" - . "\n FROM #__menu AS m" - . "\n WHERE menutype = '". $params->get( 'menutype' ) ."'" - . "\n AND published = 1" - . "\n AND access <= $my->gid" - . "\n ORDER BY parent, ordering"; - } + $and = ''; + if ( !$mosConfig_shownoauth ) { + $and = "\n AND access <= $my->gid"; + } + $sql = "SELECT m.*" + . "\n FROM #__menu AS m" + . "\n WHERE menutype = '". $params->get( 'menutype' ) ."'" + . "\n AND published = 1" + . $and + . "\n ORDER BY parent, ordering"; $database->setQuery( $sql ); $rows = $database->loadObjectList( 'id' ); // indent icons switch ( $params->get( 'indent_image' ) ) { case '1': - // Default images - $imgpath = $mosConfig_live_site .'/images/M_images'; - for ( $i = 1; $i < 7; $i++ ) { - $img[$i] = ''; - } - break; + // Default images + $imgpath = $mosConfig_live_site .'/images/M_images'; + for ( $i = 1; $i < 7; $i++ ) { + $img[$i] = ''; + } + break; + case '2': - // Use Params - $imgpath = $mosConfig_live_site .'/images/M_images'; - for ( $i = 1; $i < 7; $i++ ) { - if ( $params->get( 'indent_image'. $i ) == '-1' ) { - $img[$i] = NULL; - } else { - $img[$i] = ''; + // Use Params + $imgpath = $mosConfig_live_site .'/images/M_images'; + for ( $i = 1; $i < 7; $i++ ) { + if ( $params->get( 'indent_image'. $i ) == '-1' ) { + $img[$i] = NULL; + } else { + $img[$i] = ''; + } } - } - break; + break; + case '3': - // None - for ( $i = 1; $i < 7; $i++ ) { - $img[$i] = NULL; - } - break; + // None + for ( $i = 1; $i < 7; $i++ ) { + $img[$i] = NULL; + } + break; + default: - // Template - $imgpath = $mosConfig_live_site .'/templates/'. $cur_template .'/images'; - for ( $i = 1; $i < 7; $i++ ) { - $img[$i] = ''; - } - break; + // Template + $imgpath = $mosConfig_live_site .'/templates/'. $cur_template .'/images'; + for ( $i = 1; $i < 7; $i++ ) { + $img[$i] = ''; + } + break; } $indents = array( - // block prefix / item prefix / item suffix / block suffix - array( '
      @@ -89,14 +115,13 @@
      -
      - - + +
      ', '', '
      ' , '
      ' ), - array( '', '
      '. $img[1] , '
      ', '' ), - array( '', '
      '. $img[2] , '
      ', '' ), - array( '', '
      '. $img[3] , '
      ', '' ), - array( '', '
      '. $img[4] , '
      ', '' ), - array( '', '
      '. $img[5] , '
      ', '' ), - array( '', '
      '. $img[6] , '
      ', '' ), + // block prefix / item prefix / item suffix / block suffix + array( '', '', '
      ' , '
      ' ), + array( '', '
      '. $img[1] , '
      ', '' ), + array( '', '
      '. $img[2] , '
      ', '' ), + array( '', '
      '. $img[3] , '
      ', '' ), + array( '', '
      '. $img[4] , '
      ', '' ), + array( '', '
      '. $img[5] , '
      ', '' ), + array( '', '
      '. $img[6] , '
      ', '' ), ); // establish the hierarchy of the menu $children = array(); // first pass - collect children foreach ($rows as $v ) { - $pt = $v->parent; - $list = @$children[$pt] ? $children[$pt] : array(); + $pt = $v->parent; + $list = @$children[$pt] ? $children[$pt] : array(); array_push( $list, $v ); $children[$pt] = $list; } // second pass - collect 'open' menus - $open = array( $Itemid ); - $count = 20; // maximum levels - to prevent runaway loop - $id = $Itemid; + $open = array( $Itemid ); + $count = 20; // maximum levels - to prevent runaway loop + $id = $Itemid; + while (--$count) { if (isset($rows[$id]) && $rows[$id]->parent > 0) { $id = $rows[$id]->parent; @@ -247,7 +289,6 @@ * hierarchial menu */ function mosRecurseVIMenu( $id, $level, &$children, &$open, &$indents, &$params ) { - global $Itemid; if (@$children[$id]) { $n = min( $level, count( $indents )-1 ); @@ -303,53 +344,71 @@ if (count( $links )) { switch ($style) { case 1: - echo '
        '; - foreach ($links as $link) { - echo '
      • ' . $link . '
      • '; - } - echo '
      '; - break; + echo '
        '; + foreach ($links as $link) { + echo '
      • ' . $link . '
      • '; + } + echo '
      '; + break; + default: - echo ''; - echo ''; - echo ''; - echo '
      '; - echo ' '. $params->get( 'end_spacer' ) .' '; - echo implode( ' '. $params->get( 'spacer' ) .' ', $links ); - echo ' '. $params->get( 'end_spacer' ) .' '; - echo '
      '; - break; + $spacer_start = $params->get( 'spacer' ); + $spacer_end = $params->get( 'end_spacer' ); + + echo ''; + echo ''; + echo ''; + echo ''; + echo '
      '; + + if ( $spacer_end ) { + echo ' '. $spacer_end .' '; + } + + if ( $spacer_start ) { + $html = ' '. $spacer_start .' '; + echo implode( $html, $links ); + } else { + echo implode( '', $links ); + } + + if ( $spacer_end ) { + echo ' '. $spacer_end .' '; + } + + echo '
      '; + break; } } } } -$params->def( 'menutype', 'mainmenu' ); -$params->def( 'class_sfx', '' ); -$params->def( 'menu_images', 0 ); -$params->def( 'menu_images_align', 0 ); -$params->def( 'expand_menu', 0 ); -$params->def( 'activate_parent', 0 ); -$params->def( 'indent_image', 0 ); -$params->def( 'indent_image1', 'indent1.png' ); -$params->def( 'indent_image2', 'indent2.png' ); -$params->def( 'indent_image3', 'indent3.png' ); -$params->def( 'indent_image4', 'indent4.png' ); -$params->def( 'indent_image5', 'indent5.png' ); -$params->def( 'indent_image6', 'indent.png' ); -$params->def( 'spacer', '' ); -$params->def( 'end_spacer', '' ); -$menu_style = $params->get( 'menu_style', 'vert_indent' ); +$params->def('menutype', 'mainmenu'); +$params->def('class_sfx', ''); +$params->def('menu_images', 0); +$params->def('menu_images_align', 0); +$params->def('expand_menu', 0); +$params->def('activate_parent', 0); +$params->def('indent_image', 0); +$params->def('indent_image1', 'indent1.png'); +$params->def('indent_image2', 'indent2.png'); +$params->def('indent_image3', 'indent3.png'); +$params->def('indent_image4', 'indent4.png'); +$params->def('indent_image5', 'indent5.png'); +$params->def('indent_image6', 'indent.png'); +$params->def('spacer', ''); +$params->def('end_spacer', ''); +$params->def('full_active_id', 0); -switch ( $menu_style ) { +switch ( $params->get( 'menu_style', 'vert_indent' ) ) { case 'list_flat': mosShowHFMenu( $params, 1 ); break; - + case 'horiz_flat': mosShowHFMenu( $params, 0 ); break; - + default: mosShowVIMenu( $params ); break; diff -urN joomla-1.0.7/modules/mod_mainmenu.xml joomla-1.0.10/modules/mod_mainmenu.xml --- joomla-1.0.7/modules/mod_mainmenu.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_mainmenu.xml 2006-06-25 16:54:37.000000000 -0400 @@ -22,6 +22,12 @@ + + + + + + diff -urN joomla-1.0.7/modules/mod_mostread.php joomla-1.0.10/modules/mod_mostread.php --- joomla-1.0.7/modules/mod_mostread.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_mostread.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ get( 'catid' ) ); $secid = trim( $params->get( 'secid' ) ); $show_front = $params->get( 'show_front', 1 ); -$now = date( 'Y-m-d H:i:s', time()+$mosConfig_offset*60*60 ); -$access = !$mainframe->getCfg( 'shownoauth' ); -$nullDate = $database->getNullDate(); +$now = _CURRENT_SERVER_TIME; +$access = !$mainframe->getCfg( 'shownoauth' ); +$nullDate = $database->getNullDate(); // select between Content Items, Static Content or both switch ( $type ) { case 2: @@ -44,8 +44,10 @@ case 3: //Both - $query = "SELECT a.id, a.title, a.sectionid" + $query = "SELECT a.id, a.title, a.sectionid, a.catid, cc.access AS cat_access, s.access AS sec_access, cc.published AS cat_state, s.published AS sec_state" . "\n FROM #__content AS a" + . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" + . "\n LEFT JOIN #__sections AS s ON s.id = a.sectionid" . "\n WHERE a.state = 1" . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" @@ -54,7 +56,17 @@ . "\n LIMIT $count" ; $database->setQuery( $query ); - $rows = $database->loadObjectList(); + $temp = $database->loadObjectList(); + + $rows = array(); + if (count($temp)) { + foreach ($temp as $row ) { + if (($row->cat_state == 1 || $row->cat_state == '') && ($row->sec_state == 1 || $row->sec_state == '') && ($row->cat_access <= $my->gid || $row->cat_access == '' || !$access) && ($row->sec_access <= $my->gid || $row->sec_access == '' || !$access)) { + $rows[] = $row; + } + } + } + unset($temp); break; case 1: @@ -68,7 +80,7 @@ . "\n WHERE ( a.state = 1 AND a.sectionid > 0 )" . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" - . ( $access ? "\n AND a.access <= $my->gid" : '' ) + . ( $access ? "\n AND a.access <= $my->gid AND cc.access <= $my->gid AND s.access <= $my->gid" : '' ) . ( $catid ? "\n AND ( a.catid IN ( $catid ) )" : '' ) . ( $secid ? "\n AND ( a.sectionid IN ( $secid ) )" : '' ) . ( $show_front == "0" ? "\n AND f.content_id IS NULL" : '' ) diff -urN joomla-1.0.7/modules/mod_newsflash.php joomla-1.0.10/modules/mod_newsflash.php --- joomla-1.0.7/modules/mod_newsflash.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_newsflash.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ text = $row->introtext; $row->groups = ''; - $row->readmore = (trim( $row->fulltext ) != ''); - - $bs = $mainframe->getBlogSectionCount(); - $bc = $mainframe->getBlogCategoryCount(); - $gbs = $mainframe->getGlobalBlogSectionCount(); - $ItemidCount = $mainframe->getItemid( $row->id, 0, 0, $bs, $bc, $gbs ); - - HTML_content::show( $row, $params, $access, 0, 'com_content', $ItemidCount ); + $row->readmore = (trim( $row->fulltext ) != ''); + $row->metadesc = ''; + $row->metakey = ''; + $row->access = ''; + $row->created = ''; + $row->modified = ''; + + HTML_content::show( $row, $params, $access, 0 ); } } @@ -44,82 +44,69 @@ $access->canEditOwn = 0; $access->canPublish = 0; -$now = date( 'Y-m-d H:i:s', time()+$mosConfig_offset*60*60 ); +$now = _CURRENT_SERVER_TIME; +$noauth = !$mainframe->getCfg( 'shownoauth' ); +$nullDate = $database->getNullDate(); $catid = intval( $params->get( 'catid' ) ); -$style = $params->get( 'style' ); -$items = intval( $params->get( 'items' ) ); +$items = intval( $params->get( 'items', 0 ) ); +$style = $params->get( 'style', 'flash' ); $moduleclass_sfx = $params->get( 'moduleclass_sfx' ); $link_titles = $params->get( 'link_titles', $mosConfig_link_titles ); -$params->set( 'intro_only', 1 ); -$params->set( 'hide_author', 1 ); -$params->set( 'hide_createdate', 0 ); -$params->set( 'hide_modifydate', 1 ); -$params->set( 'link_titles', $link_titles ); - -if ( $items ) { - $limit = "LIMIT $items"; -} else { - $limit = ''; -} - -$noauth = !$mainframe->getCfg( 'shownoauth' ); -$nullDate = $database->getNullDate(); +$params->set( 'intro_only', 1 ); +$params->set( 'hide_author', 1 ); +$params->set( 'hide_createdate', 0 ); +$params->set( 'hide_modifydate', 1 ); +$params->set( 'link_titles', $link_titles ); // query to determine article count -$query = "SELECT a.id" +$query = "SELECT a.id, a.introtext, a.fulltext , a.images, a.attribs, a.title, a.state" ."\n FROM #__content AS a" -."\n INNER JOIN #__categories AS b ON b.id = a.catid" +."\n INNER JOIN #__categories AS cc ON cc.id = a.catid" +."\n INNER JOIN #__sections AS s ON s.id = a.sectionid" ."\n WHERE a.state = 1" -. ( $noauth ? "\n AND a.access <= $my->gid AND b.access <= $my->gid" : '' ) +. ( $noauth ? "\n AND a.access <= $my->gid AND cc.access <= $my->gid AND s.access <= $my->gid" : '' ) ."\n AND (a.publish_up = '$nullDate' OR a.publish_up <= '$now' ) " ."\n AND (a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" -."\n AND catid = $catid" +."\n AND a.catid = $catid" +."\n AND cc.published = 1" +."\n AND s.published = 1" ."\n ORDER BY a.ordering" -."\n $limit" ; -$database->setQuery( $query ); -$rows = $database->loadResultArray(); -$numrows = count( $rows ); +$database->setQuery( $query, 0, $items ); +$rows = $database->loadObjectList(); -$row = new mosContent( $database ); +$numrows = count( $rows ); -switch ($style) { - case 'horiz': - echo ''; - echo ''; - foreach ($rows as $id) { - $row->load( $id ); - - echo ''; - } - echo '
      '; - - output_newsflash( $row, $params, $access ); - - echo '
      '; - break; - - case 'vert': - foreach ($rows as $id) { - $row->load( $id ); +// check if any results returned +if ( $numrows ) { + switch ($style) { + case 'horiz': + echo ''; + echo ''; + foreach ($rows as $row) { + echo ''; + } + echo '
      '; + output_newsflash( $row, $params, $access ); + echo '
      '; + break; + + case 'vert': + foreach ($rows as $row) { + output_newsflash( $row, $params, $access ); + } + break; + + case 'flash': + default: + srand ((double) microtime() * 1000000); + $flashnum = rand( 0, $numrows-1 ); + $row = $rows[$flashnum]; output_newsflash( $row, $params, $access ); - } - break; - - case 'flash': - default: - if ($numrows > 0) { - srand ((double) microtime() * 1000000); - $flashnum = $rows[rand( 0, $numrows-1 )]; - } else { - $flashnum = 0; - } - $row->load( $flashnum ); - - output_newsflash( $row, $params, $access ); - break; + break; + } } ?> \ No newline at end of file diff -urN joomla-1.0.7/modules/mod_newsflash.xml joomla-1.0.10/modules/mod_newsflash.xml --- joomla-1.0.7/modules/mod_newsflash.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_newsflash.xml 2006-06-25 16:54:37.000000000 -0400 @@ -41,6 +41,6 @@ - + diff -urN joomla-1.0.7/modules/mod_poll.php joomla-1.0.10/modules/mod_poll.php --- joomla-1.0.7/modules/mod_poll.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_poll.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ setQuery( $query ); + $_Itemid = $database->loadResult(); + + if ($_Itemid) { + $_Itemid = '&Itemid='. $_Itemid; + } + + $z = 1; foreach ($polls as $poll) { if ($poll->id && $poll->title) { @@ -54,7 +69,9 @@ return; } - poll_vote_form_html( $poll, $options, $Itemid, $moduleclass_sfx ); + poll_vote_form_html( $poll, $options, $_Itemid, $params, $z ); + + $z++; } } } @@ -65,18 +82,48 @@ * @param int The current menu item * @param string CSS suffix */ - function poll_vote_form_html( &$poll, &$options, $Itemid, $moduleclass_sfx ) { - $tabclass_arr = array( 'sectiontableentry2', 'sectiontableentry1' ); - $tabcnt = 0; + function poll_vote_form_html( &$poll, &$options, $_Itemid, &$params, $z ) { + $tabclass_arr = array( 'sectiontableentry2', 'sectiontableentry1' ); + $tabcnt = 0; + $moduleclass_sfx = $params->get('moduleclass_sfx'); + + $cookiename = "voted$poll->id"; + $voted = mosGetParam( $_COOKIE, $cookiename, 'z' ); ?> -
      "> + + "> + - +
      - title; ?> + + title; ?>
      @@ -106,9 +153,9 @@ @@ -121,5 +168,5 @@ } } -show_poll_vote_form( $Itemid, $moduleclass_sfx ); +show_poll_vote_form( $Itemid, $params ); ?> \ No newline at end of file diff -urN joomla-1.0.7/modules/mod_random_image.php joomla-1.0.10/modules/mod_random_image.php --- joomla-1.0.7/modules/mod_random_image.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_random_image.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ get( 'link' ); $width = $params->get( 'width' ); $height = $params->get( 'height' ); -$abspath_folder = $mosConfig_absolute_path .'/'. $folder; $the_array = array(); $the_image = array(); +// if folder includes livesite info, remove +if ( strpos($folder, $mosConfig_live_site) === 0 ) { + $folder = str_replace( $mosConfig_live_site, '', $folder ); +} +// if folder includes absolute path, remove +if ( strpos($folder, $mosConfig_absolute_path) === 0 ) { + $folder= str_replace( $mosConfig_absolute_path, '', $folder ); +} +// if folder doesnt contain slash to start, add +if ( strpos($folder, '/') !== 0 ) { + $folder = '/'. $folder; +} +// construct absolute path to directory +$abspath_folder = $mosConfig_absolute_path . $folder; + +// check if directory exists if (is_dir($abspath_folder)) { if ($handle = opendir($abspath_folder)) { while (false !== ($file = readdir($handle))) { @@ -44,45 +59,42 @@ } if (!$the_image) { - echo 'No images'; + echo _NO_IMAGES; } else { - - $i = count($the_image); - $random = mt_rand(0, $i - 1); - $image_name = $the_image[$random]; - - $i = $abspath_folder . '/'. $image_name; - $size = getimagesize ($i); - - if ($width == '') { - $width = 100; - } - if ($height == '') { - $coeff = $size[0]/$size[1]; - $height = (int) ($width/$coeff); - } - - $image = $mosConfig_live_site .'/'. $folder .'/'. $image_name; - + $i = count($the_image); + $random = mt_rand(0, $i - 1); + $image_name = $the_image[$random]; + $abspath_image = $abspath_folder . '/'. $image_name; + $size = getimagesize ($abspath_image); + + if ($width == '') { + ($size[0] > 100 ? $width = 100 : $width = $size[0]); + } + if ($height == '') { + $coeff = $size[0]/$size[1]; + $height = (int) ($width/$coeff); + } + + $image = $mosConfig_live_site . $folder .'/'. $image_name; + ?> +
      + + + + <?php echo $image_name; ?>
      + +
      + +
      + -
      - - - - <?php echo $image_name; ?>
      - -
      - -
      - \ No newline at end of file diff -urN joomla-1.0.7/modules/mod_related_items.php joomla-1.0.10/modules/mod_related_items.php --- joomla-1.0.7/modules/mod_related_items.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_related_items.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ getNullDate(); if ($option == 'com_content' && $task == 'view' && $id) { // select the meta keywords from the item @@ -42,33 +43,48 @@ if (count( $likes )) { // select other items based on the metakey field 'like' the keys found - $query = "SELECT id, title" - . "\n FROM #__content" - . "\n WHERE id != $id" - . "\n AND state = 1" - . "\n AND access <= $my->gid" - . "\n AND ( metakey LIKE '%" . implode( "%' OR metakey LIKE '%", $likes ) ."%' )" - . "\n AND ( publish_up = '$nullDate' OR publish_up <= '$now' )" - . "\n AND ( publish_down = '$nullDate' OR publish_down >= '$now' )" + $query = "SELECT a.id, a.title, a.sectionid, a.catid, cc.access AS cat_access, s.access AS sec_access, cc.published AS cat_state, s.published AS sec_state" + . "\n FROM #__content AS a" + . "\n LEFT JOIN #__content_frontpage AS f ON f.content_id = a.id" + . "\n LEFT JOIN #__categories AS cc ON cc.id = a.catid" + . "\n LEFT JOIN #__sections AS s ON s.id = a.sectionid" + . "\n WHERE a.id != $id" + . "\n AND a.state = 1" + . "\n AND a.access <= $my->gid" + . "\n AND ( a.metakey LIKE '%" . implode( "%' OR a.metakey LIKE '%", $likes ) ."%' )" + . "\n AND ( a.publish_up = '$nullDate' OR a.publish_up <= '$now' )" + . "\n AND ( a.publish_down = '$nullDate' OR a.publish_down >= '$now' )" ; $database->setQuery( $query ); - if ( $related = $database->loadObjectList() ) { + $temp = $database->loadObjectList(); + + $related = array(); + if (count($temp)) { + foreach ($temp as $row ) { + if (($row->cat_state == 1 || $row->cat_state == '') && ($row->sec_state == 1 || $row->sec_state == '') && ($row->cat_access <= $my->gid || $row->cat_access == '') && ($row->sec_access <= $my->gid || $row->sec_access == '')) { + $related[] = $row; + } + } + } + unset($temp); + + if ( count( $related ) ) { ?>
        - getItemid($item->id); + getItemid($item->id); + } + $href = sefRelToAbs( "index.php?option=com_content&task=view&id=$item->id&Itemid=$Itemid" ); + ?> +
      • + + title; ?> +
      • + id&Itemid=$Itemid" ); ?> -
      • - - title; ?> -
      • -
      get( 'rss091', 1 ); $rss10 = $params->get( 'rss10', 1 ); $rss20 = $params->get( 'rss20', 1 ); -$atom = $params->get( 'atom', 1 ); +$atom03 = $params->get( 'atom', 1 ); $opml = $params->get( 'opml', 1 ); $rss091_image = $params->get( 'rss091_image', '' ); $rss10_image = $params->get( 'rss10_image', '' ); @@ -48,6 +48,40 @@ $t_path = $mosConfig_live_site .'/templates/'. $cur_template .'/images/'; $d_path = $mosConfig_live_site .'/images/M_images/'; +// needed to reduce query +if ( isset( $GLOBALS['syndicateParams'] ) ) { +// load value stored in GLOBALS + $syndicateParams = $GLOBALS['syndicateParams']; +} else { +// query to oull syndication component params + $query = "SELECT a.*" + . "\n FROM #__components AS a" + . "\n WHERE ( a.admin_menu_link = 'option=com_syndicate' OR a.admin_menu_link = 'option=com_syndicate&hidemainmenu=1' )" + . "\n AND a.option = 'com_syndicate'" + ; + $database->setQuery( $query ); + $database->loadObject( $row ); + + // get params definitions + $syndicateParams = new mosParameters( $row->params, $mainframe->getPath( 'com_xml', $row->option ), 'component' ); +} + +// check for disabling/enabling of selected feed types +if ( !$syndicateParams->get( 'rss091', 1 ) ) { + $rss091 = 0; +} +if ( !$syndicateParams->get( 'rss10', 1 ) ) { + $rss10 = 0; +} +if ( !$syndicateParams->get( 'rss20', 1 ) ) { + $rss20 = 0; +} +if ( !$syndicateParams->get( 'atom03', 1 ) ) { + $atom03 = 0; +} +if ( !$syndicateParams->get( 'opml', 1 ) ) { + $opml = 0; +} ?>
      get( 'button_text', _SEARCH_TITLE ); $width = intval( $params->get( 'width', 20 ) ); $text = $params->get( 'text', _SEARCH_BOX ); +$set_Itemid = intval( $params->get( 'set_itemid', 0 ) ); $output = ''; @@ -47,19 +48,29 @@ break; } -$query = "SELECT id" -. "\n FROM #__menu" -. "\n WHERE link = 'index.php?option=com_search'" -; -$database->setQuery( $query ); -$rows = $database->loadObjectList(); - -if ( count( $rows ) ) { - $_Itemid = $rows[0]->id; - $link = 'index.php?option=com_search&Itemid='. $_Itemid; +// set Itemid id for links +if ( $set_Itemid ) { + // use param setting + $_Itemid = $set_Itemid; + $link = 'index.php?option=com_search&Itemid='. $set_Itemid; } else { - $_Itemid = ''; - $link = 'index.php?option=com_search'; + $query = "SELECT id" + . "\n FROM #__menu" + . "\n WHERE link = 'index.php?option=com_search'" + . "\n AND published = 1" + ; + $database->setQuery( $query ); + $rows = $database->loadObjectList(); + + // try to auto detect search component Itemid + if ( count( $rows ) ) { + $_Itemid = $rows[0]->id; + $link = 'index.php?option=com_search&Itemid='. $_Itemid; + } else { + // Assign no Itemid + $_Itemid = ''; + $link = 'index.php?option=com_search'; + } } ?> diff -urN joomla-1.0.7/modules/mod_search.xml joomla-1.0.10/modules/mod_search.xml --- joomla-1.0.7/modules/mod_search.xml 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_search.xml 2006-06-25 16:54:37.000000000 -0400 @@ -20,6 +20,8 @@ + + diff -urN joomla-1.0.7/modules/mod_sections.php joomla-1.0.10/modules/mod_sections.php --- joomla-1.0.7/modules/mod_sections.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_sections.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ get( 'count', 20 ) ); -$access = !$mainframe->getCfg( 'shownoauth' ); -$now = date( 'Y-m-d H:i:s', time() + $mosConfig_offset * 60 * 60 ); -$nullDate = $database->getNullDate(); +$count = intval( $params->get( 'count', 20 ) ); +$access = !$mainframe->getCfg( 'shownoauth' ); +$now = _CURRENT_SERVER_TIME; +$nullDate = $database->getNullDate(); $query = "SELECT a.id AS id, a.title AS title, COUNT(b.id) as cnt" . "\n FROM #__sections as a" diff -urN joomla-1.0.7/modules/mod_whosonline.php joomla-1.0.10/modules/mod_whosonline.php --- joomla-1.0.7/modules/mod_whosonline.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_whosonline.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ get( 'showmode' ); +$showmode = $params->get( 'showmode', 0 ); -$content = ''; +$output = ''; +// show online count if ($showmode==0 || $showmode==2) { - $query = "SELECT COUNT( session_id ) AS guest_online" + $query = "SELECT guest, usertype" . "\n FROM #__session" - . "\n WHERE guest = 1" - . "\n AND ( usertype is NULL OR usertype = '' )"; - $database->setQuery( $query ); - $guest_array = $database->loadResult(); - - $query = "SELECT COUNT( DISTINCT( username ) ) AS user_online" - . "\n FROM #__session" - . "\n WHERE guest = 0" ; $database->setQuery( $query ); - $user_array = $database->loadResult(); + $sessions = $database->loadObjectList(); - if ($guest_array != 0 && $user_array==0) { - if ($guest_array==1) { - $content.=_WE_HAVE; - $content.=_GUEST_COUNT; - $content.=_ONLINE; - eval ("\$content = \"$content\";"); - } else { - $content.=_WE_HAVE; - $content.=_GUESTS_COUNT; - $content.=_ONLINE; - eval ("\$content = \"$content\";"); + // calculate number of guests and members + $user_array = 0; + $guest_array = 0; + foreach( $sessions as $session ) { + // if guest increase guest count by 1 + if ( $session->guest == 1 && !$session->usertype ) { + $guest_array++; } - } - - if ($guest_array==0 && $user_array != 0) { - if ($user_array==1) { - $content.=_WE_HAVE; - $content.=_MEMBER_COUNT; - $content.=_ONLINE; - eval ("\$content = \"$content\";"); - } else { - $content.=_WE_HAVE; - $content.=_MEMBERS_COUNT; - $content.=_ONLINE; - eval ("\$content = \"$content\";"); + // if member increase member count by 1 + if ( $session->guest == 0 ) { + $user_array++; } } - - if ($guest_array != 0 && $user_array != 0) { - if ($guest_array==1) { - $content.=_WE_HAVE; - $content.=_GUEST_COUNT; - $content.=_AND; - eval ("\$content = \"$content\";"); - } else { - $content.=_WE_HAVE; - $content.=_GUESTS_COUNT; - $content.=_ONLINE; - $content.=_AND; - eval ("\$content = \"$content\";"); - } - - if ($user_array==1) { - $content.=_MEMBER_COUNT; - $content.=_ONLINE; - eval ("\$content = \"$content\";"); - } else { - $content.=_MEMBERS_COUNT; - $content.=_ONLINE; - eval ("\$content = \"$content\";"); + + // check if any guest or member is on the site + if ($guest_array != 0 || $user_array != 0) { + $output .= _WE_HAVE; + + // guest count handling + if ($guest_array == 1) { + // 1 guest only + $output .= sprintf( _GUEST_COUNT, $guest_array ); + } else if ($guest_array > 1) { + // more than 1 guest + $output .= sprintf( _GUESTS_COUNT, $guest_array ); } - + + // if there are guests and members online + if ($guest_array != 0 && $user_array != 0) { + $output .= _AND; + } + + // member count handling + if ($user_array == 1) { + // 1 member only + $output .= sprintf( _MEMBER_COUNT, $user_array ); + } else if ($user_array > 1) { + // more than 1 member + $output .= sprintf( _MEMBERS_COUNT, $user_array ); + } + + $output .= _ONLINE; } } -if ($showmode==1 || $showmode==2) { +// show online member names +if ($showmode > 0) { $query = "SELECT DISTINCT a.username" ."\n FROM #__session AS a" ."\n WHERE a.guest = 0" ; $database->setQuery($query); $rows = $database->loadObjectList(); - $content .= "
        \n"; - foreach($rows as $row) { - $content .= "
      • " . $row->username . "
      • \n"; - } - $content .= "
      \n"; - - if ( !$content ) { - echo _NONE ."\n"; + + if ( count( $rows ) ) { + // output + $output .= '
        '; + foreach($rows as $row) { + $output .= '
      • '; + $output .= ''; + $output .= $row->username; + $output .= ''; + $output .= '
      • '; + } + $output .= '
      '; } } + +echo $output; ?> \ No newline at end of file diff -urN joomla-1.0.7/modules/mod_wrapper.php joomla-1.0.10/modules/mod_wrapper.php --- joomla-1.0.7/modules/mod_wrapper.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/modules/mod_wrapper.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ get( 'url' ); if ( $params->get( 'add' ) ) { - // adds "http://" if none is set - if ( !strstr( $url, 'http' ) && !strstr( $url, 'https' ) ) { + // adds 'http://' if none is set + if ( substr( $url, 0, 1 ) == '/' ) { + // relative url in component. use server http_host. + $url = 'http://'. $_SERVER['HTTP_HOST'] . $url; + } elseif ( !strstr( $url, 'http' ) && !strstr( $url, 'https' ) ) { $url = 'http://'. $url; + } else { + $url = $url; } } // auto height control -if ( $params->get( 'height_auto' ) ) { - $load = "window.onload = iFrameHeight;\n"; +if ( $params->def( 'height_auto' ) ) { + $load = 'onload="iFrameHeight()"'; } else { $load = ''; } ?> \ No newline at end of file diff -urN joomla-1.0.7/offline.php joomla-1.0.10/offline.php --- joomla-1.0.7/offline.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/offline.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ id = mosGetParam( $_SESSION, 'session_user_id', '' ); - $admin->username = mosGetParam( $_SESSION, 'session_username', '' ); - $admin->usertype = mosGetParam( $_SESSION, 'session_usertype', '' ); + $admin->id = intval( mosGetParam( $_SESSION, 'session_user_id', '' ) ); + $admin->username = strval( mosGetParam( $_SESSION, 'session_username', '' ) ); + $admin->usertype = strval( mosGetParam( $_SESSION, 'session_usertype', '' ) ); $session_id = mosGetParam( $_SESSION, 'session_id', '' ); $logintime = mosGetParam( $_SESSION, 'session_logintime', '' ); @@ -55,6 +53,7 @@ } if (!defined( '_ADMIN_OFFLINE' ) || defined( '_INSTALL_CHECK' )) { + @include_once ('language/' . $mosConfig_lang . '.php' ); $cur_template = 'rhuk_solarflare_ii'; // needed to seperate the ISO number from the language file constant _ISO diff -urN joomla-1.0.7/pathway.php joomla-1.0.10/pathway.php --- joomla-1.0.7/pathway.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/pathway.php 2006-06-25 16:54:37.000000000 -0400 @@ -1,6 +1,6 @@ - - - + + diff -urN joomla-1.0.7/templates/rhuk_solarflare_ii/css/template_css.css joomla-1.0.10/templates/rhuk_solarflare_ii/css/template_css.css --- joomla-1.0.7/templates/rhuk_solarflare_ii/css/template_css.css 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/templates/rhuk_solarflare_ii/css/template_css.css 2006-06-25 16:54:38.000000000 -0400 @@ -29,7 +29,8 @@ #buttons_inner { border: 1px solid #cccccc; - height: 21px; + height: 21px !important; + height: 23px; } #pathway_text { @@ -592,7 +593,6 @@ a.sublevel#active_menu { color: #333; - text-decoration: bold; } .highlight { @@ -625,7 +625,6 @@ background: #efefef; padding: 1px 2px; color: #666; - text-transform: normal; font-size: 10px; border-top: 1px solid #cccccc; } diff -urN joomla-1.0.7/templates/rhuk_solarflare_ii/index.php joomla-1.0.10/templates/rhuk_solarflare_ii/index.php --- joomla-1.0.7/templates/rhuk_solarflare_ii/index.php 2006-01-16 04:17:12.000000000 -0500 +++ joomla-1.0.10/templates/rhuk_solarflare_ii/index.php 2006-06-25 16:54:38.000000000 -0400 @@ -40,7 +40,7 @@ } ?> - + @@ -93,11 +93,11 @@
      @@ -127,7 +127,7 @@ if ( $colspan == 3) { ?> 10/20/05rhukGNU/GPL - rhuk@jamboworks - http://www.jamboworks.com + rhuk@rockettheme.com.com + http://www.rockettheme.com2.2SolarFlare II is a simple and stylish template. The clean design of this template makes it very lightweight and fast. This is a significatn upgrade for the original SolarFlare template in that is has a completely revised layout that uses an alternate box model hack that makes it easier to modify. Also a table has been introduced in the main content area that better constricts layout causing less problems with 'problematic' components. New headers and menu elements give this template a 'fresher' look.
      - +   - id"); ?>';" /> + id$_Itemid"); ?>';" />
      - powered_by.png, 1 kB
      + powered_by.png, 1 kB
      - +
      -
      +