diff --git a/documentation/changelog.html b/documentation/changelog.html index 758a8ad78a..37a4edc556 100644 --- a/documentation/changelog.html +++ b/documentation/changelog.html @@ -33,16 +33,26 @@
  • An internationalization option has been added for improving sorting in arbitrary language. When the intl php-extension has been installed, various sorting routines exploit it for better sorting. Rationale: The PHP5 run-time environment does not provide native and reliable way of sorting UTF-8 strings. (FS#306)
  • The installation sript: The page about system requilements has been updated. Also, at the very beginning, a check has been added whether the mbstring php-extension is installed - see the related forum topic. (FS#306)
  • A new php-based configuration for the online editor has been implemented, see dokeos/main/inc/lib/fckeditor/myconfig.php. Also, toolbar definitions have been split in separate php-files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . Customization of the editor is more convenient and flexible now. (FS#2867)
  • -
  • The online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • -
  • The online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #2821, #2856, #2915, #3120, #3181, #3429, #3439, #3880. (FS#2867)
  • -
  • The online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • -
  • The online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • -
  • The online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • -
  • The online editor: The audio plugin has been activated by default as an implementation of the "Insert audio / Audio properties" dialog. This new plugin is intended to replace the "MP3" plugin. (FS#2867)
  • -
  • The online editor: Configuration of the mimetex plugin has been reworked to gain simplicity. The procedure for configuration has been updated, see the related forum topic. (FS#2867)
  • -
  • The online editor: The toolbar icons have been upgraded to those from CKEditor 3.0. (FS#2867)
  • +
  • Online editor: A upgrade from FCKEditor 2.6.4 to FCKEditor 2.6.4.1 has been implemented. (FS#4383)
  • +
  • Online editor: Several known bug-fixes from FCKEditor 2.6.5 SVN have been implemented, tickets #1537, #2156, #2689, #2821, #2856, #2874, #2915, #3120, #3181, #3427, #3429, #3439, #3446, #3481, #3677, #3818, #3880, #3925. (FS#2867)
  • +
  • Online editor: The simple file manager, the advanced file manager and the image manager have been integrated by default with the editor's dialog system. Thus, they work faster and in a more secure way. (FS#2867)
  • +
  • Online editor: Blocking copy/paste for trainees has been added. The feature is configurable through editing the toolbar definition files within the directory dokeos/main/inc/lib/fckeditor/toolbars/ . (FS#2867)
  • +
  • Online editor: Preview tabs have been added to the dialogs for inserting video, flv-video, and YouTube video. (FS#2867)
  • +
  • Online editor: The audio plugin has been activated by default as an implementation of the "Insert audio / Audio properties" dialog. This new plugin is intended to replace the "MP3" plugin. (FS#2867)
  • +
  • Online editor: Configuration of the mimetex plugin has been reworked to gain simplicity. The procedure for configuration has been updated, see the related forum topic. (FS#2867)
  • +
  • Online editor: The toolbar icons have been upgraded to those from CKEditor 3.0. (FS#2867)
  • A solution has been implemented for fixing the "__flash__removeCallback" bug, which affects the media player on Internet Explorer browser. (FS#4378 and FS#2867)
  • Implement new sub-language feature by which language terms redefinition becomes possible through the admin section (FS#4321)
  • +
  • Social: Added possibility to define RSS feeds inside personal page of social network (need to define an 'rssfeeds' extra user text field)
  • +
  • Admin: Added courses from sessions inside AJAX popup of courses list in users list (SVN#22398)
  • +
  • Admin: Showing full-length course titles in list of courses while adding to sessions(SVN#22399)
  • +
  • Admin: Added session name in title of session edition pages(SVN#22400)
  • + +
    +

    Known issues

    +

    Known issues

    diff --git a/main/admin/add_courses_to_session.php b/main/admin/add_courses_to_session.php index 216d625cbe..d482d5348d 100644 --- a/main/admin/add_courses_to_session.php +++ b/main/admin/add_courses_to_session.php @@ -1,26 +1,5 @@ -debugOn(); $xajax -> registerFunction ('search_courses'); @@ -164,7 +143,7 @@ function search_courses($needle,$type) while($course = Database :: fetch_array($rs)) { $course_list[] = $course['code']; $course_title=str_replace("'","\'",$course_title); - $return .= ''; + $return .= ''; } $return .= ''; @@ -301,8 +280,9 @@ echo '
    '; echo $link_add_type_unique.$link_add_type_multiple; echo '
    '; -// the form header -echo '
    '.$tool_name.'
    '; +// the form header +$session_info = SessionManager::fetch($id_session); +echo '
    '.$tool_name.' ('.$session_info['name'].')
    '; /*$sql = 'SELECT COUNT(1) FROM '.$tbl_course; @@ -436,7 +416,7 @@ else foreach($nosessionCourses as $enreg) { ?> - + - + - + \ No newline at end of file diff --git a/main/auth/inscription.php b/main/auth/inscription.php index 921dafb2bc..2ca70ec76f 100644 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -1,5 +1,5 @@ addElement('hidden', 'legal_accept_type',$term_preview['version'].':'.$term_preview['language_id']); + $form->addElement('hidden', 'legal_info',$term_preview['legal_id'].':'.$term_preview['language_id']); if (isset($_SESSION['info_current_user'][1]) && isset($_SESSION['info_current_user'][2])) { $form->addElement('hidden', 'login',$_SESSION['info_current_user'][1]); - $form->addElement('hidden', 'password',$_SESSION['info_current_user'][2]); + $form->addElement('hidden', 'password',$_SESSION['info_current_user'][2]); } if($term_preview['type'] == 1) { - $form->addElement('checkbox', 'legal_accept', null, get_lang('IhaveReadAndAgree').' '.get_lang('TermsAndConditions').''); + $form->addElement('checkbox', 'legal_accept', null, get_lang('IHaveReadAndAgree').' '.get_lang('TermsAndConditions').''); $form->addRule('extra_legal_accept', get_lang('ThisFieldIsRequired'), 'required'); } else { if (!empty($term_preview['content'])) { diff --git a/main/document/slideshowoptions.php b/main/document/slideshowoptions.php index a8ada88fd7..e64eb674de 100644 --- a/main/document/slideshowoptions.php +++ b/main/document/slideshowoptions.php @@ -1,4 +1,4 @@ -'; } ?>> -

    +

    @@ -178,32 +178,28 @@ echo ''; ?>>
    -

    +

    :   > -
    +
    :      - > + } else { + echo " class=\"disabled_input\""; + } + ?> >
    @@ -216,5 +212,4 @@ echo '
    '; +Display::display_footer(); \ No newline at end of file diff --git a/main/dropbox/dropbox_functions.inc.php b/main/dropbox/dropbox_functions.inc.php index ab3bc65c6b..fcd4d47a52 100644 --- a/main/dropbox/dropbox_functions.inc.php +++ b/main/dropbox/dropbox_functions.inc.php @@ -1,12 +1,10 @@ , Ghent University */ - /** * This function is a wrapper function for the multiple actions feature. * @return Mixed If there is a problem, return a string message, otherwise nothing @@ -137,13 +135,13 @@ function delete_category($action, $id) // step 1: delete the category $sql="DELETE FROM ".$dropbox_cnf['tbl_category']." WHERE cat_id='".Database::escape_string($id)."' AND $sentreceived='1'"; - $result=api_sql_query($sql); + $result=Database::query($sql,__FILE__,__LINE__); // step 2: delete all the documents in this category $sql="SELECT * FROM ".$entries_table." WHERE cat_id='".Database::escape_string($id)."'"; - $result=api_sql_query($sql); + $result=Database::query($sql,__FILE__,__LINE__); - while ($row=mysql_fetch_array($result)) + while ($row=Database::fetch_array($result)) { $dropboxfile=new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor); if ($action=='deletereceivedcategory') @@ -170,8 +168,8 @@ function display_move_form($part, $id, $target=array()) { echo '
    '.get_lang('MoveFileTo').'
    '; echo '
    '; - echo ''; - echo ''; + echo ''; + echo ''; echo '
    @@ -227,7 +225,7 @@ function store_move($id, $target, $part) WHERE dest_user_id='".Database::escape_string($_user['user_id'])."' AND file_id='".Database::escape_string($id)."' "; - api_sql_query($sql,__FILE__,__LINE__); + Database::query($sql,__FILE__,__LINE__); $return_message=get_lang('ReceivedFileMoved'); } if ($part=='sent') @@ -236,7 +234,7 @@ function store_move($id, $target, $part) WHERE uploader_id='".Database::escape_string($_user['user_id'])."' AND id='".Database::escape_string($id)."' "; - api_sql_query($sql,__FILE__,__LINE__); + Database::query($sql,__FILE__,__LINE__); $return_message=get_lang('SentFileMoved'); } } @@ -278,7 +276,7 @@ function display_action_options($part, $categories, $current_category=0) echo ''; } echo ''; - echo ''; + echo ''; } /** @@ -299,7 +297,7 @@ function display_file_checkbox($id, $part) { $checked='checked'; } - $return_value=''; + $return_value=''; return $return_value; } @@ -325,8 +323,8 @@ function get_dropbox_categories($filter='') $sql="SELECT * FROM ".$dropbox_cnf['tbl_category']." WHERE user_id='".$_user['user_id']."'"; - $result=api_sql_query($sql); - while ($row=mysql_fetch_array($result)) + $result=Database::query($sql,__FILE__,__LINE__); + while ($row=Database::fetch_array($result)) { if(($filter=='sent' AND $row['sent']==1) OR ($filter=='received' AND $row['received']==1) OR $filter=='') { @@ -382,7 +380,7 @@ function store_addcategory() { // step 3a, we check if the category doesn't already exist $sql="SELECT * FROM ".$dropbox_cnf['tbl_category']." WHERE user_id='".$_user['user_id']."' AND cat_name='".Database::escape_string(Security::remove_XSS($_POST['category_name']))."' AND received='".$received."' AND sent='".$sent."'"; - $result=api_sql_query($sql); + $result=Database::query($sql,__FILE__,__LINE__); // step 3b, we add the category if it does not exist yet. @@ -390,7 +388,7 @@ function store_addcategory() { $sql="INSERT INTO ".$dropbox_cnf['tbl_category']." (cat_name, received, sent, user_id) VALUES ('".Database::escape_string(Security::remove_XSS($_POST['category_name']))."', '".Database::escape_string($received)."', '".Database::escape_string($sent)."', '".Database::escape_string($_user['user_id'])."')"; - api_sql_query($sql); + Database::query($sql,__FILE__,__LINE__); return array('type' => 'confirmation', 'message'=>get_lang('CategoryStored')); } else @@ -403,7 +401,7 @@ function store_addcategory() $sql="UPDATE ".$dropbox_cnf['tbl_category']." SET cat_name='".Database::escape_string(Security::remove_XSS($_POST['category_name']))."', received='".Database::escape_string($received)."' , sent='".Database::escape_string($sent)."' WHERE user_id='".Database::escape_string($_user['user_id'])."' AND cat_id='".Database::escape_string(Security::remove_XSS($_POST['edit_id']))."'"; - api_sql_query($sql); + Database::query($sql,__FILE__,__LINE__); return array('type' => 'confirmation', 'message'=>get_lang('CategoryModified')); } } @@ -427,7 +425,7 @@ function display_addcategory_form($category_name='', $id='',$action) { // retrieve the category we are editing $sql="SELECT * FROM ".$dropbox_cnf['tbl_category']." WHERE cat_id='".Database::escape_string($id)."'"; - $result=api_sql_query($sql); + $result=Database::query($sql,__FILE__,__LINE__); $row=Database::fetch_array($result); if ($category_name=='') // after an edit with an error we do not want to return to the original name but the name we already modified. (happens when createinrecievedfiles AND createinsentfiles are not checked) @@ -485,7 +483,7 @@ function display_addcategory_form($category_name='', $id='',$action) { echo ''.get_lang('CategoryAlreadyExistsEditIt').'
    '; } - echo ' + echo '
    '; @@ -503,7 +501,7 @@ function display_addcategory_form($category_name='', $id='',$action) * '.get_lang('ThisFieldIsRequired').' '; - echo "
    "; + echo ''; echo '
    '; } @@ -520,7 +518,7 @@ function display_add_form() $token = Security::get_token(); $dropbox_person = new Dropbox_Person( $_user['user_id'], $is_courseAdmin, $is_courseTutor); ?> -
    " enctype="multipart/form-data" onsubmit="return checkForm(this)"> + " enctype="multipart/form-data" onsubmit="return checkForm(this)">
    @@ -536,7 +534,7 @@ function display_add_form() "; + echo ''; } ?> @@ -686,12 +684,12 @@ function getUserNameFromId ( $id) // RH: Mailing: return 'Mailing ' + id { return dropbox_lang("mailingAsUsername", "noDLTT") . $mailingId; } - + $id = intval($id); $sql = "SELECT CONCAT(lastname,' ', firstname) AS name FROM " . dropbox_cnf("tbl_user") . " - WHERE user_id='" . addslashes( $id) . "'"; - $result = api_sql_query($sql,__FILE__,__LINE__); - $res = mysql_fetch_array( $result); + WHERE user_id='$id'"; + $result = Database::query($sql,__FILE__,__LINE__); + $res = Database::fetch_array( $result); if ( $res == FALSE) return FALSE; return stripslashes( $res["name"]); @@ -703,11 +701,12 @@ function getUserNameFromId ( $id) // RH: Mailing: return 'Mailing ' + id */ function getLoginFromId ( $id) { + $id = intval($id); $sql = "SELECT username FROM " . dropbox_cnf("tbl_user") . " - WHERE user_id='" . addslashes( $id) . "'"; - $result =api_sql_query($sql,__FILE__,__LINE__); - $res = mysql_fetch_array( $result); + WHERE user_id='$id'"; + $result =Database::query($sql,__FILE__,__LINE__); + $res = Database::fetch_array( $result); if ( $res == FALSE) return FALSE; return stripslashes( $res["username"]); } @@ -736,14 +735,14 @@ function removeUnusedFiles( ) FROM " . dropbox_cnf("tbl_file") . " f LEFT JOIN " . dropbox_cnf("tbl_person") . " p ON f.id = p.file_id WHERE p.user_id IS NULL"; - $result = api_sql_query($sql,__FILE__,__LINE__); - while ( $res = mysql_fetch_array( $result)) + $result = Database::query($sql,__FILE__,__LINE__); + while ( $res = Database::fetch_array( $result)) { //delete the selected files from the post and file tables $sql = "DELETE FROM " . dropbox_cnf("tbl_post") . " WHERE file_id='" . $res['id'] . "'"; - $result1 = api_sql_query($sql,__FILE__,__LINE__); + $result1 = Database::query($sql,__FILE__,__LINE__); $sql = "DELETE FROM " . dropbox_cnf("tbl_file") . " WHERE id='" . $res['id'] . "'"; - $result1 = api_sql_query($sql,__FILE__,__LINE__); + $result1 = Database::query($sql,__FILE__,__LINE__); //delete file from server @unlink( dropbox_cnf("sysPath") . "/" . $res["filename"]); @@ -759,19 +758,20 @@ function removeUnusedFiles( ) * Mailing content files have uploader_id == mailing pseudo_id, a normal recipient, * and are visible initially to recipient and pseudo_id. * -* @author Ren� Haentjens, Ghent University +* @author René Haentjens, Ghent University * * @todo check if this function is still necessary. */ function getUserOwningThisMailing($mailingPseudoId, $owner = 0, $or_die = '') { + $mailingPseudoId = intval($mailingPseudoId); $sql = "SELECT f.uploader_id FROM " . dropbox_cnf("tbl_file") . " f LEFT JOIN " . dropbox_cnf("tbl_post") . " p ON f.id = p.file_id WHERE p.dest_user_id = '" . $mailingPseudoId . "'"; - $result = api_sql_query($sql,__FILE__,__LINE__); + $result = Database::query($sql,__FILE__,__LINE__); - if (!($res = mysql_fetch_array($result))) + if (!($res = Database::fetch_array($result))) die(dropbox_lang("generalError")." (code 901)"); if ($owner == 0) return $res['uploader_id']; @@ -791,23 +791,23 @@ function removeMoreIfMailing($file_id) // for all content files, delete mailingPseudoId from person-table // 2. finding the owner (getUserOwningThisMailing) is no longer possible, so // for all content files, replace mailingPseudoId by owner as uploader - + $file_id = intval($file_id); $sql = "SELECT p.dest_user_id FROM " . dropbox_cnf("tbl_post") . " p WHERE p.file_id = '" . $file_id . "'"; - $result = api_sql_query($sql,__FILE__,__LINE__); + $result = Database::query($sql,__FILE__,__LINE__); - if ( $res = mysql_fetch_array( $result)) + if ( $res = Database::fetch_array( $result)) { $mailingPseudoId = $res['dest_user_id']; if ( $mailingPseudoId > dropbox_cnf("mailingIdBase")) { $sql = "DELETE FROM " . dropbox_cnf("tbl_person") . " WHERE user_id='" . $mailingPseudoId . "'"; - $result1 = api_sql_query($sql,__FILE__,__LINE__); + $result1 = Database::query($sql,__FILE__,__LINE__); $sql = "UPDATE " . dropbox_cnf("tbl_file") . " SET uploader_id='" . api_get_user_id() . "' WHERE uploader_id='" . $mailingPseudoId . "'"; - $result1 = api_sql_query($sql,__FILE__,__LINE__); + $result1 = Database::query($sql,__FILE__,__LINE__); } } } @@ -817,7 +817,7 @@ function removeMoreIfMailing($file_id) * * @todo check if this function is still necessary. * -* @author Ren� Haentjens, Ghent University +* @author René Haentjens, Ghent University */ function dropbox_lang($variable, $notrans = 'DLTT') { @@ -1055,13 +1055,14 @@ function display_user_link($user_id, $name='') { $table_user = Database::get_main_table(TABLE_MAIN_USER); $sql="SELECT * FROM $table_user WHERE user_id='".Database::escape_string($user_id)."'"; - $result=api_sql_query($sql,__FILE__,__LINE__); - $row=mysql_fetch_array($result); + $result=Database::query($sql,__FILE__,__LINE__); + $row=Database::fetch_array($result); return "".$row['firstname']." ".$row['lastname'].""; } else { - return "".$name.""; + $user_id = intval($user_id); + return "".Security::remove_XSS($name).""; } } else @@ -1101,8 +1102,8 @@ function feedback($array) function format_feedback($feedback) { $output.=display_user_link($feedback['author_user_id']); - $output.='  ['.$feedback['feedback_date'].']
    '; - $output.='
    '.nl2br($feedback['feedback']).'


    '; + $output.='  ['.$feedback['feedback_date'].']
    '; + $output.='
    '.nl2br($feedback['feedback']).'


    '; return $output; } @@ -1122,8 +1123,8 @@ function feedback_form() // we now check if the other users have not delete this document yet. If this is the case then it is useless to see the // add feedback since the other users will never get to see the feedback. $sql="SELECT * FROM ".$dropbox_cnf["tbl_person"]." WHERE file_id='".Database::escape_string($_GET['id'])."'"; - $result=api_sql_query($sql,__LINE__, __FILE__); - $number_users_who_see_file=mysql_num_rows($result); + $result=Database::query($sql,__LINE__, __FILE__); + $number_users_who_see_file=Database::num_rows($result); if ($number_users_who_see_file>1) { $return .= '
    "; echo ""; - echo "
    "; -?> - +Display::display_footer(); \ No newline at end of file diff --git a/main/exercice/exercice.php b/main/exercice/exercice.php index 749c72e83e..2613222e2c 100644 --- a/main/exercice/exercice.php +++ b/main/exercice/exercice.php @@ -1066,7 +1066,7 @@ if ($show == 'test') { $title = GetQuizName($path, $documentPath); if ($title == '') { - $title = GetFileName($path); + $title = basename($path); } // prof only if ($is_allowedToEdit) { @@ -1345,7 +1345,7 @@ if ($_configuration['tracking_enabled'] && ($show == 'result')) { for ($i = 0; $i < sizeof($hpresults); $i++) { $title = GetQuizName($hpresults[$i][1], $documentPath); if ($title == '') { - $title = GetFileName($hpresults[$i][1]); + $title = basename($hpresults[$i][1]); } echo ''; if ($is_allowedToEdit) { diff --git a/main/exercice/exercise_result.class.php b/main/exercice/exercise_result.class.php index 41fc34771f..202e307559 100644 --- a/main/exercice/exercise_result.class.php +++ b/main/exercice/exercise_result.class.php @@ -196,7 +196,7 @@ class ExerciseResult $title = GetQuizName($hpresults[$i][1],$document_path); if ($title =='') { - $title = GetFileName($hpresults[$i][1]); + $title = basename($hpresults[$i][1]); } if(empty($user_id)) { diff --git a/main/exercice/hotpotatoes.lib.php b/main/exercice/hotpotatoes.lib.php index 12e14b033b..692c8ddb95 100644 --- a/main/exercice/hotpotatoes.lib.php +++ b/main/exercice/hotpotatoes.lib.php @@ -54,7 +54,7 @@ function GetQuizName($fname,$fpath) { if (file_exists($fpath.$fname)) { if (!($fp = fopen($fpath.$fname, "r"))) { //die("could not open Quiz input"); - return GetFileName($fname); + return basename($fname); } $contents = fread($fp, filesize($fpath.$fname)); @@ -113,19 +113,6 @@ function SetComment($path,$comment) { return "$result"; } -/** - * Get the name of the file from a path (without the extension) - * - * This assumes the path is made of elements split by '/', not '\' or '\\' - * @param string Path - * @return string File name - */ -function GetFileName($fname) { - $name = explode('/',$fname); - $name = $name[sizeof($name)-1]; - return $name; -} - /** * Reads the file contents into a string * @param string Urlencoded path @@ -171,7 +158,6 @@ function WriteFileCont($full_file_path,$content) { * Gets the name of an img whose path is given (without directories or extensions) * @param string An image tag () * @return string The image file name or an empty string - * @uses GetFileName No comment */ function GetImgName($imgtag) { // select src tag from img tag @@ -186,7 +172,7 @@ function GetImgName($imgtag) { if ($src=="") { return ""; } else { - $tmp_src = GetFileName($src) ; + $tmp_src = basename($src) ; if ($tmp_src == "") { return $src; } else { @@ -310,7 +296,7 @@ function ReplaceImgTag($content) { else { $prehref = $imgname; - $posthref = GetFileName($imgname); + $posthref = basename($imgname); $newcontent = str_replace($prehref,$posthref,$newcontent); } } diff --git a/main/exercice/showinframes.php b/main/exercice/showinframes.php index 6fb34d11c9..f2ae04da2e 100644 --- a/main/exercice/showinframes.php +++ b/main/exercice/showinframes.php @@ -84,7 +84,7 @@ WriteFileCont($full_file_path.$_user['user_id'].".t.html",$newcontent); $newcontent = str_replace($prehref,$posthref,$newcontent); */ -$doc_url = GetFolderPath($doc_url).urlencode(GetFileName($doc_url)); +$doc_url = GetFolderPath($doc_url).urlencode(basename($doc_url)); // echo $documentWebPath.$doc_url.$_user['user_id'].".t.html"; // exit; ?> diff --git a/main/exercice/testheaderpage.php b/main/exercice/testheaderpage.php index 7df74d1eb9..f448405da0 100644 --- a/main/exercice/testheaderpage.php +++ b/main/exercice/testheaderpage.php @@ -18,7 +18,7 @@ $my_file=str_replace(array('../','\\..','\\0','..\\'),array('','','',''),urldeco $title = GetQuizName($my_file,$documentPath); if ($title =='') { - $title = GetFileName($my_file); + $title = basename($my_file); } $nameTools = $title; $noPHP_SELF=true; diff --git a/main/forum/forumfunction.inc.php b/main/forum/forumfunction.inc.php index e687a7c8bb..0dca9a920e 100644 --- a/main/forum/forumfunction.inc.php +++ b/main/forum/forumfunction.inc.php @@ -3898,23 +3898,28 @@ function get_thread_user_post($course_db, $thread_id, $user_id ) $j=0; $forums = get_forums(); krsort($forums); - $forum_results = ''; + $forum_results = ''; + foreach($forums as $forum) { if ($j<=4) { - $threads = get_threads($forum['forum_id']); + $threads = get_threads($forum['forum_id']); + if (is_array($threads)) { /*echo Display::return_icon('forum.gif'); echo $forum['forum_title'];*/ - $my_course_db=explode('_',$course_db); - $my_course_code=$my_course_db[1]; + //$my_course_db=explode('_',$course_db); + //$my_course_code=$my_course_db[1]; + $my_course_code=CourseManager::get_course_id_by_database_name($course_db); $i=0; $hand_forums = ''; $post_counter = 0; foreach($threads as $thread) { if ($i<=4) { $post_list = get_thread_user_post_limit($course_db, $thread['thread_id'], $user_id, 1); + $post_counter = count($post_list); if (is_array($post_list) && count($post_list)>0) { + $hand_forums.= '
    '; $hand_forums.= Display::return_icon('forumthread.gif'); $hand_forums.= $thread['thread_title'].' '; @@ -3930,17 +3935,18 @@ function get_thread_user_post($course_db, $thread_id, $user_id ) $hand_forums.= '
    '; } $i++; - } - if ($post_counter > 0 ) { - $forum_results .='
    '; - $forum_results .='

    '; - $forum_results .='
    '.Display::return_icon('forum.gif').'    '.$forum['forum_title'].'        
    '.get_lang('SeeForum').'
    '; - $forum_results .='
    '; - $forum_results .=$hand_forums; - $forum_results .='
    '; - } - } - } $j++; + + if ($post_counter > 0 ) { + $forum_results .='
    '; + $forum_results .='

    '; + $forum_results .='
    '.Display::return_icon('forum.gif').'    '.$forum['forum_title'].'        
    '.get_lang('SeeForum').'
    '; + $forum_results .='
    '; + $forum_results .=$hand_forums; + $forum_results .='
    '; + } + } + } $j++; + } } return $forum_results; } @@ -3957,7 +3963,7 @@ function get_thread_user_post_limit($course_db, $thread_id, $user_id, $limit=10) AND posts.poster_id='".Database::escape_string($user_id)."' ORDER BY posts.post_id DESC LIMIT $limit "; $result=api_sql_query($sql, __FILE__, __LINE__); - + while ($row=Database::fetch_array($result)) { $row['status'] = '1'; $post_list[]=$row; diff --git a/main/gradebook/gradebook_result.class.php b/main/gradebook/gradebook_result.class.php index d532dbb012..2e82a4d53c 100644 --- a/main/gradebook/gradebook_result.class.php +++ b/main/gradebook/gradebook_result.class.php @@ -177,7 +177,7 @@ class GradeBookResult $return[$j+$i] = array(); $title = GetQuizName($hpresults[$i][1],$document_path); if ($title =='') { - $title = GetFileName($hpresults[$i][1]); + $title = basename($hpresults[$i][1]); } if (empty($user_id)) { $return[$j+$i]['user'] = $hpresults[$i][0]; diff --git a/main/img/wiki/assignment.gif b/main/img/wiki/assignment.gif index 6f3aac6ded..fa5dbbbca3 100644 Binary files a/main/img/wiki/assignment.gif and b/main/img/wiki/assignment.gif differ diff --git a/main/img/wiki/task.gif b/main/img/wiki/task.gif new file mode 100644 index 0000000000..1e8d5690bd Binary files /dev/null and b/main/img/wiki/task.gif differ diff --git a/main/img/wiki/works.gif b/main/img/wiki/works.gif index 1e8d5690bd..398fa545a7 100644 Binary files a/main/img/wiki/works.gif and b/main/img/wiki/works.gif differ diff --git a/main/inc/lib/add_course.lib.inc.php b/main/inc/lib/add_course.lib.inc.php index f9ff354f47..9c182350d2 100644 --- a/main/inc/lib/add_course.lib.inc.php +++ b/main/inc/lib/add_course.lib.inc.php @@ -901,6 +901,7 @@ function update_Db_course($courseDbName) // $sql = "CREATE TABLE `".$TABLEWIKICONF . "` ( page_id int NOT NULL default 0, + task text NOT NULL, feedback1 text NOT NULL, feedback2 text NOT NULL, feedback3 text NOT NULL, diff --git a/main/inc/lib/blog.lib.php b/main/inc/lib/blog.lib.php index b41ebfe572..811abf3235 100644 --- a/main/inc/lib/blog.lib.php +++ b/main/inc/lib/blog.lib.php @@ -3026,11 +3026,12 @@ function get_blog_post_from_user($course_db_name, $user_id) { ORDER BY post.date_creation DESC "; $result = api_sql_query($sql, __FILE__, __LINE__); $return_data = ''; - $my_course_info=explode('_',$course_db_name); + //$my_course_info=explode('_',$course_db_name); + $my_course_id=CourseManager::get_course_id_by_database_name($course_db_name); if (Database::num_rows($result)!=0) { while ($row=Database::fetch_array($result)) { $return_data.= '

    '; - $return_data.= '
    '.$row['title'].'        
    '.get_lang('SeeBlog').'
    '; + $return_data.= '
    '.$row['title'].'        
    '.get_lang('SeeBlog').'
    '; $return_data.= '
    '; //$return_data.= ''.$row['title'].''; echo '
    '; $return_data.= $row['full_text']; diff --git a/main/inc/lib/course.lib.php b/main/inc/lib/course.lib.php index 84b5ae59d8..67db70e032 100644 --- a/main/inc/lib/course.lib.php +++ b/main/inc/lib/course.lib.php @@ -1895,18 +1895,32 @@ class CourseManager { /** * Get list of courses for a given user * @param int user ID + * @param boolean Whether to include courses from session or not * @return array List of codes and db names * @author isaac flores paz */ - public static function get_courses_list_by_user_id ($user_id) { + public static function get_courses_list_by_user_id ($user_id, $include_sessions=false) { $course_list=array(); + $codes = array(); + $user_id = intval($user_id); $tbl_course = Database::get_main_table(TABLE_MAIN_COURSE); $tbl_course_rel_user = Database::get_main_table(TABLE_MAIN_COURSE_USER); - $sql='SELECT c.code,c.db_name,c.title FROM '.$tbl_course.' c inner join '.$tbl_course_rel_user.' cru on c.code=cru.course_code WHERE cru.user_id='.Database::escape_string($user_id); + $sql='SELECT c.code,c.db_name,c.title FROM '.$tbl_course.' c inner join '.$tbl_course_rel_user.' cru on c.code=cru.course_code WHERE cru.user_id='.$user_id; $result=api_sql_query($sql,__FILE__,__LINE__); while ($row=Database::fetch_array($result,'ASSOC')) { - $course_list[]=$row; - } + $course_list[]=$row; + $codes[] = $row['code']; + } + if ($include_sessions === true) { + $tbl_csu = Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER); + $s = "SELECT distinct(c.code),c.db_name,c.title FROM $tbl_csu s, $tbl_course c WHERE id_user = $user_id AND s.course_code=c.code"; + $r = Database::query($s,__FILE__,__LINE__); + while ($row=Database::fetch_array($r,'ASSOC')) { + if (!in_array($row['code'],$codes)) { + $course_list[]=$row; + } + } + } return $course_list; } /** @@ -2115,5 +2129,16 @@ class CourseManager { } else { return false; //field not found } + } + /** + * Get the course id of an course by the database name + * @param string The database name + * @return string The course id + */ + public static function get_course_id_by_database_name ($db_name) { + $t_course = Database::get_main_table(TABLE_MAIN_COURSE); + $sql='SELECT code FROM '.$t_course.' WHERE db_name="'.Database::escape_string($db_name).'"'; + $rs=Database::query($sql,__FILE__,__LINE__); + return Database::result($rs,0,'code'); } } //end class CourseManager diff --git a/main/inc/lib/fckeditor/editor/_source/commandclasses/fck_othercommands.js b/main/inc/lib/fckeditor/editor/_source/commandclasses/fck_othercommands.js index ac26085052..f2d2c0ee70 100644 --- a/main/inc/lib/fckeditor/editor/_source/commandclasses/fck_othercommands.js +++ b/main/inc/lib/fckeditor/editor/_source/commandclasses/fck_othercommands.js @@ -40,7 +40,7 @@ var FCKDialogCommand = function( name, title, url, width, height, getStateFuncti FCKDialogCommand.prototype.Execute = function() { - FCKDialog.OpenDialog( 'FCKDialog_' + this.Name , this.Title, this.Url, this.Width, this.Height, this.CustomValue, null, this.Resizable ) ; + FCKDialog.OpenDialog( 'FCKDialog_' + this.Name , this.Title, this.Url, this.Width, this.Height, this.CustomValue, this.Resizable ) ; } FCKDialogCommand.prototype.GetState = function() @@ -186,7 +186,7 @@ FCKSourceCommand.prototype.Execute = function() { var iWidth = FCKConfig.ScreenWidth * 0.65 ; var iHeight = FCKConfig.ScreenHeight * 0.65 ; - FCKDialog.OpenDialog( 'FCKDialog_Source', FCKLang.Source, 'dialog/fck_source.html', iWidth, iHeight, null, null, true ) ; + FCKDialog.OpenDialog( 'FCKDialog_Source', FCKLang.Source, 'dialog/fck_source.html', iWidth, iHeight, null, true ) ; } else FCK.SwitchEditMode() ; diff --git a/main/inc/lib/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js b/main/inc/lib/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js index dccd794625..f919105a6f 100644 --- a/main/inc/lib/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js +++ b/main/inc/lib/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js @@ -193,9 +193,9 @@ FCKTextColorCommand.prototype._CreatePanelBody = function( targetDocument, targe oDiv.innerHTML = '
    ' + FCKLang.ColorMoreColors + '
    ' ; FCKTools.AddEventListenerEx( oDiv, 'click', FCKTextColorCommand_MoreOnClick, this ) ; + + // Dirty hack for Opera, Safari and Firefox 3. + if ( !FCKBrowserInfo.IsIE ) + oDiv.style.width = '96%' ; } - - // Dirty hack for Opera, Safari and Firefox 3. - if ( !FCKBrowserInfo.IsIE ) - oDiv.style.width = '96%' ; } diff --git a/main/inc/lib/fckeditor/editor/_source/fckeditorapi.js b/main/inc/lib/fckeditor/editor/_source/fckeditorapi.js index c0937f71e2..95b7ee34ab 100644 --- a/main/inc/lib/fckeditor/editor/_source/fckeditorapi.js +++ b/main/inc/lib/fckeditor/editor/_source/fckeditorapi.js @@ -1,179 +1,179 @@ -/* - * FCKeditor - The text editor for Internet - http://www.fckeditor.net - * Copyright (C) 2003-2009 Frederico Caldeira Knabben - * - * == BEGIN LICENSE == - * - * Licensed under the terms of any of the following licenses at your - * choice: - * - * - GNU General Public License Version 2 or later (the "GPL") - * http://www.gnu.org/licenses/gpl.html - * - * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") - * http://www.gnu.org/licenses/lgpl.html - * - * - Mozilla Public License Version 1.1 or later (the "MPL") - * http://www.mozilla.org/MPL/MPL-1.1.html - * - * == END LICENSE == - * - * Create the FCKeditorAPI object that is available as a global object in - * the page where the editor is placed in. - */ - -var FCKeditorAPI ; - -function InitializeAPI() -{ - var oParentWindow = window.parent ; - - if ( !( FCKeditorAPI = oParentWindow.FCKeditorAPI ) ) - { - // Make the FCKeditorAPI object available in the parent window. Use - // eval so this core runs in the parent's scope and so it will still be - // available if the editor instance is removed ("Can't execute code - // from a freed script" error). - - // Note: we check the existence of oEditor.GetParentForm because some external - // code (like JSON) can extend the Object prototype and we get then extra oEditor - // objects that aren't really FCKeditor instances. - var sScript = +/* + * FCKeditor - The text editor for Internet - http://www.fckeditor.net + * Copyright (C) 2003-2009 Frederico Caldeira Knabben + * + * == BEGIN LICENSE == + * + * Licensed under the terms of any of the following licenses at your + * choice: + * + * - GNU General Public License Version 2 or later (the "GPL") + * http://www.gnu.org/licenses/gpl.html + * + * - GNU Lesser General Public License Version 2.1 or later (the "LGPL") + * http://www.gnu.org/licenses/lgpl.html + * + * - Mozilla Public License Version 1.1 or later (the "MPL") + * http://www.mozilla.org/MPL/MPL-1.1.html + * + * == END LICENSE == + * + * Create the FCKeditorAPI object that is available as a global object in + * the page where the editor is placed in. + */ + +var FCKeditorAPI ; + +function InitializeAPI() +{ + var oParentWindow = window.parent ; + + if ( !( FCKeditorAPI = oParentWindow.FCKeditorAPI ) ) + { + // Make the FCKeditorAPI object available in the parent window. Use + // eval so this core runs in the parent's scope and so it will still be + // available if the editor instance is removed ("Can't execute code + // from a freed script" error). + + // Note: we check the existence of oEditor.GetParentForm because some external + // code (like JSON) can extend the Object prototype and we get then extra oEditor + // objects that aren't really FCKeditor instances. + var sScript = 'window.FCKeditorAPI = {' + - 'Version : "2.6.4.1",' + - 'VersionBuild : "23195",' + - 'Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},' + - - 'GetInstance : function( name )' + - '{' + - 'return this.Instances[ name ];' + - '},' + - - '_FormSubmit : function()' + - '{' + - 'for ( var name in FCKeditorAPI.Instances )' + - '{' + - 'var oEditor = FCKeditorAPI.Instances[ name ] ;' + - 'if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )' + - 'oEditor.UpdateLinkedField() ;' + - '}' + - 'this._FCKOriginalSubmit() ;' + - '},' + - - '_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {' + - 'Functions : new Array(),' + - 'IsRunning : false,' + - - 'Add : function( f )' + - '{' + - 'this.Functions.push( f );' + - 'if ( !this.IsRunning )' + - 'this.StartNext();' + - '},' + - - 'StartNext : function()' + - '{' + - 'var aQueue = this.Functions ;' + - 'if ( aQueue.length > 0 )' + - '{' + - 'this.IsRunning = true;' + - 'aQueue[0].call();' + - '}' + - 'else ' + - 'this.IsRunning = false;' + - '},' + - - 'Remove : function( f )' + - '{' + - 'var aQueue = this.Functions;' + - 'var i = 0, fFunc;' + - 'while( (fFunc = aQueue[ i ]) )' + - '{' + - 'if ( fFunc == f )' + - 'aQueue.splice( i,1 );' + - 'i++ ;' + - '}' + - 'this.StartNext();' + - '}' + - '}' + - '}' ; - - // In IE, the "eval" function is not always available (it works with - // the JavaScript samples, but not with the ASP ones, for example). - // So, let's use the execScript instead. - if ( oParentWindow.execScript ) - oParentWindow.execScript( sScript, 'JavaScript' ) ; - else - { - if ( FCKBrowserInfo.IsGecko10 ) - { - // FF 1.0.4 gives an error with the request bellow. The - // following seams to work well. - eval.call( oParentWindow, sScript ) ; - } - else if( FCKBrowserInfo.IsAIR ) - { - FCKAdobeAIR.FCKeditorAPI_Evaluate( oParentWindow, sScript ) ; - } - else if ( FCKBrowserInfo.IsSafari ) - { - // oParentWindow.eval in Safari executes in the calling window - // environment, instead of the parent one. The following should - // make it work. - var oParentDocument = oParentWindow.document ; - var eScript = oParentDocument.createElement('script') ; - eScript.appendChild( oParentDocument.createTextNode( sScript ) ) ; - oParentDocument.documentElement.appendChild( eScript ) ; - } - else - oParentWindow.eval( sScript ) ; - } - - FCKeditorAPI = oParentWindow.FCKeditorAPI ; - - // The __Instances properly has been changed to the public Instances, - // but we should still have the "deprecated" version of it. - FCKeditorAPI.__Instances = FCKeditorAPI.Instances ; - } - - // Add the current instance to the FCKeditorAPI's instances collection. - FCKeditorAPI.Instances[ FCK.Name ] = FCK ; -} - -// Attach to the form onsubmit event and to the form.submit(). -function _AttachFormSubmitToAPI() -{ - // Get the linked field form. - var oForm = FCK.GetParentForm() ; - - if ( oForm ) - { - // Attach to the onsubmit event. - FCKTools.AddEventListener( oForm, 'submit', FCK.UpdateLinkedField ) ; - - // IE sees oForm.submit function as an 'object'. - if ( !oForm._FCKOriginalSubmit && ( typeof( oForm.submit ) == 'function' || ( !oForm.submit.tagName && !oForm.submit.length ) ) ) - { - // Save the original submit. - oForm._FCKOriginalSubmit = oForm.submit ; - - // Create our replacement for the submit. - oForm.submit = FCKeditorAPI._FormSubmit ; - } - } -} - -function FCKeditorAPI_Cleanup() -{ - if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat - && !window.FCKUnloadFlag ) - return ; - delete FCKeditorAPI.Instances[ FCK.Name ] ; -} -function FCKeditorAPI_ConfirmCleanup() -{ - if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat ) - window.FCKUnloadFlag = true ; -} -FCKTools.AddEventListener( window, 'unload', FCKeditorAPI_Cleanup ) ; -FCKTools.AddEventListener( window, 'beforeunload', FCKeditorAPI_ConfirmCleanup) ; + 'Version : "2.6.4.1",' + + 'VersionBuild : "23405",' + + 'Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},' + + + 'GetInstance : function( name )' + + '{' + + 'return this.Instances[ name ];' + + '},' + + + '_FormSubmit : function()' + + '{' + + 'for ( var name in FCKeditorAPI.Instances )' + + '{' + + 'var oEditor = FCKeditorAPI.Instances[ name ] ;' + + 'if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )' + + 'oEditor.UpdateLinkedField() ;' + + '}' + + 'this._FCKOriginalSubmit() ;' + + '},' + + + '_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {' + + 'Functions : new Array(),' + + 'IsRunning : false,' + + + 'Add : function( f )' + + '{' + + 'this.Functions.push( f );' + + 'if ( !this.IsRunning )' + + 'this.StartNext();' + + '},' + + + 'StartNext : function()' + + '{' + + 'var aQueue = this.Functions ;' + + 'if ( aQueue.length > 0 )' + + '{' + + 'this.IsRunning = true;' + + 'aQueue[0].call();' + + '}' + + 'else ' + + 'this.IsRunning = false;' + + '},' + + + 'Remove : function( f )' + + '{' + + 'var aQueue = this.Functions;' + + 'var i = 0, fFunc;' + + 'while( (fFunc = aQueue[ i ]) )' + + '{' + + 'if ( fFunc == f )' + + 'aQueue.splice( i,1 );' + + 'i++ ;' + + '}' + + 'this.StartNext();' + + '}' + + '}' + + '}' ; + + // In IE, the "eval" function is not always available (it works with + // the JavaScript samples, but not with the ASP ones, for example). + // So, let's use the execScript instead. + if ( oParentWindow.execScript ) + oParentWindow.execScript( sScript, 'JavaScript' ) ; + else + { + if ( FCKBrowserInfo.IsGecko10 ) + { + // FF 1.0.4 gives an error with the request bellow. The + // following seams to work well. + eval.call( oParentWindow, sScript ) ; + } + else if( FCKBrowserInfo.IsAIR ) + { + FCKAdobeAIR.FCKeditorAPI_Evaluate( oParentWindow, sScript ) ; + } + else if ( FCKBrowserInfo.IsSafari ) + { + // oParentWindow.eval in Safari executes in the calling window + // environment, instead of the parent one. The following should + // make it work. + var oParentDocument = oParentWindow.document ; + var eScript = oParentDocument.createElement('script') ; + eScript.appendChild( oParentDocument.createTextNode( sScript ) ) ; + oParentDocument.documentElement.appendChild( eScript ) ; + } + else + oParentWindow.eval( sScript ) ; + } + + FCKeditorAPI = oParentWindow.FCKeditorAPI ; + + // The __Instances properly has been changed to the public Instances, + // but we should still have the "deprecated" version of it. + FCKeditorAPI.__Instances = FCKeditorAPI.Instances ; + } + + // Add the current instance to the FCKeditorAPI's instances collection. + FCKeditorAPI.Instances[ FCK.Name ] = FCK ; +} + +// Attach to the form onsubmit event and to the form.submit(). +function _AttachFormSubmitToAPI() +{ + // Get the linked field form. + var oForm = FCK.GetParentForm() ; + + if ( oForm ) + { + // Attach to the onsubmit event. + FCKTools.AddEventListener( oForm, 'submit', FCK.UpdateLinkedField ) ; + + // IE sees oForm.submit function as an 'object'. + if ( !oForm._FCKOriginalSubmit && ( typeof( oForm.submit ) == 'function' || ( !oForm.submit.tagName && !oForm.submit.length ) ) ) + { + // Save the original submit. + oForm._FCKOriginalSubmit = oForm.submit ; + + // Create our replacement for the submit. + oForm.submit = FCKeditorAPI._FormSubmit ; + } + } +} + +function FCKeditorAPI_Cleanup() +{ + if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat + && !window.FCKUnloadFlag ) + return ; + delete FCKeditorAPI.Instances[ FCK.Name ] ; +} +function FCKeditorAPI_ConfirmCleanup() +{ + if ( window.FCKConfig && FCKConfig.MsWebBrowserControlCompat ) + window.FCKUnloadFlag = true ; +} +FCKTools.AddEventListener( window, 'unload', FCKeditorAPI_Cleanup ) ; +FCKTools.AddEventListener( window, 'beforeunload', FCKeditorAPI_ConfirmCleanup) ; diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fck.js b/main/inc/lib/fckeditor/editor/_source/internals/fck.js index e5fd3ab16a..9f115273a3 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fck.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fck.js @@ -955,6 +955,38 @@ function _FCK_EditingArea_OnLoad() FCKTools.AddEventListener( FCK.EditorDocument, 'mousemove', _FCK_MouseEventsListener ) ; FCKTools.AddEventListener( FCK.EditorDocument, 'mousedown', _FCK_MouseEventsListener ) ; FCKTools.AddEventListener( FCK.EditorDocument, 'mouseup', _FCK_MouseEventsListener ) ; + if ( FCKBrowserInfo.IsSafari ) + { + // #3481: WebKit has a bug with paste where the paste contents may leak + // outside table cells. So add padding nodes before and after the paste. + FCKTools.AddEventListener( FCK.EditorDocument, 'paste', function( evt ) + { + var range = new FCKDomRange( FCK.EditorWindow ); + var nodeBefore = FCK.EditorDocument.createTextNode( '\ufeff' ); + var nodeAfter = FCK.EditorDocument.createElement( 'a' ); + nodeAfter.id = 'fck_paste_padding'; + nodeAfter.innerHTML = ''; + range.MoveToSelection(); + range.DeleteContents(); + + // Insert padding nodes. + range.InsertNode( nodeBefore ); + range.Collapse(); + range.InsertNode( nodeAfter ); + + // Move the selection to between the padding nodes. + range.MoveToPosition( nodeAfter, 3 ); + range.Select(); + + // Remove the padding nodes after the paste is done. + setTimeout( function() + { + nodeBefore.parentNode.removeChild( nodeBefore ); + nodeAfter = FCK.EditorDocument.getElementById( 'fck_paste_padding' ); + nodeAfter.parentNode.removeChild( nodeAfter ); + }, 0 ); + } ); + } // Most of the CTRL key combos do not work under Safari for onkeydown and onkeypress (See #1119) // But we can use the keyup event to override some of these... diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fck_gecko.js b/main/inc/lib/fckeditor/editor/_source/internals/fck_gecko.js index e36f9ad405..af85b9d577 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fck_gecko.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fck_gecko.js @@ -375,6 +375,16 @@ FCK.InsertHtml = function( html ) range = new FCKDomRange( this.EditorWindow ) ; range.MoveToSelection() ; + + // If the first element (if exists) of the document fragment is a block + // element, then split the current block. (#1537) + var currentNode = docFrag.RootNode.firstChild ; + while ( currentNode && currentNode.nodeType != 1 ) + currentNode = currentNode.nextSibling ; + + if ( currentNode && FCKListsLib.BlockElements[ currentNode.nodeName.toLowerCase() ] ) + range.SplitBlock() ; + range.DeleteContents() ; range.InsertNode( docFrag.RootNode ) ; diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fck_ie.js b/main/inc/lib/fckeditor/editor/_source/internals/fck_ie.js index 53376a5f04..5ac7fa17b3 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fck_ie.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fck_ie.js @@ -172,7 +172,12 @@ FCK.InsertHtml = function( html ) oSel.createRange().pasteHTML( html ) ; // Remove the fake node - FCK.EditorDocument.getElementById('__fakeFCKRemove__').removeNode( true ) ; + var fake = FCK.EditorDocument.getElementById('__fakeFCKRemove__') ; + // If the span is the only child of a node (so the inserted HTML is beyond that), + // remove also that parent that isn't needed. #1537 + if (fake.parentNode.childNodes.length == 1) + fake = fake.parentNode ; + fake.removeNode( true ) ; FCKDocumentProcessor.Process( FCK.EditorDocument ) ; @@ -373,22 +378,27 @@ FCK.CreateLink = function( url, noUndo ) { // Creates the array that will be returned. It contains one or more created links (see #220). var aCreatedLinks = new Array() ; + var isControl = FCKSelection.GetType() == 'Control' ; + var selectedElement = isControl && FCKSelection.GetSelectedElement() ; // Remove any existing link in the selection. - FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ; + // IE BUG: Unlinking a floating control selection that is not inside a link + // will collapse the selection. (#3677) + if ( !( isControl && !FCKTools.GetElementAscensor( selectedElement, 'a' ) ) ) + FCK.ExecuteNamedCommand( 'Unlink', null, false, !!noUndo ) ; if ( url.length > 0 ) { // If there are several images, and you try to link each one, all the images get inside the link: // -> -> due to the call to 'CreateLink' (bug in IE) - if (FCKSelection.GetType() == 'Control') + if ( isControl ) { // Create a link var oLink = this.EditorDocument.createElement( 'A' ) ; oLink.href = url ; // Get the selected object - var oControl = FCKSelection.GetSelectedElement() ; + var oControl = selectedElement ; // Put the link just before the object oControl.parentNode.insertBefore(oLink, oControl) ; // Move the object inside the link diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fckdialog.js b/main/inc/lib/fckeditor/editor/_source/internals/fckdialog.js index febc7353a9..a2d05129e6 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fckdialog.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fckdialog.js @@ -79,7 +79,7 @@ var FCKDialog = ( function() /** * Opens a dialog window using the standard dialog template. */ - OpenDialog : function( dialogName, dialogTitle, dialogPage, width, height, customValue, parentWindow, resizable ) + OpenDialog : function( dialogName, dialogTitle, dialogPage, width, height, customValue, resizable ) { if ( !topDialog ) this.DisplayMainCover() ; diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fckdomtools.js b/main/inc/lib/fckeditor/editor/_source/internals/fckdomtools.js index 7eaf3bde51..cf11075c5f 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fckdomtools.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fckdomtools.js @@ -488,18 +488,46 @@ var FCKDomTools = for ( var i = 0 ; i < attributes.length ; i++ ) { - if ( FCKBrowserInfo.IsIE && attributes[i].nodeName == 'class' ) + if ( FCKBrowserInfo.IsIE ) { - // IE has a strange bug. If calling removeAttribute('className'), - // the attributes collection will still contain the "class" - // attribute, which will be marked as "specified", even if the - // outerHTML of the element is not displaying the class attribute. - // Note : I was not able to reproduce it outside the editor, - // but I've faced it while working on the TC of #1391. - if ( element.className.length > 0 ) - return true ; + var attributeNodeName = attributes[i].nodeName ; + + if ( attributeNodeName.StartsWith( '_fck' ) ) + { + /** + * There are places in the FCKeditor code where HTML element objects + * get values stored as properties (e.g. _fckxhtmljob). In Internet + * Explorer, these are interpreted as attempts to set attributes on + * the element. + * + * http://msdn.microsoft.com/en-us/library/ms533026(VS.85).aspx#Accessing_Element_Pr + * + * Counting these as HTML attributes cripples + * FCK.Style.RemoveFromRange() once FCK.GetData() has been called. + * + * The above conditional prevents these internal properties being + * counted as attributes. + * + * refs #2156 and #2834 + */ + + continue ; + } + + if ( attributeNodeName == 'class' ) + { + // IE has a strange bug. If calling removeAttribute('className'), + // the attributes collection will still contain the "class" + // attribute, which will be marked as "specified", even if the + // outerHTML of the element is not displaying the class attribute. + // Note : I was not able to reproduce it outside the editor, + // but I've faced it while working on the TC of #1391. + if ( element.className.length > 0 ) + return true ; + continue ; + } } - else if ( attributes[i].specified ) + if ( attributes[i].specified ) return true ; } diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml.js b/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml.js index 130a3a9b9f..480a1e1913 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml.js @@ -56,6 +56,23 @@ FCKXHtml.GetXHTML = function( node, includeNode, format ) else this._AppendChildNodes( this.MainNode, node, false ) ; + /** + * FCKXHtml._AppendNode() marks DOM element objects it has + * processed by adding a property called _fckxhtmljob, + * setting it equal to the value of FCKXHtml.CurrentJobNum. + * On Internet Explorer, if an element object has such a + * property, it will show up in the object's attributes + * NamedNodeMap, and the corresponding Attr object in + * that collection will have is specified property set + * to true. This trips up code elsewhere that checks to + * see if an element is free of attributes before proceeding + * with an edit operation (c.f. FCK.Style.RemoveFromRange()) + * + * refs #2156 and #2834 + */ + if ( FCKBrowserInfo.IsIE ) + FCKXHtml._RemoveXHtmlJobProperties( node ) ; + // Get the resulting XHTML as a string. var sXHTML = this._GetMainXmlString() ; diff --git a/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml_ie.js b/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml_ie.js index 94f2ef975c..2d23eaecf6 100644 --- a/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml_ie.js +++ b/main/inc/lib/fckeditor/editor/_source/internals/fckxhtml_ie.js @@ -92,6 +92,42 @@ FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName ) } } +/** + * Used to clean up HTML that has been processed FCKXHtml._AppendNode(). + * + * For objects corresponding to HTML elements, Internet Explorer will + * treat a property as if it were an attribute set on that element. + * + * http://msdn.microsoft.com/en-us/library/ms533026(VS.85).aspx#Accessing_Element_Pr + * + * FCKXHtml._AppendNode() sets the property _fckxhtmljob on node objects + * corresponding HTML elements to mark them as having been processed. + * Counting these properties as attributes will cripple style removal + * because FCK.Styles.RemoveFromSelection() will not remove an element + * as long as it still has attributes. + * + * refs #2156 and #2834 + */ + +FCKXHtml._RemoveXHtmlJobProperties = function ( node ) +{ + // Select only nodes of type ELEMENT_NODE + if (!node || !node.nodeType || node.nodeType != 1) + return ; + + // Clear the _fckhtmljob attribute. + if ( typeof node._fckxhtmljob !== 'undefined' ) + node.removeAttribute('_fckxhtmljob') ; + + // Recurse upon child nodes. + if ( node.hasChildNodes() ) + { + var childNodes = node.childNodes ; + for ( var i = childNodes.length - 1 ; i >= 0 ; i-- ) + FCKXHtml._RemoveXHtmlJobProperties( childNodes.item(i) ) ; + } +} + // On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list) FCKXHtml.TagProcessors['div'] = function( node, htmlNode ) { diff --git a/main/inc/lib/fckeditor/editor/dialog/common/fck_dialog_common.js b/main/inc/lib/fckeditor/editor/dialog/common/fck_dialog_common.js index 0fab8aa8fa..a9e224fc5e 100644 --- a/main/inc/lib/fckeditor/editor/dialog/common/fck_dialog_common.js +++ b/main/inc/lib/fckeditor/editor/dialog/common/fck_dialog_common.js @@ -216,7 +216,7 @@ function OpenFileBrowser( url, width, height ) } else { - FCKDialog.OpenDialog( 'FCKDialog_FileManager' , FCKLang['BrowseServer'], url, width, height, '', window, true ) ; + FCKDialog.OpenDialog( 'FCKDialog_FileManager' , FCKLang['BrowseServer'], url, width, height, '', true ) ; } } diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_about.html b/main/inc/lib/fckeditor/editor/dialog/fck_about.html index 66b2fc9aa6..9f1eff1cbc 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_about.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_about.html @@ -65,6 +65,11 @@ window.onload = function() } + + +
    @@ -79,7 +84,7 @@ window.onload = function() version
    2.6.4.1
    - Build 23195 + Build 23405 diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_anchor.html b/main/inc/lib/fckeditor/editor/dialog/fck_anchor.html index 235535b4ad..2f3921b48b 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_anchor.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_anchor.html @@ -200,6 +200,11 @@ function ReadjustLinksToAnchor( sCurrent, sNew ) } + + + diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_button.html b/main/inc/lib/fckeditor/editor/dialog/fck_button.html index 6dc21b448a..21a68767cf 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_button.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_button.html @@ -68,6 +68,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_checkbox.html b/main/inc/lib/fckeditor/editor/dialog/fck_checkbox.html index 9a5d43c736..f55266ac26 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_checkbox.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_checkbox.html @@ -75,6 +75,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_colorselector.html b/main/inc/lib/fckeditor/editor/dialog/fck_colorselector.html index a6eac5ca95..7c9637e597 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_colorselector.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_colorselector.html @@ -142,6 +142,11 @@ function Ok() return true ; } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_div.html b/main/inc/lib/fckeditor/editor/dialog/fck_div.html index c5496e1fd2..cd16d1cda3 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_div.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_div.html @@ -319,6 +319,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html b/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html index e1875d74c4..d1b421f064 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_docprops.html @@ -21,11 +21,11 @@ * * Link dialog window. --> - + - - + + + + +
    @@ -458,22 +463,22 @@ function SetUrl( url ) Document Type Heading
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html b/main/inc/lib/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html index 368c839d8b..5ea9efb220 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html @@ -26,7 +26,7 @@ Document Properties - Preview - + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_form.html b/main/inc/lib/fckeditor/editor/dialog/fck_form.html index c724282ed8..1a6bdd04dd 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_form.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_form.html @@ -74,6 +74,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_hiddenfield.html b/main/inc/lib/fckeditor/editor/dialog/fck_hiddenfield.html index 2d0e0b55b5..f34f8f9ef9 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_hiddenfield.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_hiddenfield.html @@ -89,6 +89,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_image.html b/main/inc/lib/fckeditor/editor/dialog/fck_image.html index 75681bf2c0..ad03c2bd02 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_image.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_image.html @@ -33,6 +33,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_link.html b/main/inc/lib/fckeditor/editor/dialog/fck_link.html index 061c84e14b..561c72409d 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_link.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_link.html @@ -28,6 +28,11 @@ + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_paste.html b/main/inc/lib/fckeditor/editor/dialog/fck_paste.html index dc831725f1..30edf82129 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_paste.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_paste.html @@ -305,6 +305,11 @@ function CleanWord( oNode, bIgnoreFont, bRemoveStyles ) + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_radiobutton.html b/main/inc/lib/fckeditor/editor/dialog/fck_radiobutton.html index 80516e042f..d4dfdb1122 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_radiobutton.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_radiobutton.html @@ -75,6 +75,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_replace.html b/main/inc/lib/fckeditor/editor/dialog/fck_replace.html index bf983353ae..a61ed1de8f 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_replace.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_replace.html @@ -577,6 +577,11 @@ window.onunload = function() } } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_smiley.html b/main/inc/lib/fckeditor/editor/dialog/fck_smiley.html index 96c449f9c4..9323bc4827 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_smiley.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_smiley.html @@ -77,6 +77,11 @@ function out(td) td.className = 'DarkBackground Hand' ; } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_source.html b/main/inc/lib/fckeditor/editor/dialog/fck_source.html index d61e710ca2..383d467637 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_source.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_source.html @@ -57,6 +57,11 @@ function Ok() return true ; } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html b/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html index eb0238c632..05f1a85bbb 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_specialchar.html @@ -75,6 +75,11 @@ function setDefaults() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages.html b/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages.html index cd2355dee6..7ae206afc4 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages.html @@ -62,6 +62,11 @@ function oSpeller_OnFinished( numberOCorrections ) } + + + diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm b/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm deleted file mode 100644 index 27e368e8bb..0000000000 --- a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]+>", " ", "all")> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl b/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl deleted file mode 100644 index 443fa8001a..0000000000 --- a/main/inc/lib/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/perl - -use CGI qw/ :standard /; -use File::Temp qw/ tempfile tempdir /; - -# my $spellercss = '/speller/spellerStyle.css'; # by FredCK -my $spellercss = '../spellerStyle.css'; # by FredCK -# my $wordWindowSrc = '/speller/wordWindow.js'; # by FredCK -my $wordWindowSrc = '../wordWindow.js'; # by FredCK -my @textinputs = param( 'textinputs[]' ); # array -# my $aspell_cmd = 'aspell'; # by FredCK (for Linux) -my $aspell_cmd = '"C:\Program Files\Aspell\bin\aspell.exe"'; # by FredCK (for Windows) -my $lang = 'en_US'; -# my $aspell_opts = "-a --lang=$lang --encoding=utf-8"; # by FredCK -my $aspell_opts = "-a --lang=$lang --encoding=utf-8 -H --rem-sgml-check=alt"; # by FredCK -my $input_separator = "A"; - -# set the 'wordtext' JavaScript variable to the submitted text. -sub printTextVar { - for( my $i = 0; $i <= $#textinputs; $i++ ) { - print "textinputs[$i] = decodeURIComponent('" . escapeQuote( $textinputs[$i] ) . "')\n"; - } -} - -sub printTextIdxDecl { - my $idx = shift; - print "words[$idx] = [];\n"; - print "suggs[$idx] = [];\n"; -} - -sub printWordsElem { - my( $textIdx, $wordIdx, $word ) = @_; - print "words[$textIdx][$wordIdx] = '" . escapeQuote( $word ) . "';\n"; -} - -sub printSuggsElem { - my( $textIdx, $wordIdx, @suggs ) = @_; - print "suggs[$textIdx][$wordIdx] = ["; - for my $i ( 0..$#suggs ) { - print "'" . escapeQuote( $suggs[$i] ) . "'"; - if( $i < $#suggs ) { - print ", "; - } - } - print "];\n"; -} - -sub printCheckerResults { - my $textInputIdx = -1; - my $wordIdx = 0; - my $unhandledText; - # create temp file - my $dir = tempdir( CLEANUP => 1 ); - my( $fh, $tmpfilename ) = tempfile( DIR => $dir ); - - # temp file was created properly? - - # open temp file, add the submitted text. - for( my $i = 0; $i <= $#textinputs; $i++ ) { - $text = url_decode( $textinputs[$i] ); - # Strip all tags for the text. (by FredCK - #339 / #681) - $text =~ s/<[^>]+>/ /g; - @lines = split( /\n/, $text ); - print $fh "\%\n"; # exit terse mode - print $fh "^$input_separator\n"; - print $fh "!\n"; # enter terse mode - for my $line ( @lines ) { - # use carat on each line to escape possible aspell commands - print $fh "^$line\n"; - } - - } - # exec aspell command - my $cmd = "$aspell_cmd $aspell_opts < $tmpfilename 2>&1"; - open ASPELL, "$cmd |" or handleError( "Could not execute `$cmd`\\n$!" ) and return; - # parse each line of aspell return - for my $ret ( ) { - chomp( $ret ); - # if '&', then not in dictionary but has suggestions - # if '#', then not in dictionary and no suggestions - # if '*', then it is a delimiter between text inputs - if( $ret =~ /^\*/ ) { - $textInputIdx++; - printTextIdxDecl( $textInputIdx ); - $wordIdx = 0; - - } elsif( $ret =~ /^(&|#)/ ) { - my @tokens = split( " ", $ret, 5 ); - printWordsElem( $textInputIdx, $wordIdx, $tokens[1] ); - my @suggs = (); - if( $tokens[4] ) { - @suggs = split( ", ", $tokens[4] ); - } - printSuggsElem( $textInputIdx, $wordIdx, @suggs ); - $wordIdx++; - } else { - $unhandledText .= $ret; - } - } - close ASPELL or handleError( "Error executing `$cmd`\\n$unhandledText" ) and return; -} - -sub escapeQuote { - my $str = shift; - $str =~ s/'/\\'/g; - return $str; -} - -sub handleError { - my $err = shift; - print "error = '" . escapeQuote( $err ) . "';\n"; -} - -sub url_decode { - local $_ = @_ ? shift : $_; - defined or return; - # change + signs to spaces - tr/+/ /; - # change hex escapes to the proper characters - s/%([a-fA-F0-9]{2})/pack "H2", $1/eg; - return $_; -} - -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # -# Display HTML -# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # - -print < - - - - - - - - - - - - - -EOF diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_table.html b/main/inc/lib/fckeditor/editor/dialog/fck_table.html index 053d0423b0..4763f3b824 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_table.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_table.html @@ -155,28 +155,6 @@ function Ok() SetAttribute( table, 'cellSpacing' , GetE('txtCellSpacing').value ) ; SetAttribute( table, 'summary' , GetE('txtSummary').value ) ; - var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ; - - if ( document.getElementById('txtCaption').value != '') - { - if ( !eCaption ) - { - eCaption = oDoc.createElement( 'CAPTION' ) ; - table.insertBefore( eCaption, table.firstChild ) ; - } - - eCaption.innerHTML = document.getElementById('txtCaption').value ; - } - else if ( bExists && eCaption ) - { - // TODO: It causes an IE internal error if using removeChild or - // table.deleteCaption() (see #505). - if ( oEditor.FCKBrowserInfo.IsIE ) - eCaption.innerHTML = '' ; - else - eCaption.parentNode.removeChild( eCaption ) ; - } - var headers = GetE('selHeaders').value ; if ( bExists ) { @@ -307,10 +285,37 @@ function Ok() oEditor.FCK.InsertElement( table ) ; } + var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ; + + if ( document.getElementById('txtCaption').value != '' ) + { + if ( !eCaption ) + { + eCaption = oDoc.createElement( 'CAPTION' ) ; + table.insertBefore( eCaption, table.firstChild ) ; + } + + eCaption.innerHTML = document.getElementById('txtCaption').value ; + } + else if ( bExists && eCaption ) + { + // TODO: It causes an IE internal error if using removeChild or + // table.deleteCaption() (see #505). + if ( oEditor.FCKBrowserInfo.IsIE ) + eCaption.innerHTML = '' ; + else + eCaption.parentNode.removeChild( eCaption ) ; + } + return true ; } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html b/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html index ce882d3b9b..ec73d8c0ab 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_tablecell.html @@ -139,10 +139,15 @@ function SelectBorderColor( color ) function SelectColor( wich ) { - oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ; + oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, wich == 'Back' ? SelectBackColor : SelectBorderColor ) ; } + + +
    @@ -224,8 +229,8 @@ function SelectColor( wich ) Cell Type: diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_template.html b/main/inc/lib/fckeditor/editor/dialog/fck_template.html index 90e96967fd..b7eea90f13 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_template.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_template.html @@ -208,6 +208,11 @@ function SelectTemplate( index ) } + + +
     
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_textarea.html b/main/inc/lib/fckeditor/editor/dialog/fck_textarea.html index e4edae9664..051b2c9d0f 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_textarea.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_textarea.html @@ -69,6 +69,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/dialog/fck_textfield.html b/main/inc/lib/fckeditor/editor/dialog/fck_textfield.html index efde66daee..8368f63990 100644 --- a/main/inc/lib/fckeditor/editor/dialog/fck_textfield.html +++ b/main/inc/lib/fckeditor/editor/dialog/fck_textfield.html @@ -85,6 +85,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/filemanager/browser/default/browser.css b/main/inc/lib/fckeditor/editor/filemanager/browser/default/browser.css index 982ddd9ff0..b3243859b1 100644 --- a/main/inc/lib/fckeditor/editor/filemanager/browser/default/browser.css +++ b/main/inc/lib/fckeditor/editor/filemanager/browser/default/browser.css @@ -86,3 +86,5 @@ body, td, input, select .fullHeight { height: 100%; } + +body, td, input, textarea, select, label { font-family: Arial, Verdana, Geneva, helvetica, sans-serif; font-size: 11px; } diff --git a/main/inc/lib/fckeditor/editor/filemanager/browser/default/frmresourceslist.html b/main/inc/lib/fckeditor/editor/filemanager/browser/default/frmresourceslist.html index c8977e0cde..233a3a4bd7 100644 --- a/main/inc/lib/fckeditor/editor/filemanager/browser/default/frmresourceslist.html +++ b/main/inc/lib/fckeditor/editor/filemanager/browser/default/frmresourceslist.html @@ -94,14 +94,14 @@ function OpenFile( fileUrl ) if ( window.parent.opener ) { // The file manager has been opened in a new window. - window.parent.opener.SetUrl( encodeURI( fileUrl ).replace( /#/g, '%23' ) ) ; + window.parent.opener.SetUrl( fileUrl ) ; window.parent.close() ; window.parent.opener.focus() ; } else if ( window.parent.parent && typeof (window.parent.parent.ParentDialog) == 'function' ) { // The file manager is inside a dialog. - window.parent.parent.ParentDialog().contentWindow.frames['frmMain'].SetUrl( encodeURI( fileUrl ).replace( /#/g, '%23' ) ) ; + window.parent.parent.ParentDialog().contentWindow.frames['frmMain'].SetUrl( fileUrl ) ; window.parent.parent.CloseDialog() ; } return true ; @@ -163,7 +163,7 @@ function GetFoldersAndFilesCallBack( fckXml ) // Get the optional "url" attribute. If not available, build the url. var oFileUrlAtt = oNodes[j].attributes.getNamedItem('url') ; - var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : sCurrentFolderUrl + sFileName ; + var sFileUrl = oFileUrlAtt != null ? oFileUrlAtt.value : encodeURI( sCurrentFolderUrl + sFileName ).replace( /#/g, '%23' ) ; oHtml.Append( oListManager.GetFileRowHtml( sFileName, sFileUrl, sFileSize ) ) ; } diff --git a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/basexml.php b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/basexml.php index 268d388a4b..e8ae37bad7 100644 --- a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/basexml.php +++ b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/basexml.php @@ -65,8 +65,8 @@ function CreateXmlFooter() function SendError( $number, $text ) { - if ( $_GET['Command'] == 'FileUpload' ) - SendUploadResults( $number, "", "", $text ) ; + if ( $_GET['Command'] == 'FileUpload' ) + SendUploadResults( $number, "", "", $text ) ; if ( isset( $GLOBALS['HeaderSent'] ) && $GLOBALS['HeaderSent'] ) { @@ -94,6 +94,6 @@ function SendErrorNode( $number, $text ) if ($text) echo '' ; else - echo '' ; + echo '' ; } ?> diff --git a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php index dd1e20b8f9..7791104c0c 100644 --- a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php +++ b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/commands.php @@ -94,6 +94,7 @@ function GetFoldersAndFiles( $resourceType, $currentFolder ) && ( $in_group || ( !$in_group && strpos( $sFile, '_groupdocs' ) === false ) ) && (!$in_shared_folder || ($in_shared_folder && (!$is_dir || ($is_dir && $sFile == $user_id)))) && $sFile != '.thumbs' + && strpos( $sFile, '.editor_' ) === false && $sFile != '.svn' ) { if ( $is_dir ) diff --git a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/upload.php b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/upload.php index 7e330b3c39..8a4343d4bf 100755 --- a/main/inc/lib/fckeditor/editor/filemanager/connectors/php/upload.php +++ b/main/inc/lib/fckeditor/editor/filemanager/connectors/php/upload.php @@ -1,4 +1,4 @@ -'+A+'';if (!FCKRegexLib.HtmlOpener.test(A)) A=''+A+'';if (!FCKRegexLib.HeadOpener.test(A)) A=A.replace(FCKRegexLib.HtmlOpener,'$&');return A;}else{var B=FCKConfig.DocType+'0&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='>'+A+'';return B;}},ConvertToDataFormat:function(A,B,C,D){var E=FCKXHtml.GetXHTML(A,!B,D);if (C&&FCKRegexLib.EmptyOutParagraph.test(E)) return '';return E;},FixHtml:function(A){return A;}}; -var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,DataProcessor:new FCKDataProcessor(),GetInstanceObject:(function(){var w=window;return function(name){return w[name];}})(),AttachToOnSelectionChange:function(A){this.Events.AttachEvent('OnSelectionChange',A);},GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){if (this.EditMode==1) return (this.StartupValue!=this.EditingArea.Textarea.value);else{if (!this.EditorDocument) return false;return (this.StartupValue!=this.EditorDocument.body.innerHTML);}},ResetIsDirty:function(){if (this.EditMode==1) this.StartupValue=this.EditingArea.Textarea.value;else if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i '+this.Elements[i].outerHTML+'';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i40) return;};var C=function(H){if (H.nodeType!=1) return false;var D=H.tagName.toLowerCase();return (FCKListsLib.BlockElements[D]||FCKListsLib.EmptyElements[D]);};var E=function(){var F=FCKSelection.GetSelection();var G=F.getRangeAt(0);if (!G||!G.collapsed) return;var H=G.endContainer;if (H.nodeType!=3) return;if (H.nodeValue.length!=G.endOffset) return;var I=H.parentNode.tagName.toLowerCase();if (!(I=='a'||(!FCKBrowserInfo.IsOpera&&String(H.parentNode.contentEditable)=='false')||(!(FCKListsLib.BlockElements[I]||FCKListsLib.NonEmptyBlockElements[I])&&B==35))) return;var J=FCKTools.GetNextTextNode(H,H.parentNode,C);if (J) return;G=FCK.EditorDocument.createRange();J=FCKTools.GetNextTextNode(H,H.parentNode.parentNode,C);if (J){if (FCKBrowserInfo.IsOpera&&B==37) return;G.setStart(J,0);G.setEnd(J,0);}else{while (H.parentNode&&H.parentNode!=FCK.EditorDocument.body&&H.parentNode!=FCK.EditorDocument.documentElement&&H==H.parentNode.lastChild&&(!FCKListsLib.BlockElements[H.parentNode.tagName.toLowerCase()]&&!FCKListsLib.NonEmptyBlockElements[H.parentNode.tagName.toLowerCase()])) H=H.parentNode;if (FCKListsLib.BlockElements[I]||FCKListsLib.EmptyElements[I]||H==FCK.EditorDocument.body){G.setStart(H,H.childNodes.length);G.setEnd(H,H.childNodes.length);}else{var K=H.nextSibling;while (K){if (K.nodeType!=1){K=K.nextSibling;continue;};var L=K.tagName.toLowerCase();if (FCKListsLib.BlockElements[L]||FCKListsLib.EmptyElements[L]||FCKListsLib.NonEmptyBlockElements[L]) break;K=K.nextSibling;};var M=FCK.EditorDocument.createTextNode('');if (K) H.parentNode.insertBefore(M,K);else H.parentNode.appendChild(M);G.setStart(M,0);G.setEnd(M,0);}};F.removeAllRanges();F.addRange(G);FCK.Events.FireEvent("OnSelectionChange");};setTimeout(E,1);};this.ExecOnSelectionChangeTimer=function(){if (FCK.LastOnChangeTimer) window.clearTimeout(FCK.LastOnChangeTimer);FCK.LastOnChangeTimer=window.setTimeout(FCK.ExecOnSelectionChange,100);};this.EditorDocument.addEventListener('mouseup',this.ExecOnSelectionChange,false);this.EditorDocument.addEventListener('keyup',this.ExecOnSelectionChangeTimer,false);this._DblClickListener=function(e){FCK.OnDoubleClick(e.target);e.stopPropagation();};this.EditorDocument.addEventListener('dblclick',this._DblClickListener,true);this.EditorDocument.addEventListener('keydown',this._KeyDownListener,false);if (FCKBrowserInfo.IsGecko){this.EditorWindow.addEventListener('dragdrop',this._ExecDrop,true);}else if (FCKBrowserInfo.IsSafari){this.EditorDocument.addEventListener('dragover',function (evt){ if (!FCK.MouseDownFlag&&FCK.Config.ForcePasteAsPlainText) evt.returnValue=false;},true);this.EditorDocument.addEventListener('drop',this._ExecDrop,true);this.EditorDocument.addEventListener('mousedown',function(ev){var N=ev.srcElement;if (N.nodeName.IEquals('IMG','HR','INPUT','TEXTAREA','SELECT')){FCKSelection.SelectNode(N);}},true);this.EditorDocument.addEventListener('mouseup',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);this.EditorDocument.addEventListener('click',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);};if (FCKBrowserInfo.IsGecko||FCKBrowserInfo.IsOpera){this.EditorDocument.addEventListener('keypress',this._ExecCheckCaret,false);this.EditorDocument.addEventListener('click',this._ExecCheckCaret,false);};FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow(FCK.EditorWindow);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument);};FCK.MakeEditable=function(){this.EditingArea.MakeEditable();};function Document_OnContextMenu(e){if (!e.target._FCKShowContextMenu) e.preventDefault();};document.oncontextmenu=Document_OnContextMenu;FCK._BaseGetNamedCommandState=FCK.GetNamedCommandState;FCK.GetNamedCommandState=function(A){switch (A){case 'Unlink':return FCKSelection.HasAncestorNode('A')?0:-1;default:return FCK._BaseGetNamedCommandState(A);}};FCK.RedirectNamedCommands={Print:true,Paste:true};FCK.ExecuteRedirectedNamedCommand=function(A,B){switch (A){case 'Print':FCK.EditorWindow.print();break;case 'Paste':try{if (FCKBrowserInfo.IsSafari) throw '';if (FCK.Paste()) FCK.ExecuteNamedCommand('Paste',null,true);}catch (e) {if (FCKConfig.ForcePasteAsPlainText) FCK.PasteAsPlainText();else FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security');};break;default:FCK.ExecuteNamedCommand(A,B);}};FCK._ExecPaste=function(){FCKUndo.SaveUndoStep();if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};return true;};FCK.InsertHtml=function(A){var B=FCK.EditorDocument,range;A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGecko){A=A.replace(/ $/,'$&');var C=new FCKDocumentFragment(this.EditorDocument);C.AppendHtml(A);var D=C.RootNode.lastChild;range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();range.DeleteContents();range.InsertNode(C.RootNode);range.MoveToPosition(D,4);}else B.execCommand('inserthtml',false,A);this.Focus();if (!range){range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();};var E=range.CreateBookmark();FCKDocumentProcessor.Process(B);try{range.MoveToBookmark(E);range.Select();}catch (e) {};this.Events.FireEvent("OnSelectionChange");};FCK.PasteAsPlainText=function(){FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText']);};FCK.GetClipboardHTML=function(){return '';};FCK.CreateLink=function(A,B){var C=[];if (FCKSelection.GetSelection().isCollapsed) return C;FCK.ExecuteNamedCommand('Unlink',null,false,!!B);if (A.length>0){var D='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',D,false,!!B);var E=this.EditorDocument.evaluate("//a[@href='"+D+"']",this.EditorDocument.body,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for (var i=0;i0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){FCKTools.AddEventListener(FCK.EditorDocument,'paste',function(evt){var A=new FCKDomRange(FCK.EditorWindow);var B=FCK.EditorDocument.createTextNode('\ufeff');var C=FCK.EditorDocument.createElement('a');C.id='fck_paste_padding';C.innerHTML='';A.MoveToSelection();A.DeleteContents();A.InsertNode(B);A.Collapse();A.InsertNode(C);A.MoveToPosition(C,3);A.Select();setTimeout(function(){B.parentNode.removeChild(B);C=FCK.EditorDocument.getElementById('fck_paste_padding');C.parentNode.removeChild(C);},0);});};if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i '+this.Elements[i].outerHTML+'';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i40) return;};var C=function(H){if (H.nodeType!=1) return false;var D=H.tagName.toLowerCase();return (FCKListsLib.BlockElements[D]||FCKListsLib.EmptyElements[D]);};var E=function(){var F=FCKSelection.GetSelection();var G=F.getRangeAt(0);if (!G||!G.collapsed) return;var H=G.endContainer;if (H.nodeType!=3) return;if (H.nodeValue.length!=G.endOffset) return;var I=H.parentNode.tagName.toLowerCase();if (!(I=='a'||(!FCKBrowserInfo.IsOpera&&String(H.parentNode.contentEditable)=='false')||(!(FCKListsLib.BlockElements[I]||FCKListsLib.NonEmptyBlockElements[I])&&B==35))) return;var J=FCKTools.GetNextTextNode(H,H.parentNode,C);if (J) return;G=FCK.EditorDocument.createRange();J=FCKTools.GetNextTextNode(H,H.parentNode.parentNode,C);if (J){if (FCKBrowserInfo.IsOpera&&B==37) return;G.setStart(J,0);G.setEnd(J,0);}else{while (H.parentNode&&H.parentNode!=FCK.EditorDocument.body&&H.parentNode!=FCK.EditorDocument.documentElement&&H==H.parentNode.lastChild&&(!FCKListsLib.BlockElements[H.parentNode.tagName.toLowerCase()]&&!FCKListsLib.NonEmptyBlockElements[H.parentNode.tagName.toLowerCase()])) H=H.parentNode;if (FCKListsLib.BlockElements[I]||FCKListsLib.EmptyElements[I]||H==FCK.EditorDocument.body){G.setStart(H,H.childNodes.length);G.setEnd(H,H.childNodes.length);}else{var K=H.nextSibling;while (K){if (K.nodeType!=1){K=K.nextSibling;continue;};var L=K.tagName.toLowerCase();if (FCKListsLib.BlockElements[L]||FCKListsLib.EmptyElements[L]||FCKListsLib.NonEmptyBlockElements[L]) break;K=K.nextSibling;};var M=FCK.EditorDocument.createTextNode('');if (K) H.parentNode.insertBefore(M,K);else H.parentNode.appendChild(M);G.setStart(M,0);G.setEnd(M,0);}};F.removeAllRanges();F.addRange(G);FCK.Events.FireEvent("OnSelectionChange");};setTimeout(E,1);};this.ExecOnSelectionChangeTimer=function(){if (FCK.LastOnChangeTimer) window.clearTimeout(FCK.LastOnChangeTimer);FCK.LastOnChangeTimer=window.setTimeout(FCK.ExecOnSelectionChange,100);};this.EditorDocument.addEventListener('mouseup',this.ExecOnSelectionChange,false);this.EditorDocument.addEventListener('keyup',this.ExecOnSelectionChangeTimer,false);this._DblClickListener=function(e){FCK.OnDoubleClick(e.target);e.stopPropagation();};this.EditorDocument.addEventListener('dblclick',this._DblClickListener,true);this.EditorDocument.addEventListener('keydown',this._KeyDownListener,false);if (FCKBrowserInfo.IsGecko){this.EditorWindow.addEventListener('dragdrop',this._ExecDrop,true);}else if (FCKBrowserInfo.IsSafari){this.EditorDocument.addEventListener('dragover',function (evt){ if (!FCK.MouseDownFlag&&FCK.Config.ForcePasteAsPlainText) evt.returnValue=false;},true);this.EditorDocument.addEventListener('drop',this._ExecDrop,true);this.EditorDocument.addEventListener('mousedown',function(ev){var N=ev.srcElement;if (N.nodeName.IEquals('IMG','HR','INPUT','TEXTAREA','SELECT')){FCKSelection.SelectNode(N);}},true);this.EditorDocument.addEventListener('mouseup',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);this.EditorDocument.addEventListener('click',function(ev){if (ev.srcElement.nodeName.IEquals('INPUT','TEXTAREA','SELECT')) ev.preventDefault()},true);};if (FCKBrowserInfo.IsGecko||FCKBrowserInfo.IsOpera){this.EditorDocument.addEventListener('keypress',this._ExecCheckCaret,false);this.EditorDocument.addEventListener('click',this._ExecCheckCaret,false);};FCK.ContextMenu._InnerContextMenu.SetMouseClickWindow(FCK.EditorWindow);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument);};FCK.MakeEditable=function(){this.EditingArea.MakeEditable();};function Document_OnContextMenu(e){if (!e.target._FCKShowContextMenu) e.preventDefault();};document.oncontextmenu=Document_OnContextMenu;FCK._BaseGetNamedCommandState=FCK.GetNamedCommandState;FCK.GetNamedCommandState=function(A){switch (A){case 'Unlink':return FCKSelection.HasAncestorNode('A')?0:-1;default:return FCK._BaseGetNamedCommandState(A);}};FCK.RedirectNamedCommands={Print:true,Paste:true};FCK.ExecuteRedirectedNamedCommand=function(A,B){switch (A){case 'Print':FCK.EditorWindow.print();break;case 'Paste':try{if (FCKBrowserInfo.IsSafari) throw '';if (FCK.Paste()) FCK.ExecuteNamedCommand('Paste',null,true);}catch (e) {if (FCKConfig.ForcePasteAsPlainText) FCK.PasteAsPlainText();else FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security');};break;default:FCK.ExecuteNamedCommand(A,B);}};FCK._ExecPaste=function(){FCKUndo.SaveUndoStep();if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};return true;};FCK.InsertHtml=function(A){var B=FCK.EditorDocument,range;A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGecko){A=A.replace(/ $/,'$&');var C=new FCKDocumentFragment(this.EditorDocument);C.AppendHtml(A);var D=C.RootNode.lastChild;range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();var E=C.RootNode.firstChild;while (E&&E.nodeType!=1) E=E.nextSibling;if (E&&FCKListsLib.BlockElements[E.nodeName.toLowerCase()]) range.SplitBlock();range.DeleteContents();range.InsertNode(C.RootNode);range.MoveToPosition(D,4);}else B.execCommand('inserthtml',false,A);this.Focus();if (!range){range=new FCKDomRange(this.EditorWindow);range.MoveToSelection();};var E=range.CreateBookmark();FCKDocumentProcessor.Process(B);try{range.MoveToBookmark(E);range.Select();}catch (e) {};this.Events.FireEvent("OnSelectionChange");};FCK.PasteAsPlainText=function(){FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText']);};FCK.GetClipboardHTML=function(){return '';};FCK.CreateLink=function(A,B){var C=[];if (FCKSelection.GetSelection().isCollapsed) return C;FCK.ExecuteNamedCommand('Unlink',null,false,!!B);if (A.length>0){var D='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',D,false,!!B);var E=this.EditorDocument.evaluate("//a[@href='"+D+"']",this.EditorDocument.body,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for (var i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseFloat(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) { }};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.push([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.push(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; var FCKDebug={Output:function(){},OutputObject:function(){}}; -var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;}else if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;continue;}};if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E'+styleDef+'';};var C=function(cssFileUrl,markTemp){if (cssFileUrl.length==0) return '';var B=markTemp?' _fcktemp="true"':'';return '';};return function(cssFileOrArrayOrDef,markTemp){if (!cssFileOrArrayOrDef) return '';if (typeof(cssFileOrArrayOrDef)=='string'){if (/[\\\/\.][^{}]*$/.test(cssFileOrArrayOrDef)){return this.GetStyleHtml(cssFileOrArrayOrDef.split(','),markTemp);}else return A(this._GetUrlFixedCss(cssFileOrArrayOrDef),markTemp);}else{var E='';for (var i=0;i/g,'>');return A;};FCKTools.HTMLDecode=function(A){if (!A) return '';A=A.replace(/>/g,'>');A=A.replace(/</g,'<');A=A.replace(/&/g,'&');return A;};FCKTools._ProcessLineBreaksForPMode=function(A,B,C,D,E){var F=0;var G="

    ";var H="

    ";var I="
    ";if (C){G="
  • ";H="
  • ";F=1;}while (D&&D!=A.FCK.EditorDocument.body){if (D.tagName.toLowerCase()=='p'){F=1;break;};D=D.parentNode;};for (var i=0;i0) return A[A.length-1];return null;};FCKTools.GetDocumentPosition=function(w,A){var x=0;var y=0;var B=A;var C=null;var D=FCKTools.GetElementWindow(B);while (B&&!(D==w&&(B==w.document.body||B==w.document.documentElement))){x+=B.offsetLeft-B.scrollLeft;y+=B.offsetTop-B.scrollTop;if (!FCKBrowserInfo.IsOpera){var E=C;while (E&&E!=B){x-=E.scrollLeft;y-=E.scrollTop;E=E.parentNode;}};C=B;if (B.offsetParent) B=B.offsetParent;else{if (D!=w){B=D.frameElement;C=null;if (B) D=B.contentWindow.parent;}else B=null;}};if (FCKDomTools.GetCurrentElementStyle(w.document.body,'position')!='static'||(FCKBrowserInfo.IsIE&&FCKDomTools.GetPositionedAncestor(A)==null)){x+=w.document.body.offsetLeft;y+=w.document.body.offsetTop;};return { "x":x,"y":y };};FCKTools.GetWindowPosition=function(w,A){var B=this.GetDocumentPosition(w,A);var C=FCKTools.GetScrollPosition(w);B.x-=C.X;B.y-=C.Y;return B;};FCKTools.ProtectFormStyles=function(A){if (!A||A.nodeType!=1||A.tagName.toLowerCase()!='form') return [];var B=[];var C=['style','className'];for (var i=0;i0){for (var i=B.length-1;i>=0;i--){var C=B[i][0];var D=B[i][1];if (D) A.insertBefore(C,D);else A.appendChild(C);}}};FCKTools.GetNextNode=function(A,B){if (A.firstChild) return A.firstChild;else if (A.nextSibling) return A.nextSibling;else{var C=A.parentNode;while (C){if (C==B) return null;if (C.nextSibling) return C.nextSibling;else C=C.parentNode;}};return null;};FCKTools.GetNextTextNode=function(A,B,C){node=this.GetNextNode(A,B);if (C&&node&&C(node)) return null;while (node&&node.nodeType!=3){node=this.GetNextNode(node,B);if (C&&node&&C(node)) return null;};return node;};FCKTools.Merge=function(){var A=arguments;var o=A[0];for (var i=1;i');document.domain = '"+FCK_RUNTIME_DOMAIN+"';document.close();}() ) ;";if (FCKBrowserInfo.IsIE){if (FCKBrowserInfo.IsIE7||!FCKBrowserInfo.IsIE6) return "";else return "javascript: '';";};return "javascript: void(0);";};FCKTools.ResetStyles=function(A){A.style.cssText='margin:0;padding:0;border:0;background-color:transparent;background-image:none;';}; -FCKTools.CancelEvent=function(e){if (e) e.preventDefault();};FCKTools.DisableSelection=function(A){if (FCKBrowserInfo.IsGecko) A.style.MozUserSelect='none';else if (FCKBrowserInfo.IsSafari) A.style.KhtmlUserSelect='none';else A.style.userSelect='none';};FCKTools._AppendStyleSheet=function(A,B){var e=A.createElement('LINK');e.rel='stylesheet';e.type='text/css';e.href=B;A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var e=A.createElement("STYLE");e.appendChild(A.createTextNode(B));A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.ClearElementAttributes=function(A){for (var i=0;i0) B[B.length]=D;C(parent.childNodes[i]);}};C(A);return B;};FCKTools.RemoveOuterTags=function(e){var A=e.ownerDocument.createDocumentFragment();for (var i=0;i','text/xml');FCKDomTools.RemoveNode(B.firstChild);return B;};return null;};FCKTools.GetScrollPosition=function(A){return { X:A.pageXOffset,Y:A.pageYOffset };};FCKTools.AddEventListener=function(A,B,C){A.addEventListener(B,C,false);};FCKTools.RemoveEventListener=function(A,B,C){A.removeEventListener(B,C,false);};FCKTools.AddEventListenerEx=function(A,B,C,D){A.addEventListener(B,function(e){C.apply(A,[e].concat(D||[]));},false);};FCKTools.GetViewPaneSize=function(A){return { Width:A.innerWidth,Height:A.innerHeight };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.getAttribute('style');if (D&&D.length>0){C.Inline=D;A.setAttribute('style','',0);};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';if (B.Inline) A.setAttribute('style',B.Inline,0);else A.removeAttribute('style',0);FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=function(id){return A.document.getElementById(id);};};FCKTools.AppendElement=function(A,B){return A.appendChild(A.ownerDocument.createElement(B));};FCKTools.GetElementPosition=function(A,B){var c={ X:0,Y:0 };var C=B||window;var D=FCKTools.GetElementWindow(A);var E=null;while (A){var F=D.getComputedStyle(A,'').position;if (F&&F!='static'&&A.style.zIndex!=FCKConfig.FloatingPanelsZIndex) break;c.X+=A.offsetLeft-A.scrollLeft;c.Y+=A.offsetTop-A.scrollTop;if (!FCKBrowserInfo.IsOpera){var G=E;while (G&&G!=A){c.X-=G.scrollLeft;c.Y-=G.scrollTop;G=G.parentNode;}};E=A;if (A.offsetParent) A=A.offsetParent;else{if (D!=C){A=D.frameElement;E=null;if (A) D=FCKTools.GetElementWindow(A);}else{c.X+=A.scrollLeft;c.Y+=A.scrollTop;break;}}};return c;}; -var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23195",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); +FCKTools.CancelEvent=function(e){if (e) e.preventDefault();};FCKTools.DisableSelection=function(A){if (FCKBrowserInfo.IsGecko) A.style.MozUserSelect='none';else if (FCKBrowserInfo.IsSafari) A.style.KhtmlUserSelect='none';else A.style.userSelect='none';};FCKTools._AppendStyleSheet=function(A,B){var e=A.createElement('LINK');e.rel='stylesheet';e.type='text/css';e.href=B;A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var e=A.createElement("STYLE");e.appendChild(A.createTextNode(B));A.getElementsByTagName("HEAD")[0].appendChild(e);return e;};FCKTools.ClearElementAttributes=function(A){for (var i=0;i0) B[B.length]=D;C(parent.childNodes[i]);}};C(A);return B;};FCKTools.RemoveOuterTags=function(e){var A=e.ownerDocument.createDocumentFragment();for (var i=0;i','text/xml');FCKDomTools.RemoveNode(B.firstChild);return B;};return null;};FCKTools.GetScrollPosition=function(A){return { X:A.pageXOffset,Y:A.pageYOffset };};FCKTools.AddEventListener=function(A,B,C){A.addEventListener(B,C,false);};FCKTools.RemoveEventListener=function(A,B,C){A.removeEventListener(B,C,false);};FCKTools.AddEventListenerEx=function(A,B,C,D){A.addEventListener(B,function(e){C.apply(A,[e].concat(D||[]));},false);};FCKTools.GetViewPaneSize=function(A){return { Width:A.innerWidth,Height:A.innerHeight };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.getAttribute('style');if (D&&D.length>0){C.Inline=D;A.setAttribute('style','',0);};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';if (B.Inline) A.setAttribute('style',B.Inline,0);else A.removeAttribute('style',0);FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=function(id){return A.document.getElementById(id);};};FCKTools.AppendElement=function(A,B){return A.appendChild(A.ownerDocument.createElement(B));};FCKTools.GetElementPosition=function(A,B){var c={ X:0,Y:0 };var C=B||window;var D=FCKTools.GetElementWindow(A);var E=null;while (A){var F=D.getComputedStyle(A,'').position;if (F&&F!='static'&&A.style.zIndex!=FCKConfig.FloatingPanelsZIndex) break;c.X+=A.offsetLeft-A.scrollLeft;c.Y+=A.offsetTop-A.scrollTop;if (!FCKBrowserInfo.IsOpera){var G=E;while (G&&G!=A){c.X-=G.scrollLeft;c.Y-=G.scrollTop;G=G.parentNode;}};E=A;if (A.offsetParent) A=A.offsetParent;else{if (D!=C){A=D.frameElement;E=null;if (A) D=FCKTools.GetElementWindow(A);}else{c.X+=A.scrollLeft;c.Y+=A.scrollTop;break;}}};return c;}; +var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23405",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); var FCKImagePreloader=function(){this._Images=[];};FCKImagePreloader.prototype={AddImages:function(A){if (typeof(A)=='string') A=A.split(';');this._Images=this._Images.concat(A);},Start:function(){var A=this._Images;this._PreloadCount=A.length;for (var i=0;i]*\>)/i,AfterBody:/(\<\/body\>[\s\S]*$)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/]/i,HtmlOpener:/]*>/i,HeadOpener:/]*>/i,HeadCloser:/<\/head\s*>/i,FCK_Class:/\s*FCK__[^ ]*(?=\s+|$)/,ElementName:/(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>\s*(<\/\1>)?$/,EmptyOutParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*| | )(<\/\1>)?$/,TagBody:/>]+))/gi,ProtectUrlsA:/]+))/gi,ProtectUrlsArea:/]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/]*>/i,HtmlDocType:/DTD HTML/,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g,StyleProperties:/\S+\s*:/g,InvalidSelfCloseTags:/(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi,StyleVariableAttName:/#\(\s*("|')(.+?)\1[^\)]*\s*\)/g,RegExp:/^\/(.*)\/([gim]*)$/,HtmlTag:/<[^\s<>](?:"[^"]*"|'[^']*'|[^<])*>/}; var FCKListsLib={BlockElements:{ address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },InlineNonEmptyElements:{ a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },EmptyElements:{ base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },PathBlockElements:{ address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },PathBlockLimitElements:{ body:1,div:1,td:1,th:1,caption:1,form:1 },StyleBlockElements:{ address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },StyleObjectElements:{ img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },NonEditableElements:{ button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },BlockBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },ListBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }}; var FCKLanguageManager=FCK.Language={AvailableLanguages:{af:'Afrikaans',ar:'Arabic',bg:'Bulgarian',bn:'Bengali/Bangla',bs:'Bosnian',ca:'Catalan',cs:'Czech',da:'Danish',de:'German',el:'Greek',en:'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)',eo:'Esperanto',es:'Spanish',et:'Estonian',eu:'Basque',fa:'Persian',fi:'Finnish',fo:'Faroese',fr:'French','fr-ca':'French (Canada)',gl:'Galician',gu:'Gujarati',he:'Hebrew',hi:'Hindi',hr:'Croatian',hu:'Hungarian',is:'Icelandic',it:'Italian',ja:'Japanese',km:'Khmer',ko:'Korean',lt:'Lithuanian',lv:'Latvian',mn:'Mongolian',ms:'Malay',nb:'Norwegian Bokmal',nl:'Dutch',no:'Norwegian',pl:'Polish',pt:'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)',ro:'Romanian',ru:'Russian',sk:'Slovak',sl:'Slovenian',sr:'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)',sv:'Swedish',th:'Thai',tr:'Turkish',uk:'Ukrainian',vi:'Vietnamese',zh:'Chinese Traditional','zh-cn':'Chinese Simplified'},GetActiveLanguage:function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;},TranslateElements:function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i':'gt','ˆ':'circ','˜':'tilde',' ':'ensp',' ':'emsp',' ':'thinsp','‌':'zwnj','‍':'zwj','‎':'lrm','‏':'rlm','–':'ndash','—':'mdash','‘':'lsquo','’':'rsquo','‚':'sbquo','“':'ldquo','”':'rdquo','„':'bdquo','†':'dagger','‡':'Dagger','‰':'permil','‹':'lsaquo','›':'rsaquo','€':'euro'};for (e in FCKXHtmlEntities.Entities) A+=e;if (FCKConfig.IncludeLatinEntities){B={'À':'Agrave','Á':'Aacute','Â':'Acirc','Ã':'Atilde','Ä':'Auml','Å':'Aring','Æ':'AElig','Ç':'Ccedil','È':'Egrave','É':'Eacute','Ê':'Ecirc','Ë':'Euml','Ì':'Igrave','Í':'Iacute','Î':'Icirc','Ï':'Iuml','Ð':'ETH','Ñ':'Ntilde','Ò':'Ograve','Ó':'Oacute','Ô':'Ocirc','Õ':'Otilde','Ö':'Ouml','Ø':'Oslash','Ù':'Ugrave','Ú':'Uacute','Û':'Ucirc','Ü':'Uuml','Ý':'Yacute','Þ':'THORN','ß':'szlig','à':'agrave','á':'aacute','â':'acirc','ã':'atilde','ä':'auml','å':'aring','æ':'aelig','ç':'ccedil','è':'egrave','é':'eacute','ê':'ecirc','ë':'euml','ì':'igrave','í':'iacute','î':'icirc','ï':'iuml','ð':'eth','ñ':'ntilde','ò':'ograve','ó':'oacute','ô':'ocirc','õ':'otilde','ö':'ouml','ø':'oslash','ù':'ugrave','ú':'uacute','û':'ucirc','ü':'uuml','ý':'yacute','þ':'thorn','ÿ':'yuml','Œ':'OElig','œ':'oelig','Š':'Scaron','š':'scaron','Ÿ':'Yuml'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;};if (FCKConfig.IncludeGreekEntities){B={'Α':'Alpha','Β':'Beta','Γ':'Gamma','Δ':'Delta','Ε':'Epsilon','Ζ':'Zeta','Η':'Eta','Θ':'Theta','Ι':'Iota','Κ':'Kappa','Λ':'Lambda','Μ':'Mu','Ν':'Nu','Ξ':'Xi','Ο':'Omicron','Π':'Pi','Ρ':'Rho','Σ':'Sigma','Τ':'Tau','Υ':'Upsilon','Φ':'Phi','Χ':'Chi','Ψ':'Psi','Ω':'Omega','α':'alpha','β':'beta','γ':'gamma','δ':'delta','ε':'epsilon','ζ':'zeta','η':'eta','θ':'theta','ι':'iota','κ':'kappa','λ':'lambda','μ':'mu','ν':'nu','ξ':'xi','ο':'omicron','π':'pi','ρ':'rho','ς':'sigmaf','σ':'sigma','τ':'tau','υ':'upsilon','φ':'phi','χ':'chi','ψ':'psi','ω':'omega','\u03d1':'thetasym','\u03d2':'upsih','\u03d6':'piv'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;}}else{FCKXHtmlEntities.Entities={'>':'gt'};A='>';A+=' ';};var C='['+A+']';if (FCKConfig.ProcessNumericEntities) C='[^ -~]|'+C;var D=FCKConfig.AdditionalNumericEntities;if (D&&D.length>0) C+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(C,'g');}; -var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; +var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);if (FCKBrowserInfo.IsIE) FCKXHtml._RemoveXHtmlJobProperties(A);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; FCKXHtml._GetMainXmlString=function(){return (new XMLSerializer()).serializeToString(this.MainNode);};FCKXHtml._AppendAttributes=function(A,B,C){var D=B.attributes;for (var n=0;n]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DL|DT|DD|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+(FCKCodeFormatter.ProtectedData.push(C)-1)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=[];var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;iB[i]) return 1;};if (A.lengthB.length) return 1;return 0;};FCKUndo._CheckIsBookmarksEqual=function(A,B){if (!(A&&B)) return false;if (FCKBrowserInfo.IsIE){var C=A[1].search(A[0].StartId);var D=B[1].search(B[0].StartId);var E=A[1].search(A[0].EndId);var F=B[1].search(B[0].EndId);return C==D&&E==F;}else{return this._CompareCursors(A.Start,B.Start)==0&&this._CompareCursors(A.End,B.End)==0;}};FCKUndo.SaveUndoStep=function(){if (FCK.EditMode!=0||this.SaveLocked) return;if (this.SavedData.length) this.Changed=true;var A=FCK.EditorDocument.body.innerHTML;var B=this._GetBookmark();this.SavedData=this.SavedData.slice(0,this.CurrentIndex+1);if (this.CurrentIndex>0&&A==this.SavedData[this.CurrentIndex][0]&&this._CheckIsBookmarksEqual(B,this.SavedData[this.CurrentIndex][1])) return;else if (this.CurrentIndex==0&&this.SavedData.length&&A==this.SavedData[0][0]){this.SavedData[0][1]=B;return;};if (this.CurrentIndex+1>=FCKConfig.MaxUndoLevels) this.SavedData.shift();else this.CurrentIndex++;this.SavedData[this.CurrentIndex]=[A,B];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.CheckUndoState=function(){return (this.Changed||this.CurrentIndex>0);};FCKUndo.CheckRedoState=function(){return (this.CurrentIndex<(this.SavedData.length-1));};FCKUndo.Undo=function(){if (this.CheckUndoState()){if (this.CurrentIndex==(this.SavedData.length-1)){this.SaveUndoStep();};this._ApplyUndoLevel(--this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo.Redo=function(){if (this.CheckRedoState()){this._ApplyUndoLevel(++this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo._ApplyUndoLevel=function(A){var B=this.SavedData[A];if (!B) return;if (FCKBrowserInfo.IsIE){if (B[1]&&B[1][1]) FCK.SetInnerHtml(B[1][1]);else FCK.SetInnerHtml(B[0]);}else FCK.EditorDocument.body.innerHTML=B[0];this._SelectBookmark(B[1]);this.TypesCount=0;this.Changed=false;this.Typing=false;}; @@ -67,10 +67,10 @@ var FCKXml=function(){this.Error=false;};FCKXml.GetAttribute=function(A,B,C){var FCKXml.prototype={LoadUrl:function(A){this.Error=false;var B;var C=FCKTools.CreateXmlObject('XmlHttp');C.open('GET',A,false);C.send(null);if (C.status==200||C.status==304||(C.status==0&&C.readyState==4)){B=C.responseXML;if (!B) B=(new DOMParser()).parseFromString(C.responseText,'text/xml');}else B=null;if (B){try{var D=B.firstChild;}catch (e){B=(new DOMParser()).parseFromString(C.responseText,'text/xml');}};if (!B||!B.firstChild){this.Error=true;if (window.confirm('Error loading "'+A+'" (HTTP Status: '+C.status+').\r\nDo you want to see the server response dump?')) alert(C.responseText);};this.DOMDocument=B;},SelectNodes:function(A,B){if (this.Error) return [];var C=[];var D=this.DOMDocument.evaluate(A,B?B:this.DOMDocument,this.DOMDocument.createNSResolver(this.DOMDocument.documentElement),XPathResult.ORDERED_NODE_ITERATOR_TYPE,null);if (D){var E=D.iterateNext();while(E){C[C.length]=E;E=D.iterateNext();}};return C;},SelectSingleNode:function(A,B){if (this.Error) return null;var C=this.DOMDocument.evaluate(A,B?B:this.DOMDocument,this.DOMDocument.createNSResolver(this.DOMDocument.documentElement),9,null);if (C&&C.singleNodeValue) return C.singleNodeValue;else return null;}}; var FCKNamedCommand=function(A){this.Name=A;};FCKNamedCommand.prototype.Execute=function(){FCK.ExecuteNamedCommand(this.Name);};FCKNamedCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState(this.Name);}; var FCKStyleCommand=function(){};FCKStyleCommand.prototype={Name:'Style',Execute:function(A,B){FCKUndo.SaveUndoStep();if (B.Selected) FCK.Styles.RemoveStyle(B.Style);else FCK.Styles.ApplyStyle(B.Style);FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');},GetState:function(){if (FCK.EditMode!=0||!FCK.EditorDocument) return -1;if (FCKSelection.GetType()=='Control'){var A=FCKSelection.GetSelectedElement();if (!A||!FCKStyles.CheckHasObjectStyle(A.nodeName.toLowerCase())) return -1;};return 0;}}; -var FCKDialogCommand=function(A,B,C,D,E,F,G,H){this.Name=A;this.Title=B;this.Url=C;this.Width=D;this.Height=E;this.CustomValue=H;this.GetStateFunction=F;this.GetStateParam=G;this.Resizable=false;};FCKDialogCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_'+this.Name,this.Title,this.Url,this.Width,this.Height,this.CustomValue,null,this.Resizable);};FCKDialogCommand.prototype.GetState=function(){if (this.GetStateFunction) return this.GetStateFunction(this.GetStateParam);else return FCK.EditMode==0?0:-1;};var FCKUndefinedCommand=function(){this.Name='Undefined';};FCKUndefinedCommand.prototype.Execute=function(){alert(FCKLang.NotImplemented);};FCKUndefinedCommand.prototype.GetState=function(){return 0;};var FCKFormatBlockCommand=function(){};FCKFormatBlockCommand.prototype={Name:'FormatBlock',Execute:FCKStyleCommand.prototype.Execute,GetState:function(){return FCK.EditorDocument?0:-1;}};var FCKFontNameCommand=function(){};FCKFontNameCommand.prototype={Name:'FontName',Execute:FCKStyleCommand.prototype.Execute,GetState:FCKFormatBlockCommand.prototype.GetState};var FCKFontSizeCommand=function(){};FCKFontSizeCommand.prototype={Name:'FontSize',Execute:FCKStyleCommand.prototype.Execute,GetState:FCKFormatBlockCommand.prototype.GetState};var FCKPreviewCommand=function(){this.Name='Preview';};FCKPreviewCommand.prototype.Execute=function(){FCK.Preview();};FCKPreviewCommand.prototype.GetState=function(){return 0;};var FCKSaveCommand=function(){this.Name='Save';};FCKSaveCommand.prototype.Execute=function(){var A=FCK.GetParentForm();if (typeof(A.onsubmit)=='function'){var B=A.onsubmit();if (B!=null&&B===false) return;};if (typeof(A.submit)=='function') A.submit();else A.submit.click();};FCKSaveCommand.prototype.GetState=function(){return 0;};var FCKNewPageCommand=function(){this.Name='NewPage';};FCKNewPageCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();FCK.SetData('');FCKUndo.Typing=true;FCK.Focus();};FCKNewPageCommand.prototype.GetState=function(){return 0;};var FCKSourceCommand=function(){this.Name='Source';};FCKSourceCommand.prototype.Execute=function(){if (FCKConfig.SourcePopup){var A=FCKConfig.ScreenWidth*0.65;var B=FCKConfig.ScreenHeight*0.65;FCKDialog.OpenDialog('FCKDialog_Source',FCKLang.Source,'dialog/fck_source.html',A,B,null,null,true);}else FCK.SwitchEditMode();};FCKSourceCommand.prototype.GetState=function(){return (FCK.EditMode==0?0:1);};var FCKUndoCommand=function(){this.Name='Undo';};FCKUndoCommand.prototype.Execute=function(){FCKUndo.Undo();};FCKUndoCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return (FCKUndo.CheckUndoState()?0:-1);};var FCKRedoCommand=function(){this.Name='Redo';};FCKRedoCommand.prototype.Execute=function(){FCKUndo.Redo();};FCKRedoCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return (FCKUndo.CheckRedoState()?0:-1);};var FCKPageBreakCommand=function(){this.Name='PageBreak';};FCKPageBreakCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();var e=FCK.EditorDocument.createElement('DIV');e.style.pageBreakAfter='always';e.innerHTML=' ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKVisitLinkCommand=function(){this.Name='VisitLink';};FCKVisitLinkCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState('Unlink');if (A==0){var B=FCKSelection.MoveToAncestorNode('A');if (!B.href) A=-1;};return A;},Execute:function(){var A=FCKSelection.MoveToAncestorNode('A');var B=A.getAttribute('_fcksavedurl')||A.getAttribute('href',2);if (!/:\/\//.test(B)){var C=FCKConfig.BaseHref;var D=FCK.GetInstanceObject('parent');if (!C){C=D.document.location.href;C=C.substring(0,C.lastIndexOf('/')+1);};if (/^\//.test(B)){try{C=C.match(/^.*:\/\/+[^\/]+/)[0];}catch (e){C=D.document.location.protocol+'://'+D.parent.document.location.host;}};B=C+B;};if (!window.open(B,'_blank')) alert(FCKLang.VisitLinkBlocked);}};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}};var FCKDeleteDivCommand=function(){};FCKDeleteDivCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCKSelection.GetParentElement();var B=new FCKElementPath(A);return B.BlockLimit&&B.BlockLimit.nodeName.IEquals('div')?0:-1;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCKDomTools.GetSelectedDivContainers();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();for (var i=0;i 
    ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKVisitLinkCommand=function(){this.Name='VisitLink';};FCKVisitLinkCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState('Unlink');if (A==0){var B=FCKSelection.MoveToAncestorNode('A');if (!B.href) A=-1;};return A;},Execute:function(){var A=FCKSelection.MoveToAncestorNode('A');var B=A.getAttribute('_fcksavedurl')||A.getAttribute('href',2);if (!/:\/\//.test(B)){var C=FCKConfig.BaseHref;var D=FCK.GetInstanceObject('parent');if (!C){C=D.document.location.href;C=C.substring(0,C.lastIndexOf('/')+1);};if (/^\//.test(B)){try{C=C.match(/^.*:\/\/+[^\/]+/)[0];}catch (e){C=D.document.location.protocol+'://'+D.parent.document.location.host;}};B=C+B;};if (!window.open(B,'_blank')) alert(FCKLang.VisitLinkBlocked);}};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}};var FCKDeleteDivCommand=function(){};FCKDeleteDivCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCKSelection.GetParentElement();var B=new FCKElementPath(A);return B.BlockLimit&&B.BlockLimit.nodeName.IEquals('div')?0:-1;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCKDomTools.GetSelectedDivContainers();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();for (var i=0;i\n
    \n \n \n \n
    '+FCKLang.ColorAutomatic+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
    ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
    '+FCKLang.ColorMoreColors+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);};if (!FCKBrowserInfo.IsIE) C.style.width='96%';}; +var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B);this._Panel.AppendStyleSheet(FCKConfig.SkinEditorCSS);this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCK.ToolbarSet.ToolbarItems.GetItem(this.Name).RegisterPanel(this._Panel);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){FCKUndo.SaveUndoStep();var B=FCKStyles.GetStyle('_FCK_'+(this.Type=='ForeColor'?'Color':'BackColor'));if (!A||A.length==0) FCK.Styles.RemoveStyle(B);else{B.SetVariable('Color',A);FCKStyles.ApplyStyle(B);};FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');};FCKTextColorCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};function FCKTextColorCommand_OnMouseOver(){this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut(){this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(A,B,C){this.className='ColorDeselected';B.SetColor(C);B._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(A,B){this.className='ColorDeselected';B.SetColor('');B._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(A,B){this.className='ColorDeselected';B._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',410,320,FCKTools.Bind(B,B.SetColor));};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';FCKTools.AddEventListenerEx(C,'mouseover',FCKTextColorCommand_OnMouseOver);FCKTools.AddEventListenerEx(C,'mouseout',FCKTextColorCommand_OnMouseOut);return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='\n \n \n \n \n
    '+FCKLang.ColorAutomatic+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
    ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
    '+FCKLang.ColorMoreColors+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';}}; var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}; var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCK.EditMode!=0||FCKConfig.ForcePasteAsPlainText) return -1;else return FCK.GetNamedCommandState('Paste');}; var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (!FCKBrowserInfo.IsGecko){switch (this.Name){case 'TableMergeRight':return FCKTableHandler.MergeRight();case 'TableMergeDown':return FCKTableHandler.MergeDown();}};switch (this.Name){case 'TableInsertRowAfter':return FCKTableHandler.InsertRow(false);case 'TableInsertRowBefore':return FCKTableHandler.InsertRow(true);case 'TableDeleteRows':return FCKTableHandler.DeleteRows();case 'TableInsertColumnAfter':return FCKTableHandler.InsertColumn(false);case 'TableInsertColumnBefore':return FCKTableHandler.InsertColumn(true);case 'TableDeleteColumns':return FCKTableHandler.DeleteColumns();case 'TableInsertCellAfter':return FCKTableHandler.InsertCell(null,false);case 'TableInsertCellBefore':return FCKTableHandler.InsertCell(null,true);case 'TableDeleteCells':return FCKTableHandler.DeleteCells();case 'TableMergeCells':return FCKTableHandler.MergeCells();case 'TableHorizontalSplitCell':return FCKTableHandler.HorizontalSplitCell();case 'TableVerticalSplitCell':return FCKTableHandler.VerticalSplitCell();case 'TableDelete':return FCKTableHandler.DeleteTable();default:return alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){if (FCK.EditorDocument!=null&&FCKSelection.HasAncestorNode('TABLE')){switch (this.Name){case 'TableHorizontalSplitCell':case 'TableVerticalSplitCell':if (FCKTableHandler.GetSelectedCells().length==1) return 0;else return -1;case 'TableMergeCells':if (FCKTableHandler.CheckIsSelectionRectangular()&&FCKTableHandler.GetSelectedCells().length>1) return 0;else return -1;case 'TableMergeRight':return FCKTableHandler.GetMergeRightTarget()?0:-1;case 'TableMergeDown':return FCKTableHandler.GetMergeDownTarget()?0:-1;default:return 0;}}else return -1;}; @@ -97,7 +97,7 @@ var FCKToolbarItems={};FCKToolbarItems.LoadedItems={};FCKToolbarItems.RegisterIt var FCKToolbar=function(){this.Items=[];};FCKToolbar.prototype.AddItem=function(A){return this.Items[this.Items.length]=A;};FCKToolbar.prototype.AddButton=function(A,B,C,D,E,F){if (typeof(D)=='number') D=[this.DefaultIconsStrip,this.DefaultIconSize,D];var G=new FCKToolbarButtonUI(A,B,C,D,E,F);G._FCKToolbar=this;G.OnClick=FCKToolbar_OnItemClick;return this.AddItem(G);};function FCKToolbar_OnItemClick(A){var B=A._FCKToolbar;if (B.OnItemClick) B.OnItemClick(B,A);};FCKToolbar.prototype.AddSeparator=function(){this.AddItem(new FCKToolbarSeparator());};FCKToolbar.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var e=B.createElement('table');e.className='TB_Toolbar';e.style.styleFloat=e.style.cssFloat=(FCKLang.Dir=='ltr'?'left':'right');e.dir=FCKLang.Dir;e.cellPadding=0;e.cellSpacing=0;var C=e.insertRow(-1);var D;if (!this.HideStart){D=C.insertCell(-1);D.appendChild(B.createElement('div')).className='TB_Start';};for (var i=0;i';G.open();G.write(''+H+''+document.getElementById('xToolbarSpace').innerHTML+'');G.close();if(FCKBrowserInfo.IsAIR) FCKAdobeAIR.ToolbarSet_InitOutFrame(G);FCKTools.AddEventListener(G,'contextmenu',FCKTools.CancelEvent);FCKTools.AppendStyleSheet(G,FCKConfig.SkinEditorCSS);B=D.__FCKToolbarSet=new FCKToolbarSet(G);B._IFrame=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(D,FCKToolbarSet_Target_Cleanup);};B.CurrentInstance=FCK;if (!B.ToolbarItems) B.ToolbarItems=FCKToolbarItems;FCK.AttachToOnSelectionChange(B.RefreshItemsState);return B;};function FCK_OnBlur(A){var B=A.ToolbarSet;if (B.CurrentInstance==A) B.Disable();};function FCK_OnFocus(A){var B=A.ToolbarSet;var C=A||FCK;B.CurrentInstance.FocusManager.RemoveWindow(B._IFrame.contentWindow);B.CurrentInstance=C;C.FocusManager.AddWindow(B._IFrame.contentWindow,true);B.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;FCKTools.AddEventListener(B,'click',FCKToolbarSet_Expand_OnClick);C.title=FCKLang.ToolbarCollapse;FCKTools.AddEventListener(C,'click',FCKToolbarSet_Collapse_OnClick);if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=[];this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=[];this.ItemsWysiwygOnly=[];this.ItemsContextSensitive=[];this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=[];for (var x=0;x0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,parentWindow,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save(true);var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); +var FCKDialog=(function(){var A;var B;var C;var D=window.parent;while (D.parent&&D.parent!=D){try{if (D.parent.document.domain!=document.domain) break;if (D.parent.document.getElementsByTagName('frameset').length>0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save(true);var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); var FCKMenuItem=function(A,B,C,D,E,F){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);this.CustomData=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D,E){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D,E);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};function FCKMenuItem_SubMenu_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuItem_SubMenu_OnHide(A){A.Deactivate();};function FCKMenuItem_OnClick(A,B){if (B.HasSubMenu) B.Activate();else{B.Deactivate();FCKTools.RunFunction(B.OnClick,B,[B]);}};function FCKMenuItem_OnMouseOver(A,B){B.Activate();};function FCKMenuItem_OnMouseOut(A,B){B.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}; var FCKMenuBlock=function(){this._Items=[];};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D,E){var F=new FCKMenuItem(this,A,B,C,D,E);F.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);F.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(F);return F;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=[];var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i';if (!FCKRegexLib.HtmlOpener.test(A)) A=''+A+'';if (!FCKRegexLib.HeadOpener.test(A)) A=A.replace(FCKRegexLib.HtmlOpener,'$&');return A;}else{var B=FCKConfig.DocType+'0&&!FCKRegexLib.Html4DocType.test(FCKConfig.DocType)) B+=' style="overflow-y: scroll"';B+='>'+A+'';return B;}},ConvertToDataFormat:function(A,B,C,D){var E=FCKXHtml.GetXHTML(A,!B,D);if (C&&FCKRegexLib.EmptyOutParagraph.test(E)) return '';return E;},FixHtml:function(A){return A;}}; -var FCK={Name:FCKURLParams['InstanceName'],Status:0,EditMode:0,Toolbar:null,HasFocus:false,DataProcessor:new FCKDataProcessor(),GetInstanceObject:(function(){var w=window;return function(name){return w[name];}})(),AttachToOnSelectionChange:function(A){this.Events.AttachEvent('OnSelectionChange',A);},GetLinkedFieldValue:function(){return this.LinkedField.value;},GetParentForm:function(){return this.LinkedField.form;},StartupValue:'',IsDirty:function(){if (this.EditMode==1) return (this.StartupValue!=this.EditingArea.Textarea.value);else{if (!this.EditorDocument) return false;return (this.StartupValue!=this.EditorDocument.body.innerHTML);}},ResetIsDirty:function(){if (this.EditMode==1) this.StartupValue=this.EditingArea.Textarea.value;else if (this.EditorDocument.body) this.StartupValue=this.EditorDocument.body.innerHTML;},StartEditor:function(){this.TempBaseTag=FCKConfig.BaseHref.length>0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i '+this.Elements[i].outerHTML+'';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i0) C+='TABLE { behavior: '+B+' ; }';C+='';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){var A=FCK.EditorDocument.body;A.detachEvent('onpaste',Doc_OnPaste);var B=FCK.Paste(!FCKConfig.ForcePasteAsPlainText&&!FCKConfig.AutoDetectPasteFromWord);A.attachEvent('onpaste',Doc_OnPaste);return B;};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){if (!FCK.IsSelectionChangeLocked&&FCK.EditorDocument) FCK.Events.FireEvent("OnSelectionChange");};function Doc_OnDrop(){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){var A=FCK.EditorWindow.event;if (FCK._CheckIsPastingEnabled()||FCKConfig.ShowDropDialog) FCK.PasteAsPlainText(A.dataTransfer.getData('Text'));A.returnValue=false;A.cancelBubble=true;}};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);this.EditorDocument.body.attachEvent('ondrop',Doc_OnDrop);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);this.EditorDocument.attachEvent("onkeydown",FCK._KeyDownListener);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onbeforedeactivate",function(){ FCKSelection.Save();});this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',Doc_OnMouseDown);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKSelection.Restore();FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCKSelection.GetSelection();if (B.type.toLowerCase()=='control') B.clear();A=''+A;B.createRange().pasteHTML(A);FCK.EditorDocument.getElementById('__fakeFCKRemove__').removeNode(true);FCKDocumentProcessor.Process(FCK.EditorDocument);this.Events.FireEvent("OnSelectionChange");};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='
     
    '+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.LinkedField=null;this.EditorWindow=null;this.EditorDocument=null;};FCK._ExecPaste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK._CheckIsPastingEnabled(true);if (A===false) FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;};return false;};FCK.PasteAsPlainText=function(A){if (!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};var B=null;if (!A) B=clipboardData.getData("Text");else B=A;if (B&&B.length>0){B=FCKTools.HTMLEncode(B);B=FCKTools.ProcessLineBreaks(window,FCKConfig,B);var C=B.search('

    ');var D=B.search('

    ');if ((C!=-1&&D!=-1&&C0){if (FCKSelection.GetType()=='Control'){var D=this.EditorDocument.createElement('A');D.href=A;var E=FCKSelection.GetSelectedElement();E.parentNode.insertBefore(D,E);E.parentNode.removeChild(E);D.appendChild(E);return [D];};var F='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',F,false,!!B);var G=this.EditorDocument.links;for (i=0;i0?'':'';var A=FCK.KeystrokeHandler=new FCKKeystrokeHandler();A.OnKeystroke=_FCK_KeystrokeHandler_OnKeystroke;A.SetKeystrokes(FCKConfig.Keystrokes);if (FCKBrowserInfo.IsIE7){if ((CTRL+86) in A.Keystrokes) A.SetKeystrokes([CTRL+86,true]);if ((SHIFT+45) in A.Keystrokes) A.SetKeystrokes([SHIFT+45,true]);};A.SetKeystrokes([CTRL+8,true]);this.EditingArea=new FCKEditingArea(document.getElementById('xEditingArea'));this.EditingArea.FFSpellChecker=FCKConfig.FirefoxSpellChecker;this.SetData(this.GetLinkedFieldValue(),true);FCKTools.AddEventListener(document,"keydown",this._TabKeyHandler);this.AttachToOnSelectionChange(_FCK_PaddingNodeListener);if (FCKBrowserInfo.IsGecko) this.AttachToOnSelectionChange(this._ExecCheckEmptyBlock);},Focus:function(){FCK.EditingArea.Focus();},SetStatus:function(A){this.Status=A;if (A==1){FCKFocusManager.AddWindow(window,true);if (FCKBrowserInfo.IsIE) FCKFocusManager.AddWindow(window.frameElement,true);if (FCKConfig.StartupFocus) FCK.Focus();};this.Events.FireEvent('OnStatusChange',A);},FixBody:function(){var A=FCKConfig.EnterMode;if (A!='p'&&A!='div') return;var B=this.EditorDocument;if (!B) return;var C=B.body;if (!C) return;FCKDomTools.TrimNode(C);var D=C.firstChild;var E;while (D){var F=false;switch (D.nodeType){case 1:var G=D.nodeName.toLowerCase();if (!FCKListsLib.BlockElements[G]&&G!='li'&&!D.getAttribute('_fckfakelement')&&D.getAttribute('_moz_dirty')==null) F=true;break;case 3:if (E||D.nodeValue.Trim().length>0) F=true;break;case 8:if (E) F=true;break;};if (F){var H=D.parentNode;if (!E) E=H.insertBefore(B.createElement(A),D);E.appendChild(H.removeChild(D));D=E.nextSibling;}else{if (E){FCKDomTools.TrimNode(E);E=null;};D=D.nextSibling;}};if (E) FCKDomTools.TrimNode(E);},GetData:function(A){if (FCK.EditMode==1) return FCK.EditingArea.Textarea.value;this.FixBody();var B=FCK.EditorDocument;if (!B) return null;var C=FCKConfig.FullPage;var D=FCK.DataProcessor.ConvertToDataFormat(C?B.documentElement:B.body,!C,FCKConfig.IgnoreEmptyParagraphValue,A);D=FCK.ProtectEventsRestore(D);if (FCKBrowserInfo.IsIE) D=D.replace(FCKRegexLib.ToReplace,'$1');if (C){if (FCK.DocTypeDeclaration&&FCK.DocTypeDeclaration.length>0) D=FCK.DocTypeDeclaration+'\n'+D;if (FCK.XmlDeclaration&&FCK.XmlDeclaration.length>0) D=FCK.XmlDeclaration+'\n'+D;};return FCKConfig.ProtectedSource.Revert(D);},UpdateLinkedField:function(){var A=FCK.GetXHTML(FCKConfig.FormatOutput);if (FCKConfig.HtmlEncodeOutput) A=FCKTools.HTMLEncode(A);FCK.LinkedField.value=A;FCK.Events.FireEvent('OnAfterLinkedFieldUpdate');},RegisteredDoubleClickHandlers:{},OnDoubleClick:function(A){var B=FCK.RegisteredDoubleClickHandlers[A.tagName.toUpperCase()];if (B){for (var i=0;i0?'|ABBR|XML|EMBED|OBJECT':'ABBR|XML|EMBED|OBJECT';var C;if (B.length>0){C=new RegExp('<('+B+')(?!\w|:)','gi');A=A.replace(C,'','gi');A=A.replace(C,'<\/FCK:$1>');};B='META';if (FCKBrowserInfo.IsIE) B+='|HR';C=new RegExp('<(('+B+')(?=\\s|>|/)[\\s\\S]*?)/?>','gi');A=A.replace(C,'');return A;},SetData:function(A,B){this.EditingArea.Mode=FCK.EditMode;if (FCKBrowserInfo.IsIE&&FCK.EditorDocument){FCK.EditorDocument.detachEvent("onselectionchange",Doc_OnSelectionChange);};FCKTempBin.Reset();FCK.Selection.Release();if (FCK.EditMode==0){this._ForceResetIsDirty=(B===true);A=FCKConfig.ProtectedSource.Protect(A);A=FCK.DataProcessor.ConvertToHtml(A);A=A.replace(FCKRegexLib.InvalidSelfCloseTags,'$1>');A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);if (FCK.TempBaseTag.length>0&&!FCKRegexLib.HasBaseTag.test(A)) A=A.replace(FCKRegexLib.HeadOpener,'$&'+FCK.TempBaseTag);var C='';if (!FCKConfig.FullPage) C+=_FCK_GetEditorAreaStyleTags();if (FCKBrowserInfo.IsIE) C+=FCK._GetBehaviorsStyle();else if (FCKConfig.ShowBorders) C+=FCKTools.GetStyleHtml(FCK_ShowTableBordersCSS,true);C+=FCKTools.GetStyleHtml(FCK_InternalCSS,true);A=A.replace(FCKRegexLib.HeadCloser,C+'$&');this.EditingArea.OnLoad=_FCK_EditingArea_OnLoad;this.EditingArea.Start(A);}else{FCK.EditorWindow=null;FCK.EditorDocument=null;FCKDomTools.PaddingNode=null;this.EditingArea.OnLoad=null;this.EditingArea.Start(A);this.EditingArea.Textarea._FCKShowContextMenu=true;FCK.EnterKeyHandler=null;if (B) this.ResetIsDirty();FCK.KeystrokeHandler.AttachToElement(this.EditingArea.Textarea);this.EditingArea.Textarea.focus();FCK.Events.FireEvent('OnAfterSetHTML');};if (FCKBrowserInfo.IsGecko) window.onresize();},RedirectNamedCommands:{},ExecuteNamedCommand:function(A,B,C,D){if (!D) FCKUndo.SaveUndoStep();if (!C&&FCK.RedirectNamedCommands[A]!=null) FCK.ExecuteRedirectedNamedCommand(A,B);else{FCK.Focus();FCK.EditorDocument.execCommand(A,false,B);FCK.Events.FireEvent('OnSelectionChange');};if (!D) FCKUndo.SaveUndoStep();},GetNamedCommandState:function(A){try{if (FCKBrowserInfo.IsSafari&&FCK.EditorWindow&&A.IEquals('Paste')) return 0;if (!FCK.EditorDocument.queryCommandEnabled(A)) return -1;else{return FCK.EditorDocument.queryCommandState(A)?1:0;}}catch (e){return 0;}},GetNamedCommandValue:function(A){var B='';var C=FCK.GetNamedCommandState(A);if (C==-1) return null;try{B=this.EditorDocument.queryCommandValue(A);}catch(e) {};return B?B:'';},Paste:function(A){if (FCK.Status!=2||!FCK.Events.FireEvent('OnPaste')) return false;return A||FCK._ExecPaste();},PasteFromWord:function(){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteFromWord,'dialog/fck_paste.html',400,330,'Word');},Preview:function(){var A;if (FCKConfig.FullPage){if (FCK.TempBaseTag.length>0) A=FCK.TempBaseTag+FCK.GetXHTML();else A=FCK.GetXHTML();}else{A=FCKConfig.DocType+''+FCK.TempBaseTag+''+FCKLang.Preview+''+_FCK_GetEditorAreaStyleTags()+''+FCK.GetXHTML()+'';};var B=FCKConfig.ScreenWidth*0.8;var C=FCKConfig.ScreenHeight*0.7;var D=(FCKConfig.ScreenWidth-B)/2;var E='';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A;E='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.opener._FCKHtmlToLoad );document.close() ;window.opener._FCKHtmlToLoad = null ;})() )';};var F=window.open(E,null,'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width='+B+',height='+C+',left='+D);if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){F.document.write(A);F.document.close();}},SwitchEditMode:function(A){var B=(FCK.EditMode==0);var C=FCK.IsDirty();var D;if (B){FCKCommands.GetCommand('ShowBlocks').SaveState();if (!A&&FCKBrowserInfo.IsIE) FCKUndo.SaveUndoStep();D=FCK.GetXHTML(FCKConfig.FormatSource);if (FCKBrowserInfo.IsIE) FCKTempBin.ToHtml();if (D==null) return false;}else D=this.EditingArea.Textarea.value;FCK.EditMode=B?1:0;FCK.SetData(D,!C);FCK.Focus();FCKTools.RunFunction(FCK.ToolbarSet.RefreshModeState,FCK.ToolbarSet);return true;},InsertElement:function(A){if (typeof A=='string') A=this.EditorDocument.createElement(A);var B=A.nodeName.toLowerCase();FCKSelection.Restore();var C=new FCKDomRange(this.EditorWindow);C.MoveToSelection();C.DeleteContents();if (FCKListsLib.BlockElements[B]!=null){if (C.StartBlock){if (C.CheckStartOfBlock()) C.MoveToPosition(C.StartBlock,3);else if (C.CheckEndOfBlock()) C.MoveToPosition(C.StartBlock,4);else C.SplitBlock();};C.InsertNode(A);var D=FCKDomTools.GetNextSourceElement(A,false,null,['hr','br','param','img','area','input'],true);if (!D&&FCKConfig.EnterMode!='br'){D=this.EditorDocument.body.appendChild(this.EditorDocument.createElement(FCKConfig.EnterMode));if (FCKBrowserInfo.IsGeckoLike) FCKTools.AppendBogusBr(D);};if (FCKListsLib.EmptyElements[B]==null) C.MoveToElementEditStart(A);else if (D) C.MoveToElementEditStart(D);else C.MoveToPosition(A,4);if (FCKBrowserInfo.IsGeckoLike){if (D) FCKDomTools.ScrollIntoView(D,false);FCKDomTools.ScrollIntoView(A,false);}}else{C.InsertNode(A);C.SetStart(A,4);C.SetEnd(A,4);};C.Select();C.Release();this.Focus();return A;},_InsertBlockElement:function(A){},_IsFunctionKey:function(A){if (A>=16&&A<=20) return true;if (A==27||(A>=33&&A<=40)) return true;if (A==45) return true;return false;},_KeyDownListener:function(A){if (!A) A=FCK.EditorWindow.event;if (FCK.EditorWindow){if (!FCK._IsFunctionKey(A.keyCode)&&!(A.ctrlKey||A.metaKey)&&!(A.keyCode==46)) FCK._KeyDownUndo();};return true;},_KeyDownUndo:function(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;FCKUndo.Changed=1;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}},_TabKeyHandler:function(A){if (!A) A=window.event;var B=A.keyCode;if (B==9&&FCK.EditMode!=0){if (FCKBrowserInfo.IsIE){var C=document.selection.createRange();if (C.parentElement()!=FCK.EditingArea.Textarea) return true;C.text='\t';C.select();}else{var a=[];var D=FCK.EditingArea.Textarea;var E=D.selectionStart;var F=D.selectionEnd;a.push(D.value.substr(0,E));a.push('\t');a.push(D.value.substr(F));D.value=a.join('');D.setSelectionRange(E+1,E+1);};if (A.preventDefault) return A.preventDefault();return A.returnValue=false;};return true;}};FCK.Events=new FCKEvents(FCK);FCK.GetHTML=FCK.GetXHTML=FCK.GetData;FCK.SetHTML=FCK.SetData;FCK.InsertElementAndGetIt=FCK.CreateElement=FCK.InsertElement;function _FCK_ProtectEvents_ReplaceTags(A){return A.replace(FCKRegexLib.EventAttributes,_FCK_ProtectEvents_ReplaceEvents);};function _FCK_ProtectEvents_ReplaceEvents(A,B){return ' '+B+'_fckprotectedatt="'+encodeURIComponent(A)+'"';};function _FCK_ProtectEvents_RestoreEvents(A,B){return decodeURIComponent(B);};function _FCK_MouseEventsListener(A){if (!A) A=window.event;if (A.type=='mousedown') FCK.MouseDownFlag=true;else if (A.type=='mouseup') FCK.MouseDownFlag=false;else if (A.type=='mousemove') FCK.Events.FireEvent('OnMouseMove',A);};function _FCK_PaddingNodeListener(){if (FCKConfig.EnterMode.IEquals('br')) return;FCKDomTools.EnforcePaddingNode(FCK.EditorDocument,FCKConfig.EnterMode);if (!FCKBrowserInfo.IsIE&&FCKDomTools.PaddingNode){var A=FCKSelection.GetSelection();if (A&&A.rangeCount==1){var B=A.getRangeAt(0);if (B.collapsed&&B.startContainer==FCK.EditorDocument.body&&B.startOffset==0){B.selectNodeContents(FCKDomTools.PaddingNode);B.collapse(true);A.removeAllRanges();A.addRange(B);}}}else if (FCKDomTools.PaddingNode){var C=FCKSelection.GetParentElement();var D=FCKDomTools.PaddingNode;if (C&&C.nodeName.IEquals('body')){if (FCK.EditorDocument.body.childNodes.length==1&&FCK.EditorDocument.body.firstChild==D){if (FCKSelection._GetSelectionDocument(FCK.EditorDocument.selection)!=FCK.EditorDocument) return;var B=FCK.EditorDocument.body.createTextRange();var F=false;if (!D.childNodes.firstChild){D.appendChild(FCKTools.GetElementDocument(D).createTextNode('\ufeff'));F=true;};B.moveToElementText(D);B.select();if (F) B.pasteHTML('');}}}};function _FCK_EditingArea_OnLoad(){FCK.EditorWindow=FCK.EditingArea.Window;FCK.EditorDocument=FCK.EditingArea.Document;if (FCKBrowserInfo.IsIE) FCKTempBin.ToElements();FCK.InitializeBehaviors();FCK.MouseDownFlag=false;FCKTools.AddEventListener(FCK.EditorDocument,'mousemove',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',_FCK_MouseEventsListener);FCKTools.AddEventListener(FCK.EditorDocument,'mouseup',_FCK_MouseEventsListener);if (FCKBrowserInfo.IsSafari){FCKTools.AddEventListener(FCK.EditorDocument,'paste',function(evt){var A=new FCKDomRange(FCK.EditorWindow);var B=FCK.EditorDocument.createTextNode('\ufeff');var C=FCK.EditorDocument.createElement('a');C.id='fck_paste_padding';C.innerHTML='';A.MoveToSelection();A.DeleteContents();A.InsertNode(B);A.Collapse();A.InsertNode(C);A.MoveToPosition(C,3);A.Select();setTimeout(function(){B.parentNode.removeChild(B);C=FCK.EditorDocument.getElementById('fck_paste_padding');C.parentNode.removeChild(C);},0);});};if (FCKBrowserInfo.IsSafari){var A=function(evt){if (!(evt.ctrlKey||evt.metaKey)) return;if (FCK.EditMode!=0) return;switch (evt.keyCode){case 89:FCKUndo.Redo();break;case 90:FCKUndo.Undo();break;}};FCKTools.AddEventListener(FCK.EditorDocument,'keyup',A);};FCK.EnterKeyHandler=new FCKEnterKey(FCK.EditorWindow,FCKConfig.EnterMode,FCKConfig.ShiftEnterMode,FCKConfig.TabSpaces);FCK.KeystrokeHandler.AttachToElement(FCK.EditorDocument);if (FCK._ForceResetIsDirty) FCK.ResetIsDirty();if (FCKBrowserInfo.IsIE&&FCK.HasFocus) FCK.EditorDocument.body.setActive();FCK.OnAfterSetHTML();FCKCommands.GetCommand('ShowBlocks').RestoreState();if (FCK.Status!=0) return;FCK.SetStatus(1);};function _FCK_GetEditorAreaStyleTags(){return FCKTools.GetStyleHtml(FCKConfig.EditorAreaCSS)+FCKTools.GetStyleHtml(FCKConfig.EditorAreaStyles);};function _FCK_KeystrokeHandler_OnKeystroke(A,B){if (FCK.Status!=2) return false;if (FCK.EditMode==0){switch (B){case 'Paste':return!FCK.Paste();case 'Cut':FCKUndo.SaveUndoStep();return false;}}else{if (B.Equals('Paste','Undo','Redo','SelectAll','Cut')) return false;};var C=FCK.Commands.GetCommand(B);if (C.GetState()==-1) return false;return (C.Execute.apply(C,FCKTools.ArgumentsToArray(arguments,2))!==false);};(function(){var A=window.parent.document;var B=A.getElementById(FCK.Name);var i=0;while (B||i==0){if (B&&B.tagName.toLowerCase().Equals('input','textarea')){FCK.LinkedField=B;break;};B=A.getElementsByName(FCK.Name)[i++];}})();var FCKTempBin={Elements:[],AddElement:function(A){var B=this.Elements.length;this.Elements[B]=A;return B;},RemoveElement:function(A){var e=this.Elements[A];this.Elements[A]=null;return e;},Reset:function(){var i=0;while (i '+this.Elements[i].outerHTML+'';this.Elements[i].isHtml=true;}},ToElements:function(){var A=FCK.EditorDocument.createElement('div');for (var i=0;i0) C+='TABLE { behavior: '+B+' ; }';C+='';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){var A=FCK.EditorDocument.body;A.detachEvent('onpaste',Doc_OnPaste);var B=FCK.Paste(!FCKConfig.ForcePasteAsPlainText&&!FCKConfig.AutoDetectPasteFromWord);A.attachEvent('onpaste',Doc_OnPaste);return B;};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){if (!FCK.IsSelectionChangeLocked&&FCK.EditorDocument) FCK.Events.FireEvent("OnSelectionChange");};function Doc_OnDrop(){if (FCK.MouseDownFlag){FCK.MouseDownFlag=false;return;};if (FCKConfig.ForcePasteAsPlainText){var A=FCK.EditorWindow.event;if (FCK._CheckIsPastingEnabled()||FCKConfig.ShowDropDialog) FCK.PasteAsPlainText(A.dataTransfer.getData('Text'));A.returnValue=false;A.cancelBubble=true;}};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);this.EditorDocument.body.attachEvent('ondrop',Doc_OnDrop);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);this.EditorDocument.attachEvent("onkeydown",FCK._KeyDownListener);this.EditorDocument.attachEvent("ondblclick",Doc_OnDblClick);this.EditorDocument.attachEvent("onbeforedeactivate",function(){ FCKSelection.Save();});this.EditorDocument.attachEvent("onselectionchange",Doc_OnSelectionChange);FCKTools.AddEventListener(FCK.EditorDocument,'mousedown',Doc_OnMouseDown);};FCK.InsertHtml=function(A){A=FCKConfig.ProtectedSource.Protect(A);A=FCK.ProtectEvents(A);A=FCK.ProtectUrls(A);A=FCK.ProtectTags(A);FCKSelection.Restore();FCK.EditorWindow.focus();FCKUndo.SaveUndoStep();var B=FCKSelection.GetSelection();if (B.type.toLowerCase()=='control') B.clear();A=''+A;B.createRange().pasteHTML(A);var C=FCK.EditorDocument.getElementById('__fakeFCKRemove__');if (C.parentNode.childNodes.length==1) C=C.parentNode;C.removeNode(true);FCKDocumentProcessor.Process(FCK.EditorDocument);this.Events.FireEvent("OnSelectionChange");};FCK.SetInnerHtml=function(A){var B=FCK.EditorDocument;B.body.innerHTML='

     
    '+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};function FCK_PreloadImages(){var A=new FCKImagePreloader();A.AddImages(FCKConfig.PreloadImages);A.AddImages(FCKConfig.SkinPath+'fck_strip.gif');A.OnComplete=LoadToolbarSetup;A.Start();};function Document_OnContextMenu(){return (event.srcElement._FCKShowContextMenu==true);};document.oncontextmenu=Document_OnContextMenu;function FCK_Cleanup(){this.LinkedField=null;this.EditorWindow=null;this.EditorDocument=null;};FCK._ExecPaste=function(){if (FCK._PasteIsRunning) return true;if (FCKConfig.ForcePasteAsPlainText){FCK.PasteAsPlainText();return false;};var A=FCK._CheckIsPastingEnabled(true);if (A===false) FCKTools.RunFunction(FCKDialog.OpenDialog,FCKDialog,['FCKDialog_Paste',FCKLang.Paste,'dialog/fck_paste.html',400,330,'Security']);else{if (FCKConfig.AutoDetectPasteFromWord&&A.length>0){var B=/<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi;if (B.test(A)){if (confirm(FCKLang.PasteWordConfirm)){FCK.PasteFromWord();return false;}}};FCK._PasteIsRunning=true;FCK.ExecuteNamedCommand('Paste');delete FCK._PasteIsRunning;};return false;};FCK.PasteAsPlainText=function(A){if (!FCK._CheckIsPastingEnabled()){FCKDialog.OpenDialog('FCKDialog_Paste',FCKLang.PasteAsText,'dialog/fck_paste.html',400,330,'PlainText');return;};var B=null;if (!A) B=clipboardData.getData("Text");else B=A;if (B&&B.length>0){B=FCKTools.HTMLEncode(B);B=FCKTools.ProcessLineBreaks(window,FCKConfig,B);var C=B.search('

    ');var D=B.search('

    ');if ((C!=-1&&D!=-1&&C0){if (D){var F=this.EditorDocument.createElement('A');F.href=A;var G=E;G.parentNode.insertBefore(F,G);G.parentNode.removeChild(G);F.appendChild(G);return [F];};var H='javascript:void(0);/*'+(new Date().getTime())+'*/';FCK.ExecuteNamedCommand('CreateLink',H,false,!!B);var I=this.EditorDocument.links;for (i=0;i0&&!isNaN(E)) this.PageConfig[D]=parseFloat(E);else this.PageConfig[D]=E;}};function FCKConfig_LoadPageConfig(){var A=FCKConfig.PageConfig;for (var B in A) FCKConfig[B]=A[B];};function FCKConfig_PreProcess(){var A=FCKConfig;if (A.AllowQueryStringDebug){try{if ((/fckdebug=true/i).test(window.top.location.search)) A.Debug=true;}catch (e) { }};if (!A.PluginsPath.EndsWith('/')) A.PluginsPath+='/';var B=A.ToolbarComboPreviewCSS;if (!B||B.length==0) A.ToolbarComboPreviewCSS=A.EditorAreaCSS;A.RemoveAttributesArray=(A.RemoveAttributes||'').split(',');if (!FCKConfig.SkinEditorCSS||FCKConfig.SkinEditorCSS.length==0) FCKConfig.SkinEditorCSS=FCKConfig.SkinPath+'fck_editor.css';if (!FCKConfig.SkinDialogCSS||FCKConfig.SkinDialogCSS.length==0) FCKConfig.SkinDialogCSS=FCKConfig.SkinPath+'fck_dialog.css';};FCKConfig.ToolbarSets={};FCKConfig.Plugins={};FCKConfig.Plugins.Items=[];FCKConfig.Plugins.Add=function(A,B,C){FCKConfig.Plugins.Items.push([A,B,C]);};FCKConfig.ProtectedSource={};FCKConfig.ProtectedSource._CodeTag=(new Date()).valueOf();FCKConfig.ProtectedSource.RegexEntries=[//g,//gi,//gi];FCKConfig.ProtectedSource.Add=function(A){this.RegexEntries.push(A);};FCKConfig.ProtectedSource.Protect=function(A){var B=this._CodeTag;function _Replace(protectedSource){var C=FCKTempBin.AddElement(protectedSource);return '';};for (var i=0;i|>)","g");return A.replace(D,_Replace);};FCKConfig.GetBodyAttributes=function(){var A='';if (this.BodyId&&this.BodyId.length>0) A+=' id="'+this.BodyId+'"';if (this.BodyClass&&this.BodyClass.length>0) A+=' class="'+this.BodyClass+'"';return A;};FCKConfig.ApplyBodyAttributes=function(A){if (this.BodyId&&this.BodyId.length>0) A.id=FCKConfig.BodyId;if (this.BodyClass&&this.BodyClass.length>0) A.className+=' '+FCKConfig.BodyClass;}; var FCKDebug={Output:function(){},OutputObject:function(){}}; -var FCKDomTools={MoveChildren:function(A,B,C){if (A==B) return;var D;if (C){while ((D=A.lastChild)) B.insertBefore(A.removeChild(D),B.firstChild);}else{while ((D=A.firstChild)) B.appendChild(A.removeChild(D));}},MoveNode:function(A,B,C){if (C) B.insertBefore(FCKDomTools.RemoveNode(A),B.firstChild);else B.appendChild(FCKDomTools.RemoveNode(A));},TrimNode:function(A){this.LTrimNode(A);this.RTrimNode(A);},LTrimNode:function(A){var B;while ((B=A.firstChild)){if (B.nodeType==3){var C=B.nodeValue.LTrim();var D=B.nodeValue.length;if (C.length==0){A.removeChild(B);continue;}else if (C.length0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;}else if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E0) break;if (A.lastChild) A=A.lastChild;else return this.GetPreviousSourceElement(A,B,C,D);};return null;},GetNextSourceElement:function(A,B,C,D,E){while((A=this.GetNextSourceNode(A,E))){if (A.nodeType==1){if (C&&A.nodeName.IEquals(C)) break;if (D&&A.nodeName.IEquals(D)) return this.GetNextSourceElement(A,B,C,D);return A;}else if (B&&A.nodeType==3&&A.nodeValue.RTrim().length>0) break;};return null;},GetNextSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.firstChild) E=A.firstChild;else{if (D&&A==D) return null;E=A.nextSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetNextSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetNextSourceNode(E,false,C,D);return E;},GetPreviousSourceNode:function(A,B,C,D){if (!A) return null;var E;if (!B&&A.lastChild) E=A.lastChild;else{if (D&&A==D) return null;E=A.previousSibling;if (!E&&(!D||D!=A.parentNode)) return this.GetPreviousSourceNode(A.parentNode,true,C,D);};if (C&&E&&E.nodeType!=C) return this.GetPreviousSourceNode(E,false,C,D);return E;},InsertAfterNode:function(A,B){return A.parentNode.insertBefore(B,A.nextSibling);},GetParents:function(A){var B=[];while (A){B.unshift(A);A=A.parentNode;};return B;},GetCommonParents:function(A,B){var C=this.GetParents(A);var D=this.GetParents(B);var E=[];for (var i=0;i0) D[C.pop().toLowerCase()]=1;var E=this.GetCommonParents(A,B);var F=null;while ((F=E.pop())){if (D[F.nodeName.toLowerCase()]) return F;};return null;},GetIndexOf:function(A){var B=A.parentNode?A.parentNode.firstChild:null;var C=-1;while (B){C++;if (B==A) return C;B=B.nextSibling;};return-1;},PaddingNode:null,EnforcePaddingNode:function(A,B){try{if (!A||!A.body) return;}catch (e){return;};this.CheckAndRemovePaddingNode(A,B,true);try{if (A.body.lastChild&&(A.body.lastChild.nodeType!=1||A.body.lastChild.tagName.toLowerCase()==B.toLowerCase())) return;}catch (e){return;};var C=A.createElement(B);if (FCKBrowserInfo.IsGecko&&FCKListsLib.NonEmptyBlockElements[B]) FCKTools.AppendBogusBr(C);this.PaddingNode=C;if (A.body.childNodes.length==1&&A.body.firstChild.nodeType==1&&A.body.firstChild.tagName.toLowerCase()=='br'&&(A.body.firstChild.getAttribute('_moz_dirty')!=null||A.body.firstChild.getAttribute('type')=='_moz')) A.body.replaceChild(C,A.body.firstChild);else A.body.appendChild(C);},CheckAndRemovePaddingNode:function(A,B,C){var D=this.PaddingNode;if (!D) return;try{if (D.parentNode!=A.body||D.tagName.toLowerCase()!=B||(D.childNodes.length>1)||(D.firstChild&&D.firstChild.nodeValue!='\xa0'&&String(D.firstChild.tagName).toLowerCase()!='br')){this.PaddingNode=null;return;}}catch (e){this.PaddingNode=null;return;};if (!C){if (D.parentNode.childNodes.length>1) D.parentNode.removeChild(D);this.PaddingNode=null;}},HasAttribute:function(A,B){if (A.hasAttribute) return A.hasAttribute(B);else{var C=A.attributes[B];return (C!=undefined&&C.specified);}},HasAttributes:function(A){var B=A.attributes;for (var i=0;i0) return true;continue;}};if (B[i].specified) return true;};return false;},RemoveAttribute:function(A,B){if (FCKBrowserInfo.IsIE&&B.toLowerCase()=='class') B='className';return A.removeAttribute(B,0);},RemoveAttributes:function (A,B){for (var i=0;i0) return false;C=C.nextSibling;};return D?this.CheckIsEmptyElement(D,B):true;},SetElementStyles:function(A,B){var C=A.style;for (var D in B) C[D]=B[D];},SetOpacity:function(A,B){if (FCKBrowserInfo.IsIE){B=Math.round(B*100);A.style.filter=(B>100?'':'progid:DXImageTransform.Microsoft.Alpha(opacity='+B+')');}else A.style.opacity=B;},GetCurrentElementStyle:function(A,B){if (FCKBrowserInfo.IsIE) return A.currentStyle[B];else return A.ownerDocument.defaultView.getComputedStyle(A,'').getPropertyValue(B);},GetPositionedAncestor:function(A){var B=A;while (B!=FCKTools.GetElementDocument(B).documentElement){if (this.GetCurrentElementStyle(B,'position')!='static') return B;if (B==FCKTools.GetElementDocument(B).documentElement&¤tWindow!=w) B=currentWindow.frameElement;else B=B.parentNode;};return null;},ScrollIntoView:function(A,B){var C=FCKTools.GetElementWindow(A);var D=FCKTools.GetViewPaneSize(C).Height;var E=D*-1;if (B===false){E+=A.offsetHeight||0;E+=parseInt(this.GetCurrentElementStyle(A,'marginBottom')||0,10)||0;};var F=FCKTools.GetDocumentPosition(C,A);E+=F.y;var G=FCKTools.GetScrollPosition(C).Y;if (E>0&&(E>G||E'+styleDef+'';};var C=function(cssFileUrl,markTemp){if (cssFileUrl.length==0) return '';var B=markTemp?' _fcktemp="true"':'';return '';};return function(cssFileOrArrayOrDef,markTemp){if (!cssFileOrArrayOrDef) return '';if (typeof(cssFileOrArrayOrDef)=='string'){if (/[\\\/\.][^{}]*$/.test(cssFileOrArrayOrDef)){return this.GetStyleHtml(cssFileOrArrayOrDef.split(','),markTemp);}else return A(this._GetUrlFixedCss(cssFileOrArrayOrDef),markTemp);}else{var E='';for (var i=0;i/g,'>');return A;};FCKTools.HTMLDecode=function(A){if (!A) return '';A=A.replace(/>/g,'>');A=A.replace(/</g,'<');A=A.replace(/&/g,'&');return A;};FCKTools._ProcessLineBreaksForPMode=function(A,B,C,D,E){var F=0;var G="

    ";var H="

    ";var I="
    ";if (C){G="
  • ";H="
  • ";F=1;}while (D&&D!=A.FCK.EditorDocument.body){if (D.tagName.toLowerCase()=='p'){F=1;break;};D=D.parentNode;};for (var i=0;i0) return A[A.length-1];return null;};FCKTools.GetDocumentPosition=function(w,A){var x=0;var y=0;var B=A;var C=null;var D=FCKTools.GetElementWindow(B);while (B&&!(D==w&&(B==w.document.body||B==w.document.documentElement))){x+=B.offsetLeft-B.scrollLeft;y+=B.offsetTop-B.scrollTop;if (!FCKBrowserInfo.IsOpera){var E=C;while (E&&E!=B){x-=E.scrollLeft;y-=E.scrollTop;E=E.parentNode;}};C=B;if (B.offsetParent) B=B.offsetParent;else{if (D!=w){B=D.frameElement;C=null;if (B) D=B.contentWindow.parent;}else B=null;}};if (FCKDomTools.GetCurrentElementStyle(w.document.body,'position')!='static'||(FCKBrowserInfo.IsIE&&FCKDomTools.GetPositionedAncestor(A)==null)){x+=w.document.body.offsetLeft;y+=w.document.body.offsetTop;};return { "x":x,"y":y };};FCKTools.GetWindowPosition=function(w,A){var B=this.GetDocumentPosition(w,A);var C=FCKTools.GetScrollPosition(w);B.x-=C.X;B.y-=C.Y;return B;};FCKTools.ProtectFormStyles=function(A){if (!A||A.nodeType!=1||A.tagName.toLowerCase()!='form') return [];var B=[];var C=['style','className'];for (var i=0;i0){for (var i=B.length-1;i>=0;i--){var C=B[i][0];var D=B[i][1];if (D) A.insertBefore(C,D);else A.appendChild(C);}}};FCKTools.GetNextNode=function(A,B){if (A.firstChild) return A.firstChild;else if (A.nextSibling) return A.nextSibling;else{var C=A.parentNode;while (C){if (C==B) return null;if (C.nextSibling) return C.nextSibling;else C=C.parentNode;}};return null;};FCKTools.GetNextTextNode=function(A,B,C){node=this.GetNextNode(A,B);if (C&&node&&C(node)) return null;while (node&&node.nodeType!=3){node=this.GetNextNode(node,B);if (C&&node&&C(node)) return null;};return node;};FCKTools.Merge=function(){var A=arguments;var o=A[0];for (var i=1;i');document.domain = '"+FCK_RUNTIME_DOMAIN+"';document.close();}() ) ;";if (FCKBrowserInfo.IsIE){if (FCKBrowserInfo.IsIE7||!FCKBrowserInfo.IsIE6) return "";else return "javascript: '';";};return "javascript: void(0);";};FCKTools.ResetStyles=function(A){A.style.cssText='margin:0;padding:0;border:0;background-color:transparent;background-image:none;';}; FCKTools.CancelEvent=function(e){return false;};FCKTools._AppendStyleSheet=function(A,B){return A.createStyleSheet(B).owningElement;};FCKTools.AppendStyleString=function(A,B){if (!B) return null;var s=A.createStyleSheet("");s.cssText=B;return s;};FCKTools.ClearElementAttributes=function(A){A.clearAttributes();};FCKTools.GetAllChildrenIds=function(A){var B=[];for (var i=0;i0) B[B.length]=C;};return B;};FCKTools.RemoveOuterTags=function(e){e.insertAdjacentHTML('beforeBegin',e.innerHTML);e.parentNode.removeChild(e);};FCKTools.CreateXmlObject=function(A){var B;switch (A){case 'XmlHttp':if (document.location.protocol!='file:') try { return new XMLHttpRequest();} catch (e) {};B=['MSXML2.XmlHttp','Microsoft.XmlHttp'];break;case 'DOMDocument':B=['MSXML2.DOMDocument','Microsoft.XmlDom'];break;};for (var i=0;i<2;i++){try { return new ActiveXObject(B[i]);}catch (e){}};if (FCKLang.NoActiveX){alert(FCKLang.NoActiveX);FCKLang.NoActiveX=null;};return null;};FCKTools.DisableSelection=function(A){A.unselectable='on';var e,i=0;while ((e=A.all[i++])){switch (e.tagName){case 'IFRAME':case 'TEXTAREA':case 'INPUT':case 'SELECT':break;default:e.unselectable='on';}}};FCKTools.GetScrollPosition=function(A){var B=A.document;var C={ X:B.documentElement.scrollLeft,Y:B.documentElement.scrollTop };if (C.X>0||C.Y>0) return C;return { X:B.body.scrollLeft,Y:B.body.scrollTop };};FCKTools.AddEventListener=function(A,B,C){A.attachEvent('on'+B,C);};FCKTools.RemoveEventListener=function(A,B,C){A.detachEvent('on'+B,C);};FCKTools.AddEventListenerEx=function(A,B,C,D){var o={};o.Source=A;o.Params=D||[];o.Listener=function(ev){return C.apply(o.Source,[ev].concat(o.Params));};if (FCK.IECleanup) FCK.IECleanup.AddItem(null,function() { o.Source=null;o.Params=null;});A.attachEvent('on'+B,o.Listener);A=null;D=null;};FCKTools.GetViewPaneSize=function(A){var B;var C=A.document.documentElement;if (C&&C.clientWidth) B=C;else B=A.document.body;if (B) return { Width:B.clientWidth,Height:B.clientHeight };else return { Width:0,Height:0 };};FCKTools.SaveStyles=function(A){var B=FCKTools.ProtectFormStyles(A);var C={};if (A.className.length>0){C.Class=A.className;A.className='';};var D=A.style.cssText;if (D.length>0){C.Inline=D;A.style.cssText='';};FCKTools.RestoreFormStyles(A,B);return C;};FCKTools.RestoreStyles=function(A,B){var C=FCKTools.ProtectFormStyles(A);A.className=B.Class||'';A.style.cssText=B.Inline||'';FCKTools.RestoreFormStyles(A,C);};FCKTools.RegisterDollarFunction=function(A){A.$=A.document.getElementById;};FCKTools.AppendElement=function(A,B){return A.appendChild(this.GetElementDocument(A).createElement(B));};FCKTools.ToLowerCase=function(A){return A.toLowerCase();}; -var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23195",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); +var FCKeditorAPI;function InitializeAPI(){var A=window.parent;if (!(FCKeditorAPI=A.FCKeditorAPI)){var B='window.FCKeditorAPI = {Version : "2.6.4.1",VersionBuild : "23405",Instances : window.FCKeditorAPI && window.FCKeditorAPI.Instances || {},GetInstance : function( name ){return this.Instances[ name ];},_FormSubmit : function(){for ( var name in FCKeditorAPI.Instances ){var oEditor = FCKeditorAPI.Instances[ name ] ;if ( oEditor.GetParentForm && oEditor.GetParentForm() == this )oEditor.UpdateLinkedField() ;}this._FCKOriginalSubmit() ;},_FunctionQueue : window.FCKeditorAPI && window.FCKeditorAPI._FunctionQueue || {Functions : new Array(),IsRunning : false,Add : function( f ){this.Functions.push( f );if ( !this.IsRunning )this.StartNext();},StartNext : function(){var aQueue = this.Functions ;if ( aQueue.length > 0 ){this.IsRunning = true;aQueue[0].call();}else this.IsRunning = false;},Remove : function( f ){var aQueue = this.Functions;var i = 0, fFunc;while( (fFunc = aQueue[ i ]) ){if ( fFunc == f )aQueue.splice( i,1 );i++ ;}this.StartNext();}}}';if (A.execScript) A.execScript(B,'JavaScript');else{if (FCKBrowserInfo.IsGecko10){eval.call(A,B);}else if(FCKBrowserInfo.IsAIR){FCKAdobeAIR.FCKeditorAPI_Evaluate(A,B);}else if (FCKBrowserInfo.IsSafari){var C=A.document;var D=C.createElement('script');D.appendChild(C.createTextNode(B));C.documentElement.appendChild(D);}else A.eval(B);};FCKeditorAPI=A.FCKeditorAPI;FCKeditorAPI.__Instances=FCKeditorAPI.Instances;};FCKeditorAPI.Instances[FCK.Name]=FCK;};function _AttachFormSubmitToAPI(){var A=FCK.GetParentForm();if (A){FCKTools.AddEventListener(A,'submit',FCK.UpdateLinkedField);if (!A._FCKOriginalSubmit&&(typeof(A.submit)=='function'||(!A.submit.tagName&&!A.submit.length))){A._FCKOriginalSubmit=A.submit;A.submit=FCKeditorAPI._FormSubmit;}}};function FCKeditorAPI_Cleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat&&!window.FCKUnloadFlag) return;delete FCKeditorAPI.Instances[FCK.Name];};function FCKeditorAPI_ConfirmCleanup(){if (window.FCKConfig&&FCKConfig.MsWebBrowserControlCompat) window.FCKUnloadFlag=true;};FCKTools.AddEventListener(window,'unload',FCKeditorAPI_Cleanup);FCKTools.AddEventListener(window,'beforeunload',FCKeditorAPI_ConfirmCleanup); var FCKImagePreloader=function(){this._Images=[];};FCKImagePreloader.prototype={AddImages:function(A){if (typeof(A)=='string') A=A.split(';');this._Images=this._Images.concat(A);},Start:function(){var A=this._Images;this._PreloadCount=A.length;for (var i=0;i]*\>)/i,AfterBody:/(\<\/body\>[\s\S]*$)/i,ToReplace:/___fcktoreplace:([\w]+)/ig,MetaHttpEquiv:/http-equiv\s*=\s*["']?([^"' ]+)/i,HasBaseTag:/]/i,HtmlOpener:/]*>/i,HeadOpener:/]*>/i,HeadCloser:/<\/head\s*>/i,FCK_Class:/\s*FCK__[^ ]*(?=\s+|$)/,ElementName:/(^[a-z_:][\w.\-:]*\w$)|(^[a-z_]$)/,ForceSimpleAmpersand:/___FCKAmp___/g,SpaceNoClose:/\/>/g,EmptyParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>\s*(<\/\1>)?$/,EmptyOutParagraph:/^<(p|div|address|h\d|center)(?=[ >])[^>]*>(?:\s*| | )(<\/\1>)?$/,TagBody:/>]+))/gi,ProtectUrlsA:/]+))/gi,ProtectUrlsArea:/]+))/gi,Html4DocType:/HTML 4\.0 Transitional/i,DocTypeTag:/]*>/i,HtmlDocType:/DTD HTML/,TagsWithEvent:/<[^\>]+ on\w+[\s\r\n]*=[\s\r\n]*?('|")[\s\S]+?\>/g,EventAttributes:/\s(on\w+)[\s\r\n]*=[\s\r\n]*?('|")([\s\S]*?)\2/g,ProtectedEvents:/\s\w+_fckprotectedatt="([^"]+)"/g,StyleProperties:/\S+\s*:/g,InvalidSelfCloseTags:/(<(?!base|meta|link|hr|br|param|img|area|input)([a-zA-Z0-9:]+)[^>]*)\/>/gi,StyleVariableAttName:/#\(\s*("|')(.+?)\1[^\)]*\s*\)/g,RegExp:/^\/(.*)\/([gim]*)$/,HtmlTag:/<[^\s<>](?:"[^"]*"|'[^']*'|[^<])*>/}; var FCKListsLib={BlockElements:{ address:1,blockquote:1,center:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,marquee:1,noscript:1,ol:1,p:1,pre:1,script:1,table:1,ul:1 },NonEmptyBlockElements:{ p:1,div:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,address:1,pre:1,ol:1,ul:1,li:1,td:1,th:1 },InlineChildReqElements:{ abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },InlineNonEmptyElements:{ a:1,abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,'var':1 },EmptyElements:{ base:1,col:1,meta:1,link:1,hr:1,br:1,param:1,img:1,area:1,input:1 },PathBlockElements:{ address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1 },PathBlockLimitElements:{ body:1,div:1,td:1,th:1,caption:1,form:1 },StyleBlockElements:{ address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1 },StyleObjectElements:{ img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1 },NonEditableElements:{ button:1,option:1,script:1,iframe:1,textarea:1,object:1,embed:1,map:1,applet:1 },BlockBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1 },ListBoundaries:{ p:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,address:1,pre:1,ol:1,ul:1,li:1,dt:1,de:1,table:1,thead:1,tbody:1,tfoot:1,tr:1,th:1,td:1,caption:1,col:1,colgroup:1,blockquote:1,body:1,br:1 }}; var FCKLanguageManager=FCK.Language={AvailableLanguages:{af:'Afrikaans',ar:'Arabic',bg:'Bulgarian',bn:'Bengali/Bangla',bs:'Bosnian',ca:'Catalan',cs:'Czech',da:'Danish',de:'German',el:'Greek',en:'English','en-au':'English (Australia)','en-ca':'English (Canadian)','en-uk':'English (United Kingdom)',eo:'Esperanto',es:'Spanish',et:'Estonian',eu:'Basque',fa:'Persian',fi:'Finnish',fo:'Faroese',fr:'French','fr-ca':'French (Canada)',gl:'Galician',gu:'Gujarati',he:'Hebrew',hi:'Hindi',hr:'Croatian',hu:'Hungarian',is:'Icelandic',it:'Italian',ja:'Japanese',km:'Khmer',ko:'Korean',lt:'Lithuanian',lv:'Latvian',mn:'Mongolian',ms:'Malay',nb:'Norwegian Bokmal',nl:'Dutch',no:'Norwegian',pl:'Polish',pt:'Portuguese (Portugal)','pt-br':'Portuguese (Brazil)',ro:'Romanian',ru:'Russian',sk:'Slovak',sl:'Slovenian',sr:'Serbian (Cyrillic)','sr-latn':'Serbian (Latin)',sv:'Swedish',th:'Thai',tr:'Turkish',uk:'Ukrainian',vi:'Vietnamese',zh:'Chinese Traditional','zh-cn':'Chinese Simplified'},GetActiveLanguage:function(){if (FCKConfig.AutoDetectLanguage){var A;if (navigator.userLanguage) A=navigator.userLanguage.toLowerCase();else if (navigator.language) A=navigator.language.toLowerCase();else{return FCKConfig.DefaultLanguage;};if (A.length>=5){A=A.substr(0,5);if (this.AvailableLanguages[A]) return A;};if (A.length>=2){A=A.substr(0,2);if (this.AvailableLanguages[A]) return A;}};return this.DefaultLanguage;},TranslateElements:function(A,B,C,D){var e=A.getElementsByTagName(B);var E,s;for (var i=0;i':'gt','ˆ':'circ','˜':'tilde',' ':'ensp',' ':'emsp',' ':'thinsp','‌':'zwnj','‍':'zwj','‎':'lrm','‏':'rlm','–':'ndash','—':'mdash','‘':'lsquo','’':'rsquo','‚':'sbquo','“':'ldquo','”':'rdquo','„':'bdquo','†':'dagger','‡':'Dagger','‰':'permil','‹':'lsaquo','›':'rsaquo','€':'euro'};for (e in FCKXHtmlEntities.Entities) A+=e;if (FCKConfig.IncludeLatinEntities){B={'À':'Agrave','Á':'Aacute','Â':'Acirc','Ã':'Atilde','Ä':'Auml','Å':'Aring','Æ':'AElig','Ç':'Ccedil','È':'Egrave','É':'Eacute','Ê':'Ecirc','Ë':'Euml','Ì':'Igrave','Í':'Iacute','Î':'Icirc','Ï':'Iuml','Ð':'ETH','Ñ':'Ntilde','Ò':'Ograve','Ó':'Oacute','Ô':'Ocirc','Õ':'Otilde','Ö':'Ouml','Ø':'Oslash','Ù':'Ugrave','Ú':'Uacute','Û':'Ucirc','Ü':'Uuml','Ý':'Yacute','Þ':'THORN','ß':'szlig','à':'agrave','á':'aacute','â':'acirc','ã':'atilde','ä':'auml','å':'aring','æ':'aelig','ç':'ccedil','è':'egrave','é':'eacute','ê':'ecirc','ë':'euml','ì':'igrave','í':'iacute','î':'icirc','ï':'iuml','ð':'eth','ñ':'ntilde','ò':'ograve','ó':'oacute','ô':'ocirc','õ':'otilde','ö':'ouml','ø':'oslash','ù':'ugrave','ú':'uacute','û':'ucirc','ü':'uuml','ý':'yacute','þ':'thorn','ÿ':'yuml','Œ':'OElig','œ':'oelig','Š':'Scaron','š':'scaron','Ÿ':'Yuml'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;};if (FCKConfig.IncludeGreekEntities){B={'Α':'Alpha','Β':'Beta','Γ':'Gamma','Δ':'Delta','Ε':'Epsilon','Ζ':'Zeta','Η':'Eta','Θ':'Theta','Ι':'Iota','Κ':'Kappa','Λ':'Lambda','Μ':'Mu','Ν':'Nu','Ξ':'Xi','Ο':'Omicron','Π':'Pi','Ρ':'Rho','Σ':'Sigma','Τ':'Tau','Υ':'Upsilon','Φ':'Phi','Χ':'Chi','Ψ':'Psi','Ω':'Omega','α':'alpha','β':'beta','γ':'gamma','δ':'delta','ε':'epsilon','ζ':'zeta','η':'eta','θ':'theta','ι':'iota','κ':'kappa','λ':'lambda','μ':'mu','ν':'nu','ξ':'xi','ο':'omicron','π':'pi','ρ':'rho','ς':'sigmaf','σ':'sigma','τ':'tau','υ':'upsilon','φ':'phi','χ':'chi','ψ':'psi','ω':'omega','\u03d1':'thetasym','\u03d2':'upsih','\u03d6':'piv'};for (e in B){FCKXHtmlEntities.Entities[e]=B[e];A+=e;};B=null;}}else{FCKXHtmlEntities.Entities={'>':'gt'};A='>';A+=' ';};var C='['+A+']';if (FCKConfig.ProcessNumericEntities) C='[^ -~]|'+C;var D=FCKConfig.AdditionalNumericEntities;if (D&&D.length>0) C+='|'+FCKConfig.AdditionalNumericEntities;FCKXHtmlEntities.EntitiesRegex=new RegExp(C,'g');}; -var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; -FCKXHtml._GetMainXmlString=function(){return this.MainNode.xml;};FCKXHtml._AppendAttributes=function(A,B,C,D){var E=B.attributes,bHasStyle;for (var n=0;n0){var I=FCKTools.ProtectFormStyles(B);var J=B.style.cssText.replace(FCKRegexLib.StyleProperties,FCKTools.ToLowerCase);FCKTools.RestoreFormStyles(B,I);this._AppendAttribute(C,'style',J);}};FCKXHtml.TagProcessors['div']=function(A,B){if (B.align.length>0) FCKXHtml._AppendAttribute(A,'align',B.align);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['font']=function(A,B){if (A.attributes.length==0) A=FCKXHtml.XML.createDocumentFragment();A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['form']=function(A,B){if (B.acceptCharset&&B.acceptCharset.length>0&&B.acceptCharset!='UNKNOWN') FCKXHtml._AppendAttribute(A,'accept-charset',B.acceptCharset);var C=B.attributes['name'];if (C&&C.value.length>0) FCKXHtml._AppendAttribute(A,'name',C.value);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['input']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);if (B.value&&!A.attributes.getNamedItem('value')) FCKXHtml._AppendAttribute(A,'value',B.value);if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text');return A;};FCKXHtml.TagProcessors['label']=function(A,B){if (B.htmlFor.length>0) FCKXHtml._AppendAttribute(A,'for',B.htmlFor);A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['map']=function(A,B){if (!A.attributes.getNamedItem('name')){var C=B.name;if (C) FCKXHtml._AppendAttribute(A,'name',C);};A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['meta']=function(A,B){var C=A.attributes.getNamedItem('http-equiv');if (C==null||C.value.length==0){var D=B.outerHTML.match(FCKRegexLib.MetaHttpEquiv);if (D){D=D[1];FCKXHtml._AppendAttribute(A,'http-equiv',D);}};return A;};FCKXHtml.TagProcessors['option']=function(A,B){if (B.selected&&!A.attributes.getNamedItem('selected')) FCKXHtml._AppendAttribute(A,'selected','selected');A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['textarea']=FCKXHtml.TagProcessors['select']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);A=FCKXHtml._AppendChildNodes(A,B);return A;}; +var FCKXHtml={};FCKXHtml.CurrentJobNum=0;FCKXHtml.GetXHTML=function(A,B,C){FCKDomTools.CheckAndRemovePaddingNode(FCKTools.GetElementDocument(A),FCKConfig.EnterMode);FCKXHtmlEntities.Initialize();this._NbspEntity=(FCKConfig.ProcessHTMLEntities?'nbsp':'#160');var D=FCK.IsDirty();FCKXHtml.SpecialBlocks=[];this.XML=FCKTools.CreateXmlObject('DOMDocument');this.MainNode=this.XML.appendChild(this.XML.createElement('xhtml'));FCKXHtml.CurrentJobNum++;if (B) this._AppendNode(this.MainNode,A);else this._AppendChildNodes(this.MainNode,A,false);if (FCKBrowserInfo.IsIE) FCKXHtml._RemoveXHtmlJobProperties(A);var E=this._GetMainXmlString();this.XML=null;if (FCKBrowserInfo.IsSafari) E=E.replace(/^/,'');E=E.substr(7,E.length-15).Trim();if (FCKConfig.DocType.length>0&&FCKRegexLib.HtmlDocType.test(FCKConfig.DocType)) E=E.replace(FCKRegexLib.SpaceNoClose,'>');else E=E.replace(FCKRegexLib.SpaceNoClose,' />');if (FCKConfig.ForceSimpleAmpersand) E=E.replace(FCKRegexLib.ForceSimpleAmpersand,'&');if (C) E=FCKCodeFormatter.Format(E);for (var i=0;i0;if (C) A.appendChild(this.XML.createTextNode(B.replace(FCKXHtmlEntities.EntitiesRegex,FCKXHtml_GetEntity)));return C;};function FCKXHtml_GetEntity(A){var B=FCKXHtmlEntities.Entities[A]||('#'+A.charCodeAt(0));return '#?-:'+B+';';};FCKXHtml.TagProcessors={a:function(A,B){if (B.innerHTML.Trim().length==0&&!B.name) return false;var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);};A=FCKXHtml._AppendChildNodes(A,B,false);return A;},area:function(A,B){var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'href',C);if (FCKBrowserInfo.IsIE){if (!A.attributes.getNamedItem('coords')){var D=B.getAttribute('coords',2);if (D&&D!='0,0,0') FCKXHtml._AppendAttribute(A,'coords',D);};if (!A.attributes.getNamedItem('shape')){var E=B.getAttribute('shape',2);if (E&&E.length>0) FCKXHtml._AppendAttribute(A,'shape',E.toLowerCase());}};return A;},body:function(A,B){A=FCKXHtml._AppendChildNodes(A,B,false);A.removeAttribute('spellcheck');return A;},iframe:function(A,B){var C=B.innerHTML;if (FCKBrowserInfo.IsGecko) C=FCKTools.HTMLDecode(C);C=C.replace(/\s_fcksavedurl="[^"]*"/g,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},img:function(A,B){if (!A.attributes.getNamedItem('alt')) FCKXHtml._AppendAttribute(A,'alt','');var C=B.getAttribute('_fcksavedurl');if (C!=null) FCKXHtml._AppendAttribute(A,'src',C);if (B.style.width) A.removeAttribute('width');if (B.style.height) A.removeAttribute('height');return A;},li:function(A,B,C){if (C.nodeName.IEquals(['ul','ol'])) return FCKXHtml._AppendChildNodes(A,B,true);var D=FCKXHtml.XML.createElement('ul');B._fckxhtmljob=null;do{FCKXHtml._AppendNode(D,B);do{B=FCKDomTools.GetNextSibling(B);} while (B&&B.nodeType==3&&B.nodeValue.Trim().length==0)} while (B&&B.nodeName.toLowerCase()=='li') return D;},ol:function(A,B,C){if (B.innerHTML.Trim().length==0) return false;var D=C.lastChild;if (D&&D.nodeType==3) D=D.previousSibling;if (D&&D.nodeName.toUpperCase()=='LI'){B._fckxhtmljob=null;FCKXHtml._AppendNode(D,B);return false;};A=FCKXHtml._AppendChildNodes(A,B);return A;},pre:function (A,B){var C=B.firstChild;if (C&&C.nodeType==3) A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem('\r\n')));FCKXHtml._AppendChildNodes(A,B,true);return A;},script:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/javascript');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(B.text)));return A;},span:function(A,B){if (B.innerHTML.length==0) return false;A=FCKXHtml._AppendChildNodes(A,B,false);return A;},style:function(A,B){if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text/css');var C=B.innerHTML;if (FCKBrowserInfo.IsIE) C=C.replace(/^(\r\n|\n|\r)/,'');A.appendChild(FCKXHtml.XML.createTextNode(FCKXHtml._AppendSpecialItem(C)));return A;},title:function(A,B){A.appendChild(FCKXHtml.XML.createTextNode(FCK.EditorDocument.title));return A;}};FCKXHtml.TagProcessors.ul=FCKXHtml.TagProcessors.ol; +FCKXHtml._GetMainXmlString=function(){return this.MainNode.xml;};FCKXHtml._AppendAttributes=function(A,B,C,D){var E=B.attributes,bHasStyle;for (var n=0;n0){var I=FCKTools.ProtectFormStyles(B);var J=B.style.cssText.replace(FCKRegexLib.StyleProperties,FCKTools.ToLowerCase);FCKTools.RestoreFormStyles(B,I);this._AppendAttribute(C,'style',J);}};FCKXHtml._RemoveXHtmlJobProperties=function (A){if (!A||!A.nodeType||A.nodeType!=1) return;if (typeof A._fckxhtmljob!=='undefined') A.removeAttribute('_fckxhtmljob');if (A.hasChildNodes()){var B=A.childNodes;for (var i=B.length-1;i>=0;i--) FCKXHtml._RemoveXHtmlJobProperties(B.item(i));}};FCKXHtml.TagProcessors['div']=function(A,B){if (B.align.length>0) FCKXHtml._AppendAttribute(A,'align',B.align);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['font']=function(A,B){if (A.attributes.length==0) A=FCKXHtml.XML.createDocumentFragment();A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['form']=function(A,B){if (B.acceptCharset&&B.acceptCharset.length>0&&B.acceptCharset!='UNKNOWN') FCKXHtml._AppendAttribute(A,'accept-charset',B.acceptCharset);var C=B.attributes['name'];if (C&&C.value.length>0) FCKXHtml._AppendAttribute(A,'name',C.value);A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['input']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);if (B.value&&!A.attributes.getNamedItem('value')) FCKXHtml._AppendAttribute(A,'value',B.value);if (!A.attributes.getNamedItem('type')) FCKXHtml._AppendAttribute(A,'type','text');return A;};FCKXHtml.TagProcessors['label']=function(A,B){if (B.htmlFor.length>0) FCKXHtml._AppendAttribute(A,'for',B.htmlFor);A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['map']=function(A,B){if (!A.attributes.getNamedItem('name')){var C=B.name;if (C) FCKXHtml._AppendAttribute(A,'name',C);};A=FCKXHtml._AppendChildNodes(A,B,true);return A;};FCKXHtml.TagProcessors['meta']=function(A,B){var C=A.attributes.getNamedItem('http-equiv');if (C==null||C.value.length==0){var D=B.outerHTML.match(FCKRegexLib.MetaHttpEquiv);if (D){D=D[1];FCKXHtml._AppendAttribute(A,'http-equiv',D);}};return A;};FCKXHtml.TagProcessors['option']=function(A,B){if (B.selected&&!A.attributes.getNamedItem('selected')) FCKXHtml._AppendAttribute(A,'selected','selected');A=FCKXHtml._AppendChildNodes(A,B);return A;};FCKXHtml.TagProcessors['textarea']=FCKXHtml.TagProcessors['select']=function(A,B){if (B.name) FCKXHtml._AppendAttribute(A,'name',B.name);A=FCKXHtml._AppendChildNodes(A,B);return A;}; var FCKCodeFormatter={};FCKCodeFormatter.Init=function(){var A=this.Regex={};A.BlocksOpener=/\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DL|DT|DD|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.BlocksCloser=/\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|DL|DT|DD|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi;A.NewLineTags=/\<(BR|HR)[^\>]*\>/gi;A.MainTags=/\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi;A.LineSplitter=/\s*\n+\s*/g;A.IncreaseIndent=/^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \/\>]/i;A.DecreaseIndent=/^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL|DL)[ \>]/i;A.FormatIndentatorRemove=new RegExp('^'+FCKConfig.FormatIndentator);A.ProtectedTags=/(]*>)([\s\S]*?)(<\/PRE>)/gi;};FCKCodeFormatter._ProtectData=function(A,B,C,D){return B+'___FCKpd___'+(FCKCodeFormatter.ProtectedData.push(C)-1)+D;};FCKCodeFormatter.Format=function(A){if (!this.Regex) this.Init();FCKCodeFormatter.ProtectedData=[];var B=A.replace(this.Regex.ProtectedTags,FCKCodeFormatter._ProtectData);B=B.replace(this.Regex.BlocksOpener,'\n$&');B=B.replace(this.Regex.BlocksCloser,'$&\n');B=B.replace(this.Regex.NewLineTags,'$&\n');B=B.replace(this.Regex.MainTags,'\n$&\n');var C='';var D=B.split(this.Regex.LineSplitter);B='';for (var i=0;iB[i]) return 1;};if (A.lengthB.length) return 1;return 0;};FCKUndo._CheckIsBookmarksEqual=function(A,B){if (!(A&&B)) return false;if (FCKBrowserInfo.IsIE){var C=A[1].search(A[0].StartId);var D=B[1].search(B[0].StartId);var E=A[1].search(A[0].EndId);var F=B[1].search(B[0].EndId);return C==D&&E==F;}else{return this._CompareCursors(A.Start,B.Start)==0&&this._CompareCursors(A.End,B.End)==0;}};FCKUndo.SaveUndoStep=function(){if (FCK.EditMode!=0||this.SaveLocked) return;if (this.SavedData.length) this.Changed=true;var A=FCK.EditorDocument.body.innerHTML;var B=this._GetBookmark();this.SavedData=this.SavedData.slice(0,this.CurrentIndex+1);if (this.CurrentIndex>0&&A==this.SavedData[this.CurrentIndex][0]&&this._CheckIsBookmarksEqual(B,this.SavedData[this.CurrentIndex][1])) return;else if (this.CurrentIndex==0&&this.SavedData.length&&A==this.SavedData[0][0]){this.SavedData[0][1]=B;return;};if (this.CurrentIndex+1>=FCKConfig.MaxUndoLevels) this.SavedData.shift();else this.CurrentIndex++;this.SavedData[this.CurrentIndex]=[A,B];FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.CheckUndoState=function(){return (this.Changed||this.CurrentIndex>0);};FCKUndo.CheckRedoState=function(){return (this.CurrentIndex<(this.SavedData.length-1));};FCKUndo.Undo=function(){if (this.CheckUndoState()){if (this.CurrentIndex==(this.SavedData.length-1)){this.SaveUndoStep();};this._ApplyUndoLevel(--this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo.Redo=function(){if (this.CheckRedoState()){this._ApplyUndoLevel(++this.CurrentIndex);FCK.Events.FireEvent("OnSelectionChange");}};FCKUndo._ApplyUndoLevel=function(A){var B=this.SavedData[A];if (!B) return;if (FCKBrowserInfo.IsIE){if (B[1]&&B[1][1]) FCK.SetInnerHtml(B[1][1]);else FCK.SetInnerHtml(B[0]);}else FCK.EditorDocument.body.innerHTML=B[0];this._SelectBookmark(B[1]);this.TypesCount=0;this.Changed=false;this.Typing=false;}; var FCKEditingArea=function(A){this.TargetElement=A;this.Mode=0;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKEditingArea_Cleanup);};FCKEditingArea.prototype.Start=function(A,B){var C=this.TargetElement;var D=FCKTools.GetElementDocument(C);while(C.firstChild) C.removeChild(C.firstChild);if (this.Mode==0){if (FCK_IS_CUSTOM_DOMAIN) A=''+A;if (FCKBrowserInfo.IsIE) A=A.replace(/(]*?)\s*\/?>(?!\s*<\/base>)/gi,'$1>');else if (!B){var E=A.match(FCKRegexLib.BeforeBody);var F=A.match(FCKRegexLib.AfterBody);if (E&&F){var G=A.substr(E[1].length,A.length-E[1].length-F[1].length);A=E[1]+' '+F[1];if (FCKBrowserInfo.IsGecko&&(G.length==0||FCKRegexLib.EmptyParagraph.test(G))) G='
    ';this._BodyHTML=G;}else this._BodyHTML=A;};var H=this.IFrame=D.createElement('iframe');var I='';H.frameBorder=0;H.style.width=H.style.height='100%';if (FCK_IS_CUSTOM_DOMAIN&&FCKBrowserInfo.IsIE){window._FCKHtmlToLoad=A.replace(//i,''+I);H.src='javascript:void( (function(){document.open() ;document.domain="'+document.domain+'" ;document.write( window.parent._FCKHtmlToLoad );document.close() ;window.parent._FCKHtmlToLoad = null ;})() )';}else if (!FCKBrowserInfo.IsGecko){H.src='javascript:void(0)';};C.appendChild(H);this.Window=H.contentWindow;if (!FCK_IS_CUSTOM_DOMAIN||!FCKBrowserInfo.IsIE){var J=this.Window.document;J.open();J.write(A.replace(//i,''+I));J.close();};if (FCKBrowserInfo.IsAIR) FCKAdobeAIR.EditingArea_Start(J,A);if (FCKBrowserInfo.IsGecko10&&!B){this.Start(A,true);return;};if (H.readyState&&H.readyState!='completed'){var K=this;setTimeout(function(){try{K.Window.document.documentElement.doScroll("left");}catch(e){setTimeout(arguments.callee,0);return;};K.Window._FCKEditingArea=K;FCKEditingArea_CompleteStart.call(K.Window);},0);}else{this.Window._FCKEditingArea=this;if (FCKBrowserInfo.IsGecko10) this.Window.setTimeout(FCKEditingArea_CompleteStart,500);else FCKEditingArea_CompleteStart.call(this.Window);}}else{var L=this.Textarea=D.createElement('textarea');L.className='SourceField';L.dir='ltr';FCKDomTools.SetElementStyles(L,{width:'100%',height:'100%',border:'none',resize:'none',outline:'none'});C.appendChild(L);L.value=A;FCKTools.RunFunction(this.OnLoad);}};function FCKEditingArea_CompleteStart(){if (!this.document.body){this.setTimeout(FCKEditingArea_CompleteStart,50);return;};var A=this._FCKEditingArea;A.Document=A.Window.document;A.MakeEditable();FCKTools.RunFunction(A.OnLoad);};FCKEditingArea.prototype.MakeEditable=function(){var A=this.Document;if (FCKBrowserInfo.IsIE){A.body.disabled=true;A.body.contentEditable=true;A.body.removeAttribute("disabled");}else{try{A.body.spellcheck=(this.FFSpellChecker!==false);if (this._BodyHTML){A.body.innerHTML=this._BodyHTML;A.body.offsetLeft;this._BodyHTML=null;};A.designMode='on';A.execCommand('enableObjectResizing',false,!FCKConfig.DisableObjectResizing);A.execCommand('enableInlineTableEditing',false,!FCKConfig.DisableFFTableHandles);}catch (e){FCKTools.AddEventListener(this.Window.frameElement,'DOMAttrModified',FCKEditingArea_Document_AttributeNodeModified);}}};function FCKEditingArea_Document_AttributeNodeModified(A){var B=A.currentTarget.contentWindow._FCKEditingArea;if (B._timer) window.clearTimeout(B._timer);B._timer=FCKTools.SetTimeout(FCKEditingArea_MakeEditableByMutation,1000,B);};function FCKEditingArea_MakeEditableByMutation(){delete this._timer;FCKTools.RemoveEventListener(this.Window.frameElement,'DOMAttrModified',FCKEditingArea_Document_AttributeNodeModified);this.MakeEditable();};FCKEditingArea.prototype.Focus=function(){try{if (this.Mode==0){if (FCKBrowserInfo.IsIE) this._FocusIE();else this.Window.focus();}else{var A=FCKTools.GetElementDocument(this.Textarea);if ((!A.hasFocus||A.hasFocus())&&A.activeElement==this.Textarea) return;this.Textarea.focus();}}catch(e) {}};FCKEditingArea.prototype._FocusIE=function(){this.Document.body.setActive();this.Window.focus();var A=this.Document.selection.createRange();var B=A.parentElement();var C=B.nodeName.toLowerCase();if (B.childNodes.length>0||!(FCKListsLib.BlockElements[C]||FCKListsLib.NonEmptyBlockElements[C])){return;};A=new FCKDomRange(this.Window);A.MoveToElementEditStart(B);A.Select();};function FCKEditingArea_Cleanup(){if (this.Document) this.Document.body.innerHTML="";this.TargetElement=null;this.IFrame=null;this.Document=null;this.Textarea=null;if (this.Window){this.Window._FCKEditingArea=null;this.Window=null;}}; @@ -68,10 +68,10 @@ var FCKXml=function(){this.Error=false;};FCKXml.GetAttribute=function(A,B,C){var FCKXml.prototype={LoadUrl:function(A){this.Error=false;var B=FCKTools.CreateXmlObject('XmlHttp');if (!B){this.Error=true;return;};B.open("GET",A,false);B.send(null);if (B.status==200||B.status==304||(B.status==0&&B.readyState==4)){this.DOMDocument=B.responseXML;if (!this.DOMDocument||this.DOMDocument.firstChild==null){this.DOMDocument=FCKTools.CreateXmlObject('DOMDocument');this.DOMDocument.async=false;this.DOMDocument.resolveExternals=false;this.DOMDocument.loadXML(B.responseText);}}else{this.DOMDocument=null;};if (this.DOMDocument==null||this.DOMDocument.firstChild==null){this.Error=true;if (window.confirm('Error loading "'+A+'"\r\nDo you want to see more info?')) alert('URL requested: "'+A+'"\r\nServer response:\r\nStatus: '+B.status+'\r\nResponse text:\r\n'+B.responseText);}},SelectNodes:function(A,B){if (this.Error) return [];if (B) return B.selectNodes(A);else return this.DOMDocument.selectNodes(A);},SelectSingleNode:function(A,B){if (this.Error) return null;if (B) return B.selectSingleNode(A);else return this.DOMDocument.selectSingleNode(A);}}; var FCKNamedCommand=function(A){this.Name=A;};FCKNamedCommand.prototype.Execute=function(){FCK.ExecuteNamedCommand(this.Name);};FCKNamedCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState(this.Name);}; var FCKStyleCommand=function(){};FCKStyleCommand.prototype={Name:'Style',Execute:function(A,B){FCKUndo.SaveUndoStep();if (B.Selected) FCK.Styles.RemoveStyle(B.Style);else FCK.Styles.ApplyStyle(B.Style);FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');},GetState:function(){if (FCK.EditMode!=0||!FCK.EditorDocument) return -1;if (FCKSelection.GetType()=='Control'){var A=FCKSelection.GetSelectedElement();if (!A||!FCKStyles.CheckHasObjectStyle(A.nodeName.toLowerCase())) return -1;};return 0;}}; -var FCKDialogCommand=function(A,B,C,D,E,F,G,H){this.Name=A;this.Title=B;this.Url=C;this.Width=D;this.Height=E;this.CustomValue=H;this.GetStateFunction=F;this.GetStateParam=G;this.Resizable=false;};FCKDialogCommand.prototype.Execute=function(){FCKDialog.OpenDialog('FCKDialog_'+this.Name,this.Title,this.Url,this.Width,this.Height,this.CustomValue,null,this.Resizable);};FCKDialogCommand.prototype.GetState=function(){if (this.GetStateFunction) return this.GetStateFunction(this.GetStateParam);else return FCK.EditMode==0?0:-1;};var FCKUndefinedCommand=function(){this.Name='Undefined';};FCKUndefinedCommand.prototype.Execute=function(){alert(FCKLang.NotImplemented);};FCKUndefinedCommand.prototype.GetState=function(){return 0;};var FCKFormatBlockCommand=function(){};FCKFormatBlockCommand.prototype={Name:'FormatBlock',Execute:FCKStyleCommand.prototype.Execute,GetState:function(){return FCK.EditorDocument?0:-1;}};var FCKFontNameCommand=function(){};FCKFontNameCommand.prototype={Name:'FontName',Execute:FCKStyleCommand.prototype.Execute,GetState:FCKFormatBlockCommand.prototype.GetState};var FCKFontSizeCommand=function(){};FCKFontSizeCommand.prototype={Name:'FontSize',Execute:FCKStyleCommand.prototype.Execute,GetState:FCKFormatBlockCommand.prototype.GetState};var FCKPreviewCommand=function(){this.Name='Preview';};FCKPreviewCommand.prototype.Execute=function(){FCK.Preview();};FCKPreviewCommand.prototype.GetState=function(){return 0;};var FCKSaveCommand=function(){this.Name='Save';};FCKSaveCommand.prototype.Execute=function(){var A=FCK.GetParentForm();if (typeof(A.onsubmit)=='function'){var B=A.onsubmit();if (B!=null&&B===false) return;};if (typeof(A.submit)=='function') A.submit();else A.submit.click();};FCKSaveCommand.prototype.GetState=function(){return 0;};var FCKNewPageCommand=function(){this.Name='NewPage';};FCKNewPageCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();FCK.SetData('');FCKUndo.Typing=true;FCK.Focus();};FCKNewPageCommand.prototype.GetState=function(){return 0;};var FCKSourceCommand=function(){this.Name='Source';};FCKSourceCommand.prototype.Execute=function(){if (FCKConfig.SourcePopup){var A=FCKConfig.ScreenWidth*0.65;var B=FCKConfig.ScreenHeight*0.65;FCKDialog.OpenDialog('FCKDialog_Source',FCKLang.Source,'dialog/fck_source.html',A,B,null,null,true);}else FCK.SwitchEditMode();};FCKSourceCommand.prototype.GetState=function(){return (FCK.EditMode==0?0:1);};var FCKUndoCommand=function(){this.Name='Undo';};FCKUndoCommand.prototype.Execute=function(){FCKUndo.Undo();};FCKUndoCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return (FCKUndo.CheckUndoState()?0:-1);};var FCKRedoCommand=function(){this.Name='Redo';};FCKRedoCommand.prototype.Execute=function(){FCKUndo.Redo();};FCKRedoCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return (FCKUndo.CheckRedoState()?0:-1);};var FCKPageBreakCommand=function(){this.Name='PageBreak';};FCKPageBreakCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();var e=FCK.EditorDocument.createElement('DIV');e.style.pageBreakAfter='always';e.innerHTML=' ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKVisitLinkCommand=function(){this.Name='VisitLink';};FCKVisitLinkCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState('Unlink');if (A==0){var B=FCKSelection.MoveToAncestorNode('A');if (!B.href) A=-1;};return A;},Execute:function(){var A=FCKSelection.MoveToAncestorNode('A');var B=A.getAttribute('_fcksavedurl')||A.getAttribute('href',2);if (!/:\/\//.test(B)){var C=FCKConfig.BaseHref;var D=FCK.GetInstanceObject('parent');if (!C){C=D.document.location.href;C=C.substring(0,C.lastIndexOf('/')+1);};if (/^\//.test(B)){try{C=C.match(/^.*:\/\/+[^\/]+/)[0];}catch (e){C=D.document.location.protocol+'://'+D.parent.document.location.host;}};B=C+B;};if (!window.open(B,'_blank')) alert(FCKLang.VisitLinkBlocked);}};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}};var FCKDeleteDivCommand=function(){};FCKDeleteDivCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCKSelection.GetParentElement();var B=new FCKElementPath(A);return B.BlockLimit&&B.BlockLimit.nodeName.IEquals('div')?0:-1;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCKDomTools.GetSelectedDivContainers();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();for (var i=0;i ';var A=FCKDocumentProcessor_CreateFakeImage('FCK__PageBreak',e);var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.SplitBlock();B.InsertNode(A);FCK.Events.FireEvent('OnSelectionChange');};FCKPageBreakCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKUnlinkCommand=function(){this.Name='Unlink';};FCKUnlinkCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (FCKBrowserInfo.IsGeckoLike){var A=FCK.Selection.MoveToAncestorNode('A');if (A) FCKTools.RemoveOuterTags(A);return;};FCK.ExecuteNamedCommand(this.Name);};FCKUnlinkCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState(this.Name);if (A==0&&FCK.EditMode==0){var B=FCKSelection.MoveToAncestorNode('A');var C=(B&&B.name.length>0&&B.href.length==0);if (C) A=-1;};return A;};var FCKVisitLinkCommand=function(){this.Name='VisitLink';};FCKVisitLinkCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCK.GetNamedCommandState('Unlink');if (A==0){var B=FCKSelection.MoveToAncestorNode('A');if (!B.href) A=-1;};return A;},Execute:function(){var A=FCKSelection.MoveToAncestorNode('A');var B=A.getAttribute('_fcksavedurl')||A.getAttribute('href',2);if (!/:\/\//.test(B)){var C=FCKConfig.BaseHref;var D=FCK.GetInstanceObject('parent');if (!C){C=D.document.location.href;C=C.substring(0,C.lastIndexOf('/')+1);};if (/^\//.test(B)){try{C=C.match(/^.*:\/\/+[^\/]+/)[0];}catch (e){C=D.document.location.protocol+'://'+D.parent.document.location.host;}};B=C+B;};if (!window.open(B,'_blank')) alert(FCKLang.VisitLinkBlocked);}};var FCKSelectAllCommand=function(){this.Name='SelectAll';};FCKSelectAllCommand.prototype.Execute=function(){if (FCK.EditMode==0){FCK.ExecuteNamedCommand('SelectAll');}else{var A=FCK.EditingArea.Textarea;if (FCKBrowserInfo.IsIE){A.createTextRange().execCommand('SelectAll');}else{A.selectionStart=0;A.selectionEnd=A.value.length;};A.focus();}};FCKSelectAllCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};var FCKPasteCommand=function(){this.Name='Paste';};FCKPasteCommand.prototype={Execute:function(){if (FCKBrowserInfo.IsIE) FCK.Paste();else FCK.ExecuteNamedCommand('Paste');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}};var FCKRuleCommand=function(){this.Name='Rule';};FCKRuleCommand.prototype={Execute:function(){FCKUndo.SaveUndoStep();FCK.InsertElement('hr');},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('InsertHorizontalRule');}};var FCKCutCopyCommand=function(A){this.Name=A?'Cut':'Copy';};FCKCutCopyCommand.prototype={Execute:function(){var A=false;if (FCKBrowserInfo.IsIE){var B=function(){A=true;};var C='on'+this.Name.toLowerCase();FCK.EditorDocument.body.attachEvent(C,B);FCK.ExecuteNamedCommand(this.Name);FCK.EditorDocument.body.detachEvent(C,B);}else{try{FCK.ExecuteNamedCommand(this.Name);A=true;}catch(e){}};if (!A) alert(FCKLang['PasteError'+this.Name]);},GetState:function(){return FCK.EditMode!=0?-1:FCK.GetNamedCommandState('Cut');}};var FCKAnchorDeleteCommand=function(){this.Name='AnchorDelete';};FCKAnchorDeleteCommand.prototype={Execute:function(){if (FCK.Selection.GetType()=='Control'){FCK.Selection.Delete();}else{var A=FCK.Selection.GetSelectedElement();if (A){if (A.tagName=='IMG'&&A.getAttribute('_fckanchor')) oAnchor=FCK.GetRealElement(A);else A=null;};if (!A){oAnchor=FCK.Selection.MoveToAncestorNode('A');if (oAnchor) FCK.Selection.SelectNode(oAnchor);};if (oAnchor.href.length!=0){oAnchor.removeAttribute('name');if (FCKBrowserInfo.IsIE) oAnchor.className=oAnchor.className.replace(FCKRegexLib.FCK_Class,'');return;};if (A){A.parentNode.removeChild(A);return;};if (oAnchor.innerHTML.length==0){oAnchor.parentNode.removeChild(oAnchor);return;};FCKTools.RemoveOuterTags(oAnchor);};if (FCKBrowserInfo.IsGecko) FCK.Selection.Collapse(true);},GetState:function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Unlink');}};var FCKDeleteDivCommand=function(){};FCKDeleteDivCommand.prototype={GetState:function(){if (FCK.EditMode!=0) return -1;var A=FCKSelection.GetParentElement();var B=new FCKElementPath(A);return B.BlockLimit&&B.BlockLimit.nodeName.IEquals('div')?0:-1;},Execute:function(){FCKUndo.SaveUndoStep();var A=FCKDomTools.GetSelectedDivContainers();var B=new FCKDomRange(FCK.EditorWindow);B.MoveToSelection();var C=B.CreateBookmark();for (var i=0;i\n \n
    \n '+FCKLang.ColorAutomatic+'\n \n ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
    ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
    '+FCKLang.ColorMoreColors+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);};if (!FCKBrowserInfo.IsIE) C.style.width='96%';}; +var FCKTextColorCommand=function(A){this.Name=A=='ForeColor'?'TextColor':'BGColor';this.Type=A;var B;if (FCKBrowserInfo.IsIE) B=window;else if (FCK.ToolbarSet._IFrame) B=FCKTools.GetElementWindow(FCK.ToolbarSet._IFrame);else B=window.parent;this._Panel=new FCKPanel(B);this._Panel.AppendStyleSheet(FCKConfig.SkinEditorCSS);this._Panel.MainNode.className='FCK_Panel';this._CreatePanelBody(this._Panel.Document,this._Panel.MainNode);FCK.ToolbarSet.ToolbarItems.GetItem(this.Name).RegisterPanel(this._Panel);FCKTools.DisableSelection(this._Panel.Document.body);};FCKTextColorCommand.prototype.Execute=function(A,B,C){this._Panel.Show(A,B,C);};FCKTextColorCommand.prototype.SetColor=function(A){FCKUndo.SaveUndoStep();var B=FCKStyles.GetStyle('_FCK_'+(this.Type=='ForeColor'?'Color':'BackColor'));if (!A||A.length==0) FCK.Styles.RemoveStyle(B);else{B.SetVariable('Color',A);FCKStyles.ApplyStyle(B);};FCKUndo.SaveUndoStep();FCK.Focus();FCK.Events.FireEvent('OnSelectionChange');};FCKTextColorCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return 0;};function FCKTextColorCommand_OnMouseOver(){this.className='ColorSelected';};function FCKTextColorCommand_OnMouseOut(){this.className='ColorDeselected';};function FCKTextColorCommand_OnClick(A,B,C){this.className='ColorDeselected';B.SetColor(C);B._Panel.Hide();};function FCKTextColorCommand_AutoOnClick(A,B){this.className='ColorDeselected';B.SetColor('');B._Panel.Hide();};function FCKTextColorCommand_MoreOnClick(A,B){this.className='ColorDeselected';B._Panel.Hide();FCKDialog.OpenDialog('FCKDialog_Color',FCKLang.DlgColorTitle,'dialog/fck_colorselector.html',410,320,FCKTools.Bind(B,B.SetColor));};FCKTextColorCommand.prototype._CreatePanelBody=function(A,B){function CreateSelectionDiv(){var C=A.createElement("DIV");C.className='ColorDeselected';FCKTools.AddEventListenerEx(C,'mouseover',FCKTextColorCommand_OnMouseOver);FCKTools.AddEventListenerEx(C,'mouseout',FCKTextColorCommand_OnMouseOut);return C;};var D=B.appendChild(A.createElement("TABLE"));D.className='ForceBaseFont';D.style.tableLayout='fixed';D.cellPadding=0;D.cellSpacing=0;D.border=0;D.width=150;var E=D.insertRow(-1).insertCell(-1);E.colSpan=8;var C=E.appendChild(CreateSelectionDiv());C.innerHTML='\n \n \n \n \n
    '+FCKLang.ColorAutomatic+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_AutoOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';var G=FCKConfig.FontColors.toString().split(',');var H=0;while (H
    ';if (H>=G.length) C.style.visibility='hidden';else FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_OnClick,[this,L]);}};if (FCKConfig.EnableMoreFontColors){E=D.insertRow(-1).insertCell(-1);E.colSpan=8;C=E.appendChild(CreateSelectionDiv());C.innerHTML='
    '+FCKLang.ColorMoreColors+'
    ';FCKTools.AddEventListenerEx(C,'click',FCKTextColorCommand_MoreOnClick,this);if (!FCKBrowserInfo.IsIE) C.style.width='96%';}}; var FCKPastePlainTextCommand=function(){this.Name='PasteText';};FCKPastePlainTextCommand.prototype.Execute=function(){FCK.PasteAsPlainText();};FCKPastePlainTextCommand.prototype.GetState=function(){if (FCK.EditMode!=0) return -1;return FCK.GetNamedCommandState('Paste');}; var FCKPasteWordCommand=function(){this.Name='PasteWord';};FCKPasteWordCommand.prototype.Execute=function(){FCK.PasteFromWord();};FCKPasteWordCommand.prototype.GetState=function(){if (FCK.EditMode!=0||FCKConfig.ForcePasteAsPlainText) return -1;else return FCK.GetNamedCommandState('Paste');}; var FCKTableCommand=function(A){this.Name=A;};FCKTableCommand.prototype.Execute=function(){FCKUndo.SaveUndoStep();if (!FCKBrowserInfo.IsGecko){switch (this.Name){case 'TableMergeRight':return FCKTableHandler.MergeRight();case 'TableMergeDown':return FCKTableHandler.MergeDown();}};switch (this.Name){case 'TableInsertRowAfter':return FCKTableHandler.InsertRow(false);case 'TableInsertRowBefore':return FCKTableHandler.InsertRow(true);case 'TableDeleteRows':return FCKTableHandler.DeleteRows();case 'TableInsertColumnAfter':return FCKTableHandler.InsertColumn(false);case 'TableInsertColumnBefore':return FCKTableHandler.InsertColumn(true);case 'TableDeleteColumns':return FCKTableHandler.DeleteColumns();case 'TableInsertCellAfter':return FCKTableHandler.InsertCell(null,false);case 'TableInsertCellBefore':return FCKTableHandler.InsertCell(null,true);case 'TableDeleteCells':return FCKTableHandler.DeleteCells();case 'TableMergeCells':return FCKTableHandler.MergeCells();case 'TableHorizontalSplitCell':return FCKTableHandler.HorizontalSplitCell();case 'TableVerticalSplitCell':return FCKTableHandler.VerticalSplitCell();case 'TableDelete':return FCKTableHandler.DeleteTable();default:return alert(FCKLang.UnknownCommand.replace(/%1/g,this.Name));}};FCKTableCommand.prototype.GetState=function(){if (FCK.EditorDocument!=null&&FCKSelection.HasAncestorNode('TABLE')){switch (this.Name){case 'TableHorizontalSplitCell':case 'TableVerticalSplitCell':if (FCKTableHandler.GetSelectedCells().length==1) return 0;else return -1;case 'TableMergeCells':if (FCKTableHandler.CheckIsSelectionRectangular()&&FCKTableHandler.GetSelectedCells().length>1) return 0;else return -1;case 'TableMergeRight':return FCKTableHandler.GetMergeRightTarget()?0:-1;case 'TableMergeDown':return FCKTableHandler.GetMergeDownTarget()?0:-1;default:return 0;}}else return -1;}; @@ -98,7 +98,7 @@ var FCKToolbarItems={};FCKToolbarItems.LoadedItems={};FCKToolbarItems.RegisterIt var FCKToolbar=function(){this.Items=[];};FCKToolbar.prototype.AddItem=function(A){return this.Items[this.Items.length]=A;};FCKToolbar.prototype.AddButton=function(A,B,C,D,E,F){if (typeof(D)=='number') D=[this.DefaultIconsStrip,this.DefaultIconSize,D];var G=new FCKToolbarButtonUI(A,B,C,D,E,F);G._FCKToolbar=this;G.OnClick=FCKToolbar_OnItemClick;return this.AddItem(G);};function FCKToolbar_OnItemClick(A){var B=A._FCKToolbar;if (B.OnItemClick) B.OnItemClick(B,A);};FCKToolbar.prototype.AddSeparator=function(){this.AddItem(new FCKToolbarSeparator());};FCKToolbar.prototype.Create=function(A){var B=FCKTools.GetElementDocument(A);var e=B.createElement('table');e.className='TB_Toolbar';e.style.styleFloat=e.style.cssFloat=(FCKLang.Dir=='ltr'?'left':'right');e.dir=FCKLang.Dir;e.cellPadding=0;e.cellSpacing=0;var C=e.insertRow(-1);var D;if (!this.HideStart){D=C.insertCell(-1);D.appendChild(B.createElement('div')).className='TB_Start';};for (var i=0;i';G.open();G.write(''+H+''+document.getElementById('xToolbarSpace').innerHTML+'');G.close();if(FCKBrowserInfo.IsAIR) FCKAdobeAIR.ToolbarSet_InitOutFrame(G);FCKTools.AddEventListener(G,'contextmenu',FCKTools.CancelEvent);FCKTools.AppendStyleSheet(G,FCKConfig.SkinEditorCSS);B=D.__FCKToolbarSet=new FCKToolbarSet(G);B._IFrame=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(D,FCKToolbarSet_Target_Cleanup);};B.CurrentInstance=FCK;if (!B.ToolbarItems) B.ToolbarItems=FCKToolbarItems;FCK.AttachToOnSelectionChange(B.RefreshItemsState);return B;};function FCK_OnBlur(A){var B=A.ToolbarSet;if (B.CurrentInstance==A) B.Disable();};function FCK_OnFocus(A){var B=A.ToolbarSet;var C=A||FCK;B.CurrentInstance.FocusManager.RemoveWindow(B._IFrame.contentWindow);B.CurrentInstance=C;C.FocusManager.AddWindow(B._IFrame.contentWindow,true);B.Enable();};function FCKToolbarSet_Cleanup(){this._TargetElement=null;this._IFrame=null;};function FCKToolbarSet_Target_Cleanup(){this.__FCKToolbarSet=null;};var FCKToolbarSet=function(A){this._Document=A;this._TargetElement=A.getElementById('xToolbar');var B=A.getElementById('xExpandHandle');var C=A.getElementById('xCollapseHandle');B.title=FCKLang.ToolbarExpand;FCKTools.AddEventListener(B,'click',FCKToolbarSet_Expand_OnClick);C.title=FCKLang.ToolbarCollapse;FCKTools.AddEventListener(C,'click',FCKToolbarSet_Collapse_OnClick);if (!FCKConfig.ToolbarCanCollapse||FCKConfig.ToolbarStartExpanded) this.Expand();else this.Collapse();C.style.display=FCKConfig.ToolbarCanCollapse?'':'none';if (FCKConfig.ToolbarCanCollapse) C.style.display='';else A.getElementById('xTBLeftBorder').style.display='';this.Toolbars=[];this.IsLoaded=false;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKToolbarSet_Cleanup);};function FCKToolbarSet_Expand_OnClick(){FCK.ToolbarSet.Expand();};function FCKToolbarSet_Collapse_OnClick(){FCK.ToolbarSet.Collapse();};FCKToolbarSet.prototype.Expand=function(){this._ChangeVisibility(false);};FCKToolbarSet.prototype.Collapse=function(){this._ChangeVisibility(true);};FCKToolbarSet.prototype._ChangeVisibility=function(A){this._Document.getElementById('xCollapsed').style.display=A?'':'none';this._Document.getElementById('xExpanded').style.display=A?'none':'';if (FCKBrowserInfo.IsGecko){FCKTools.RunFunction(window.onresize);}};FCKToolbarSet.prototype.Load=function(A){this.Name=A;this.Items=[];this.ItemsWysiwygOnly=[];this.ItemsContextSensitive=[];this._TargetElement.innerHTML='';var B=FCKConfig.ToolbarSets[A];if (!B){alert(FCKLang.UnknownToolbarSet.replace(/%1/g,A));return;};this.Toolbars=[];for (var x=0;x0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,parentWindow,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save(true);var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); +var FCKDialog=(function(){var A;var B;var C;var D=window.parent;while (D.parent&&D.parent!=D){try{if (D.parent.document.domain!=document.domain) break;if (D.parent.document.getElementsByTagName('frameset').length>0) break;}catch (e){break;};D=D.parent;};var E=D.document;var F=function(){if (!B) B=FCKConfig.FloatingPanelsZIndex+999;return++B;};var G=function(){if (!C) return;var H=FCKTools.IsStrictMode(E)?E.documentElement:E.body;FCKDomTools.SetElementStyles(C,{'width':Math.max(H.scrollWidth,H.clientWidth,E.scrollWidth||0)-1+'px','height':Math.max(H.scrollHeight,H.clientHeight,E.scrollHeight||0)-1+'px'});};return {OpenDialog:function(dialogName,dialogTitle,dialogPage,width,height,customValue,resizable){if (!A) this.DisplayMainCover();var I={Title:dialogTitle,Page:dialogPage,Editor:window,CustomValue:customValue,TopWindow:D};FCK.ToolbarSet.CurrentInstance.Selection.Save(true);var J=FCKTools.GetViewPaneSize(D);var K={ 'X':0,'Y':0 };var L=FCKBrowserInfo.IsIE&&(!FCKBrowserInfo.IsIE7||!FCKTools.IsStrictMode(D.document));if (L) K=FCKTools.GetScrollPosition(D);var M=Math.max(K.Y+(J.Height-height-20)/2,0);var N=Math.max(K.X+(J.Width-width-20)/2,0);var O=E.createElement('iframe');FCKTools.ResetStyles(O);O.src=FCKConfig.BasePath+'fckdialog.html';O.frameBorder=0;O.allowTransparency=true;FCKDomTools.SetElementStyles(O,{'position':(L)?'absolute':'fixed','top':M+'px','left':N+'px','width':width+'px','height':height+'px','zIndex':F()});O._DialogArguments=I;E.body.appendChild(O);O._ParentDialog=A;A=O;},OnDialogClose:function(dialogWindow){var O=dialogWindow.frameElement;FCKDomTools.RemoveNode(O);if (O._ParentDialog){A=O._ParentDialog;O._ParentDialog.contentWindow.SetEnabled(true);}else{if (!FCKBrowserInfo.IsIE) FCK.Focus();this.HideMainCover();setTimeout(function(){ A=null;},0);FCK.ToolbarSet.CurrentInstance.Selection.Release();}},DisplayMainCover:function(){C=E.createElement('div');FCKTools.ResetStyles(C);FCKDomTools.SetElementStyles(C,{'position':'absolute','zIndex':F(),'top':'0px','left':'0px','backgroundColor':FCKConfig.BackgroundBlockerColor});FCKDomTools.SetOpacity(C,FCKConfig.BackgroundBlockerOpacity);if (FCKBrowserInfo.IsIE&&!FCKBrowserInfo.IsIE7){var Q=E.createElement('iframe');FCKTools.ResetStyles(Q);Q.hideFocus=true;Q.frameBorder=0;Q.src=FCKTools.GetVoidUrl();FCKDomTools.SetElementStyles(Q,{'width':'100%','height':'100%','position':'absolute','left':'0px','top':'0px','filter':'progid:DXImageTransform.Microsoft.Alpha(opacity=0)'});C.appendChild(Q);};FCKTools.AddEventListener(D,'resize',G);G();E.body.appendChild(C);FCKFocusManager.Lock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R._fck_originalTabIndex=R.tabIndex;R.tabIndex=-1;},HideMainCover:function(){FCKDomTools.RemoveNode(C);FCKFocusManager.Unlock();var R=FCK.ToolbarSet.CurrentInstance.GetInstanceObject('frameElement');R.tabIndex=R._fck_originalTabIndex;FCKDomTools.ClearElementJSProperty(R,'_fck_originalTabIndex');},GetCover:function(){return C;}};})(); var FCKMenuItem=function(A,B,C,D,E,F){this.Name=B;this.Label=C||B;this.IsDisabled=E;this.Icon=new FCKIcon(D);this.SubMenu=new FCKMenuBlockPanel();this.SubMenu.Parent=A;this.SubMenu.OnClick=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnClick,this);this.CustomData=F;if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuItem_Cleanup);};FCKMenuItem.prototype.AddItem=function(A,B,C,D,E){this.HasSubMenu=true;return this.SubMenu.AddItem(A,B,C,D,E);};FCKMenuItem.prototype.AddSeparator=function(){this.SubMenu.AddSeparator();};FCKMenuItem.prototype.Create=function(A){var B=this.HasSubMenu;var C=FCKTools.GetElementDocument(A);var r=this.MainElement=A.insertRow(-1);r.className=this.IsDisabled?'MN_Item_Disabled':'MN_Item';if (!this.IsDisabled){FCKTools.AddEventListenerEx(r,'mouseover',FCKMenuItem_OnMouseOver,[this]);FCKTools.AddEventListenerEx(r,'click',FCKMenuItem_OnClick,[this]);if (!B) FCKTools.AddEventListenerEx(r,'mouseout',FCKMenuItem_OnMouseOut,[this]);};var D=r.insertCell(-1);D.className='MN_Icon';D.appendChild(this.Icon.CreateIconElement(C));D=r.insertCell(-1);D.className='MN_Label';D.noWrap=true;D.appendChild(C.createTextNode(this.Label));D=r.insertCell(-1);if (B){D.className='MN_Arrow';var E=D.appendChild(C.createElement('IMG'));E.src=FCK_IMAGES_PATH+'arrow_'+FCKLang.Dir+'.gif';E.width=4;E.height=7;this.SubMenu.Create();this.SubMenu.Panel.OnHide=FCKTools.CreateEventListener(FCKMenuItem_SubMenu_OnHide,this);}};FCKMenuItem.prototype.Activate=function(){this.MainElement.className='MN_Item_Over';if (this.HasSubMenu){this.SubMenu.Show(this.MainElement.offsetWidth+2,-2,this.MainElement);};FCKTools.RunFunction(this.OnActivate,this);};FCKMenuItem.prototype.Deactivate=function(){this.MainElement.className='MN_Item';if (this.HasSubMenu) this.SubMenu.Hide();};function FCKMenuItem_SubMenu_OnClick(A,B){FCKTools.RunFunction(B.OnClick,B,[A]);};function FCKMenuItem_SubMenu_OnHide(A){A.Deactivate();};function FCKMenuItem_OnClick(A,B){if (B.HasSubMenu) B.Activate();else{B.Deactivate();FCKTools.RunFunction(B.OnClick,B,[B]);}};function FCKMenuItem_OnMouseOver(A,B){B.Activate();};function FCKMenuItem_OnMouseOut(A,B){B.Deactivate();};function FCKMenuItem_Cleanup(){this.MainElement=null;}; var FCKMenuBlock=function(){this._Items=[];};FCKMenuBlock.prototype.Count=function(){return this._Items.length;};FCKMenuBlock.prototype.AddItem=function(A,B,C,D,E){var F=new FCKMenuItem(this,A,B,C,D,E);F.OnClick=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnClick,this);F.OnActivate=FCKTools.CreateEventListener(FCKMenuBlock_Item_OnActivate,this);this._Items.push(F);return F;};FCKMenuBlock.prototype.AddSeparator=function(){this._Items.push(new FCKMenuSeparator());};FCKMenuBlock.prototype.RemoveAllItems=function(){this._Items=[];var A=this._ItemsTable;if (A){while (A.rows.length>0) A.deleteRow(0);}};FCKMenuBlock.prototype.Create=function(A){if (!this._ItemsTable){if (FCK.IECleanup) FCK.IECleanup.AddItem(this,FCKMenuBlock_Cleanup);this._Window=FCKTools.GetElementWindow(A);var B=FCKTools.GetElementDocument(A);var C=A.appendChild(B.createElement('table'));C.cellPadding=0;C.cellSpacing=0;FCKTools.DisableSelection(C);var D=C.insertRow(-1).insertCell(-1);D.className='MN_Menu';var E=this._ItemsTable=D.appendChild(B.createElement('table'));E.cellPadding=0;E.cellSpacing=0;};for (var i=0;i(obecna zawartość okna edytora zostanie utracona):", DlgTemplatesLoading : "Ładowanie listy szablonów. Proszę czekać...", diff --git a/main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php b/main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php index 074dc44ca6..227b954e31 100644 --- a/main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php +++ b/main/inc/lib/fckeditor/editor/plugins/ImageManager/editor.php @@ -119,6 +119,10 @@ body { /*]]>*/ + + diff --git a/main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php b/main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php index af6c77a5be..744a03d40c 100644 --- a/main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php +++ b/main/inc/lib/fckeditor/editor/plugins/ImageManager/manager.php @@ -129,6 +129,10 @@ body { /*]]>*/ + + diff --git a/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.html b/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.html index 3d6cf83465..c8afacf096 100644 --- a/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.html +++ b/main/inc/lib/fckeditor/editor/plugins/audio/fck_audio.html @@ -34,6 +34,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js b/main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js index 054fa5670a..b41990ea67 100644 --- a/main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js +++ b/main/inc/lib/fckeditor/editor/plugins/customizations/fckplugin.js @@ -182,7 +182,7 @@ FCKToolbarButton.prototype.ClickFrame = function() FCKDialogCommand.prototype.ExecuteFrame = function() { - return FCKDialog.OpenDialogFrame( 'FCKDialog_' + this.Name, this.Title, this.Url, this.Width, this.Height, this.CustomValue, null, this.Resizable ) ; + return FCKDialog.OpenDialogFrame( 'FCKDialog_' + this.Name, this.Title, this.Url, this.Width, this.Height, this.CustomValue, this.Resizable ) ; }; var FCKDialog = ( function() @@ -243,7 +243,7 @@ var FCKDialog = ( function() /** * Opens a dialog window using the standard dialog template. */ - OpenDialog : function( dialogName, dialogTitle, dialogPage, width, height, customValue, parentWindow, resizable ) + OpenDialog : function( dialogName, dialogTitle, dialogPage, width, height, customValue, resizable ) { if ( !topDialog ) this.DisplayMainCover() ; @@ -305,7 +305,7 @@ var FCKDialog = ( function() *************************************************************************************** */ - OpenDialogFrame: function( dialogName, dialogTitle, dialogPage, width, height, customValue, parentWindow, resizable ) + OpenDialogFrame: function( dialogName, dialogTitle, dialogPage, width, height, customValue, resizable ) { //if ( !topDialog ) // this.DisplayMainCover() ; diff --git a/main/inc/lib/fckeditor/editor/plugins/fckEmbedMovies/fck_embedmovies.html b/main/inc/lib/fckeditor/editor/plugins/fckEmbedMovies/fck_embedmovies.html index b8c704089a..b132164303 100644 --- a/main/inc/lib/fckeditor/editor/plugins/fckEmbedMovies/fck_embedmovies.html +++ b/main/inc/lib/fckeditor/editor/plugins/fckEmbedMovies/fck_embedmovies.html @@ -11,6 +11,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.html b/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.html index 8fada75c53..2d4b4d784e 100644 --- a/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.html +++ b/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.html @@ -12,9 +12,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; - +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.js b/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.js index f1f97eaa60..ba2a5f4edb 100644 --- a/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.js +++ b/main/inc/lib/fckeditor/editor/plugins/flvPlayer/flvPlayer.js @@ -657,22 +657,22 @@ Media.prototype.getInnerHTML = function ( objectId ) function SelectColor1() { - oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectBackColor, window ) ; + oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectBackColor ) ; } function SelectColor2() { - oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectToolColor, window ) ; + oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectToolColor ) ; } function SelectColor3() { - oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectToolTextColor, window ) ; + oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectToolTextColor ) ; } function SelectColor4() { - oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectToolTextRColor, window ) ; + oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectToolTextRColor ) ; } function SelectBackColor( color ) diff --git a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html index 062805b8e4..8072d59ffa 100644 --- a/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html +++ b/main/inc/lib/fckeditor/editor/plugins/googlemaps/dialog/googleMaps.html @@ -26,6 +26,11 @@ + + + + @@ -25,7 +29,7 @@
    - +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html b/main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html index 42d5fcc752..a0c99205d1 100644 --- a/main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html +++ b/main/inc/lib/fckeditor/editor/plugins/mimetex/mimetex.html @@ -559,6 +559,10 @@ function Ok() document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + + diff --git a/main/inc/lib/fckeditor/editor/plugins/prompt/fck_prompt.html b/main/inc/lib/fckeditor/editor/plugins/prompt/fck_prompt.html index a8c3d6c6c0..691d206e1d 100644 --- a/main/inc/lib/fckeditor/editor/plugins/prompt/fck_prompt.html +++ b/main/inc/lib/fckeditor/editor/plugins/prompt/fck_prompt.html @@ -58,9 +58,14 @@ window.onload = function() } + + + -
    +

    diff --git a/main/inc/lib/fckeditor/editor/plugins/prompt/fckplugin.js b/main/inc/lib/fckeditor/editor/plugins/prompt/fckplugin.js index a395fe174a..d45359be86 100644 --- a/main/inc/lib/fckeditor/editor/plugins/prompt/fckplugin.js +++ b/main/inc/lib/fckeditor/editor/plugins/prompt/fckplugin.js @@ -41,7 +41,7 @@ FCKDialog.Prompt = function( message, default_value, action, title, width, heigh if ( !height ) { - height = 235 ; + height = 200 ; } var custom_value = {} ; diff --git a/main/inc/lib/fckeditor/editor/plugins/wikilink/fck_wikilink.html b/main/inc/lib/fckeditor/editor/plugins/wikilink/fck_wikilink.html index 004ce8a017..7115ccdbef 100644 --- a/main/inc/lib/fckeditor/editor/plugins/wikilink/fck_wikilink.html +++ b/main/inc/lib/fckeditor/editor/plugins/wikilink/fck_wikilink.html @@ -87,6 +87,11 @@ function Ok() } + + +
    diff --git a/main/inc/lib/fckeditor/editor/plugins/youtube/youtube.html b/main/inc/lib/fckeditor/editor/plugins/youtube/youtube.html index c2a5d8854f..7e624276f1 100644 --- a/main/inc/lib/fckeditor/editor/plugins/youtube/youtube.html +++ b/main/inc/lib/fckeditor/editor/plugins/youtube/youtube.html @@ -11,6 +11,11 @@ document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ; + + +
    diff --git a/main/inc/lib/fckeditor/myconfig.js b/main/inc/lib/fckeditor/myconfig.js index abcad2f4e3..02de6a6b24 100644 --- a/main/inc/lib/fckeditor/myconfig.js +++ b/main/inc/lib/fckeditor/myconfig.js @@ -116,11 +116,3 @@ FCKConfig.VideoUploadDeniedExtensions = '' ; FCKConfig.MediaUploadAllowedExtensions = '.(flv|mp4)$' ; FCKConfig.MediaUploadDeniedExtensions = '' ; // Note: These lists get combined with the platform's white and black lists. - - -/* - * Other settings. - */ - -// TODO: This setting seems obsolete. To be checked for removal. -FCKConfig.UserStatus = 'teacher' ; diff --git a/main/inc/lib/legal.lib.php b/main/inc/lib/legal.lib.php index 103edc73ec..b1ed987807 100644 --- a/main/inc/lib/legal.lib.php +++ b/main/inc/lib/legal.lib.php @@ -2,12 +2,11 @@ /* ============================================================================== */ -class LegalManager -{ - private function __construct() { +class LegalManager { + private function __construct () { //void } - function add($language, $content, $type, $changes) { + public function add ($language, $content, $type, $changes) { $legal_table = Database::get_main_table(TABLE_MAIN_LEGAL); $last = self::get_last_condition($language); $language = Database::escape_string($language); @@ -43,7 +42,7 @@ class LegalManager } } - function delete($id) { + public function delete ($id) { /* $legal_table = Database::get_main_table(TABLE_MAIN_LEGAL); $id = intval($id); @@ -51,7 +50,7 @@ class LegalManager */ } - function get_last_condition_version($language){ + public function get_last_condition_version ($language) { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $language= Database::escape_string($language); $sql = "SELECT version FROM $legal_conditions_table WHERE language_id = '".$language."' ORDER BY legal_id DESC LIMIT 1 "; @@ -64,7 +63,7 @@ class LegalManager } } - function get_last_condition($language) { + public function get_last_condition ($language) { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $language= Database::escape_string($language); $sql = "SELECT * FROM $legal_conditions_table WHERE language_id = '".$language."' ORDER BY version DESC LIMIT 1 "; @@ -72,8 +71,7 @@ class LegalManager return Database::fetch_array($result); } - function show_last_condition($term_preview) - { + public function show_last_condition ($term_preview) { $preview = ''; switch ($term_preview['type']) { /*// scroll box @@ -103,7 +101,7 @@ class LegalManager // html case 0: $preview = ''; - $preview .= '
    '.get_lang('ByClickingAccept'); + $preview .= '
    '.get_lang('ByClickingRegisterYouAgreeTermsAndConditions'); break; // page link case 1: @@ -124,7 +122,7 @@ class LegalManager } return $preview; } - function get_last_version($language){ + public function get_last_version ($language) { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $language= Database::escape_string($language); $sql = "SELECT version FROM $legal_conditions_table WHERE language_id = '".$language."' ORDER BY version DESC LIMIT 1 "; @@ -138,7 +136,7 @@ class LegalManager } } - function get_legal_data($from, $number_of_items, $column) { + public function get_legal_data ($from, $number_of_items, $column) { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $lang_table = Database::get_main_table(TABLE_MAIN_LANGUAGE); $from = intval($from); @@ -169,7 +167,7 @@ class LegalManager return $legals; } - function count() { + public function count() { $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); $sql = "SELECT count(*) as count_result FROM $legal_conditions_table ORDER BY legal_id DESC "; $result = Database::query($sql, __FILE__, __LINE__); @@ -177,4 +175,18 @@ class LegalManager $result = $url['count_result']; return $result; } + /** + * Get type of terms and conditions + * @param int The legal id + * @param int The language id + * @return int The current type of terms and conditions + */ + public function get_type_of_terms_and_conditions ($legal_id,$language_id) { + $legal_conditions_table = Database::get_main_table(TABLE_MAIN_LEGAL); + $legal_id=Database::escape_string($legal_id); + $language_id=Database::escape_string($language_id); + $sql='SELECT type FROM '.$legal_conditions_table.' WHERE legal_id="'.$legal_id.'" AND language_id="'.$language_id.'"'; + $rs=Database::query($sql,__FILE__,__LINE__); + return Database::result($rs,0,'type'); + } } \ No newline at end of file diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index dbe9700c06..39c5797997 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -183,7 +183,6 @@ define('LOG_USER_DELETE', 'user_deleted'); define('LOG_USER_CREATE', 'user_created'); define('LOG_SESSION_CREATE', 'session_created'); define('LOG_SESSION_DELETE', 'session_deleted'); -define('LOG_SESSION_DELETE', 'session_deleted'); define('LOG_CONFIGURATION_SETTINGS_CHANGE', 'settings_changed'); define('LOG_SUBSCRIBE_USER_TO_COURSE', 'user_subscribed'); define('LOG_UNSUBSCRIBE_USER_FROM_COURSE', 'user_unsubscribed'); @@ -462,11 +461,6 @@ function api_get_path($path_type) { return api_get_path(WEB_CODE_PATH).'img/'; break; - case GARBAGE_PATH : - // example: /var/www/dokeos/main/garbage/ - return $GLOBALS['garbageRepositorySys']; - break; - case SYS_PLUGIN_PATH : // example: /var/www/dokeos/plugin/ return api_get_path(SYS_PATH).'plugin/'; @@ -477,6 +471,7 @@ function api_get_path($path_type) { return api_get_path(WEB_PATH).'plugin/'; break; + case GARBAGE_PATH : //now set to be same as archive case SYS_ARCHIVE_PATH : // example: /var/www/dokeos/archive/ return api_get_path(SYS_PATH).'archive/'; diff --git a/main/inc/lib/pclzip/pclzip.lib.php b/main/inc/lib/pclzip/pclzip.lib.php index c12d0a1691..c76b1fa3ef 100644 --- a/main/inc/lib/pclzip/pclzip.lib.php +++ b/main/inc/lib/pclzip/pclzip.lib.php @@ -22,7 +22,7 @@ // The use of this software is at the risk of the user. // // -------------------------------------------------------------------------------- -// $Id: pclzip.lib.php 21315 2009-06-09 13:50:25Z ndieschburg $ +// $Id: pclzip.lib.php 22578 2009-08-03 04:32:32Z yannoo $ // -------------------------------------------------------------------------------- // ----- Constants @@ -63,7 +63,7 @@ // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' ); // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' ); if (!defined('PCLZIP_TEMPORARY_DIR')) { - define( 'PCLZIP_TEMPORARY_DIR', $garbageRepositorySys ); + define( 'PCLZIP_TEMPORARY_DIR', api_get_path(SYS_ARCHIVE_PATH) ); } // -------------------------------------------------------------------------------- diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index 306328fb45..f53acf814b 100644 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -1,4 +1,4 @@ -,from existing code diff --git a/main/inc/lib/tracking.lib.php b/main/inc/lib/tracking.lib.php index 435a922cc7..3ac50e9433 100644 --- a/main/inc/lib/tracking.lib.php +++ b/main/inc/lib/tracking.lib.php @@ -211,7 +211,7 @@ class Tracking { //If the last connection is > than 7 days, the text is red //345600 = 7 days in seconds if ($currentTimestamp - $timestamp > 604800) { - return '' . format_locale_date(get_lang('DateFormatLongWithoutDay'), strtotime($last_login_date)) . ' '; + return '' . format_locale_date(get_lang('DateFormatLongWithoutDay'), strtotime($last_login_date)) . (api_is_allowed_to_edit()?' ':'').''; } else { return format_locale_date(get_lang('DateFormatLongWithoutDay'), strtotime($last_login_date)); } @@ -369,15 +369,14 @@ class Tracking { * @param Array limit average to listed lp ids * @return string value (number %) Which represents a round integer explain in got in 3. */ - function get_avg_student_score($student_id, $course_code, $lp_ids=array()) { - + function get_avg_student_score($student_id, $course_code, $lp_ids=array()) { $course_table = Database :: get_main_table(TABLE_MAIN_COURSE); $course_user_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER); $table_session_course_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER); $tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); $tbl_stats_attempts= Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT); - $course = CourseManager :: get_course_information($course_code); + $course = CourseManager :: get_course_information($course_code); if (!empty($course['db_name'])) { $tbl_quiz_questions= Database :: get_course_table(TABLE_QUIZ_QUESTION,$course['db_name']); @@ -387,67 +386,108 @@ class Tracking { $lp_item_view_table = Database :: get_course_table(TABLE_LP_ITEM_VIEW,$course['db_name']); $sql_course_lp = 'SELECT id FROM '.$lp_table; - if(count($lp_ids)!=0) - { + if(count($lp_ids)!=0) { $sql_course_lp.=' WHERE id IN ('.implode(',',$lp_ids).')'; } + $sql_result_lp = api_sql_query($sql_course_lp, __FILE__, __LINE__); - $lp_scorm_score_total = 0; $lp_scorm_weighting_total = 0; $lp_scorm_result_score_total = 0; $lp_scorm_loop=0; + $lp_count = 0; + $progress = 0; + if(Database::num_rows($sql_result_lp)>0){ - //Scorm test - while($a_learnpath = Database::fetch_array($sql_result_lp)){ + //Scorm test + while($a_learnpath = Database::fetch_array($sql_result_lp)) { - //We get the last view id of this LP - $sql='SELECT max(id) as id FROM '.$lp_view_table.' WHERE lp_id='.$a_learnpath['id'].' AND user_id="'.intval($student_id).'"'; + //We get the last view id of this LP (with the higher id) + $sql='SELECT max(id) as id FROM '.$lp_view_table.' + WHERE lp_id='.$a_learnpath['id'].' AND user_id="'.intval($student_id).'"'; $rs_last_lp_view_id = api_sql_query($sql, __FILE__, __LINE__); - $lp_view_id = Database::result($rs_last_lp_view_id,0,'id'); + $lp_view_id = Database::result($rs_last_lp_view_id,0,'id'); // THE view - $sql_max_score='SELECT lp_iv.score as score,lp_i.max_score - FROM '.$lp_item_view_table.' as lp_iv - INNER JOIN '.$lp_item_table.' as lp_i - ON lp_i.id = lp_iv.lp_item_id - AND lp_i.item_type="sco" - WHERE lp_view_id="'.$lp_view_id.'"'; - - //$rs = api_sql_query($sql, __FILE__, __LINE__); - //$sql_max_score='SELECT max_score FROM '.$lp_item_view_table.' WHERE lp_view_id="'.$lp_view_id.'" '; - $res_max_score=Database::query($sql_max_score,__FILE__,__LINE__); - $count_total_loop=0; - $num_rows_max_score=Database::num_rows($res_max_score); - if ($num_rows_max_score==1) { - while ($row_max_score=Database::fetch_array($res_max_score)) { - if ($row_max_score['max_score']==0) { - //when there's no max score, we assume 100 as the max score, as the SCORM 1.2 says that the value should always be between 0 and 100. - $lp_scorm_result_score_total+=($row_max_score['score']/100); - } else { - $lp_scorm_result_score_total+=($row_max_score['score']/$row_max_score['max_score']); - } - $count_total_loop++; - } - } elseif ($num_rows_max_score>1) { - while ($row_max_score=Database::fetch_array($res_max_score)) { - if ($row_max_score['max_score']==0) { - $lp_scorm_result_score_total+=($row_max_score['score']/100); - } else { - $lp_scorm_result_score_total+=($row_max_score['score']/$row_max_score['max_score']); - } - $count_total_loop++; - } - } - if ($count_total_loop==0) { - $count_total_loop=1; - } - $score_of_scorm_calculate=round((($lp_scorm_result_score_total/$count_total_loop)*100),2); + if ($lp_view_id != '') { + // we get the progress + $sql='SELECT progress FROM '.$lp_view_table.' WHERE id="'.$lp_view_id.'"'; + $rs = api_sql_query($sql, __FILE__, __LINE__); + $progress = Database::result($rs,0,'progress'); + + // item's list of an scorm + $sql_max_score='SELECT lp_iv.score as score,lp_i.max_score + FROM '.$lp_item_view_table.' as lp_iv + INNER JOIN '.$lp_item_table.' as lp_i + ON lp_i.id = lp_iv.lp_item_id + AND lp_i.item_type="sco" + WHERE lp_view_id="'.$lp_view_id.'"'; + + //$rs = api_sql_query($sql, __FILE__, __LINE__); + //$sql_max_score='SELECT max_score FROM '.$lp_item_view_table.' WHERE lp_view_id="'.$lp_view_id.'" '; + $res_max_score=Database::query($sql_max_score,__FILE__,__LINE__); + $count_total_loop=0; + $num_rows_max_score=Database::num_rows($res_max_score); + + if ($num_rows_max_score==1) { + while ($row_max_score=Database::fetch_array($res_max_score)) { + echo $row_max_score['score'].' - '.$row_max_score['max_score']; + if ($row_max_score['max_score']==0) { + //when there's no max score, we assume 100 as the max score, as the SCORM 1.2 says that the value should always be between 0 and 100. + $lp_scorm_result_score_total+=($row_max_score['score']/100); + $current_value = $row_max_score['score']/100; + + } else { + $lp_scorm_result_score_total+=($row_max_score['score']/$row_max_score['max_score']); + $current_value = $row_max_score['score']/$row_max_score['max_score']; + } + $count_total_loop++; + } + } elseif ($num_rows_max_score > 1) { + //echo ' ----
    '; + while ($row_max_score=Database::fetch_array($res_max_score)) { + //echo $row_max_score['score'].' - '.$row_max_score['max_score']; + //echo '
    '; + if ($row_max_score['max_score']==0) { + $lp_scorm_result_score_total+=($row_max_score['score']/100); + $current_value = $row_max_score['score']/100; + } else { + //when there's no max score, we assume 100 as the max score, as the SCORM 1.2 says that the value should always be between 0 and 100. + $lp_scorm_result_score_total+=($row_max_score['score']/$row_max_score['max_score']); + $current_value = $row_max_score['score']/$row_max_score['max_score']; + } + $count_total_loop++; + } + } + + if ($num_rows_max_score > 0 && ($progress > 0 || $current_value > 0 )) { + $lp_count++; + } + + if ($count_total_loop==0) { + $count_total_loop=1; + } + $score_of_scorm_calculate=round((($lp_scorm_result_score_total/$count_total_loop)*100),2); + + } else { + $score_of_scorm_calculate = 0; + } } + //The next call to a MySQL fetch function, such as mysql_fetch_assoc(), would return that row. mysql_data_seek($sql_result_lp,0); - + + if ($lp_count==0) { + $lp_count=1; + } + + if(count($lp_ids)==0 ) { + $score_of_scorm_calculate=round((($score_of_scorm_calculate/$lp_count)),2); + } + + $lp_scorm_score_total = $score_of_scorm_calculate; + //Quizz in a LP - while($a_learnpath = Database::fetch_array($sql_result_lp)){ + while($a_learnpath = Database::fetch_array($sql_result_lp)) { //we got the maxscore this is wrong /* echo $sql = 'SELECT id as item_id, max_score @@ -528,8 +568,8 @@ class Tracking { $total_weighting += $maxscore; if($total_weighting>0 && $maxscore>0) { //echo $total_score.' - '.$maxscore; echo '
    '; - //echo $lp_scorm_score_total += ($total_score/$total_weighting)*100; - $lp_scorm_score_total += ($total_score/$maxscore)*100; + //echo $lp_scorm_score_total += ($total_score/$total_weighting)*100; + $lp_scorm_score_total += ($total_score/$maxscore)*100; $lp_scorm_weighting_total+=100; } } @@ -538,14 +578,14 @@ class Tracking { } } - $totalScore = $lp_scorm_score_total; - + $totalScore = $lp_scorm_score_total; $pourcentageScore = 0; if($lp_scorm_weighting_total>0) { //i.e 10.52 $pourcentageScore = round( (($totalScore * 100) / $lp_scorm_weighting_total),2); return $pourcentageScore; } elseif ($score_of_scorm_calculate>0) { + //echo '
    '.$score_of_scorm_calculate; return $score_of_scorm_calculate; } else { return null; @@ -1308,4 +1348,4 @@ class Tracking { return $avg_student_score; } } -?> +?> \ No newline at end of file diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index e680b1cd9b..f32814667b 100644 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -10,7 +10,8 @@ Copyright (c) Roan Embrechts (Vrije Universiteit Brussel) Copyright (c) Patrick Cool Copyright (c) Julio Montoya Armas - + Copyright (c) Isaac flores paz + For a full list of contributors, see "credits.txt". The full license can be read in "license.txt". @@ -159,6 +160,7 @@ The course id is stored in $_cid session variable. // verified if exists the username and password in session current if (isset($_SESSION['info_current_user'][1]) && isset($_SESSION['info_current_user'][2])) { require_once (api_get_path(LIBRARY_PATH).'usermanager.lib.php'); + require_once (api_get_path(LIBRARY_PATH).'legal.lib.php'); } // parameters passed via GET $logout = isset($_GET["logout"]) ? $_GET["logout"] : ''; @@ -210,11 +212,23 @@ if (get_setting('allow_terms_conditions')=='true') { $user_id=$_SESSION['update_term_and_condition'][1]; // user id // update the terms & conditions - if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1') || !isset($_POST['legal_accept'])) { + + //verify type of terms and conditions + $info_legal = explode(':',$_POST['legal_info']); + $legal_type=LegalManager::get_type_of_terms_and_conditions($info_legal[0],$info_legal[1]); + + //is necessary verify check + if ($legal_type==1) { + if ((isset($_POST['legal_accept']) && $_POST['legal_accept']=='1')) { + $legal_option=true; + } else { + $legal_option=false; + + } + } + //no is check option + if ($legal_type==0) { $legal_option=true; - } else { - $legal_option=false; - } if (isset($_POST['legal_accept_type']) && $legal_option===true) { diff --git a/main/install/compare_db.php b/main/install/compare_db.php index 82f9130200..ca2b46df25 100644 --- a/main/install/compare_db.php +++ b/main/install/compare_db.php @@ -1,27 +1,5 @@ - - Copyright (c) 2004 Dokeos S.A. - Copyright (c) 2003 Ghent University (UGent) - Copyright (c) 2001 Universite catholique de Louvain (UCL) - - For a full list of contributors, see "credits.txt". - The full license can be read in "license.txt". - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. - - See the GNU General Public License for more details. - - Contact address: Dokeos, 44 rue des palais, B-1030 Brussels, Belgium - Mail: info@dokeos.com -============================================================================== -*/ +type == 'sco') ||(($this->type == 'sco') && ($credit == 'no-credit' OR $mode == 'review' OR $mode == 'browse'))) + if (($save===false && $this->type == 'sco') ||(($this->type == 'sco') && ($credit == 'no-credit' OR $mode == 'review' OR $mode == 'browse'))) { //this info shouldn't be saved as the credit or lesson mode info prevent it if($this->debug>1){error_log('New LP - In learnpathItem::write_to_db() - credit('.$credit.') or lesson_mode('.$mode.') prevent recording!',0);} - }else{ + } else { //check the row exists $inserted = false; - // this a special case for multiple attepmts and Dokeos exercises - if ($this->type == 'quiz' && $this->get_prevent_reinit()==0 && $this->get_status()=='completed') { + // this a special case for multiple attempts and Dokeos exercises + if ($this->type == 'quiz' && $this->get_prevent_reinit()==0 && $this->get_status()=='completed') { // we force the item to be restarted $this->restart(); - + $sql = "INSERT INTO $item_view_table " . "(total_time, " . "start_time, " . @@ -2281,10 +2281,10 @@ function get_terms() if($this->debug>2){error_log('New LP - In learnpathItem::write_to_db() - Inserting into item_view: '.$sql,0);} $res = api_sql_query($sql,__FILE__,__LINE__); $this->db_item_view_id = Database::get_last_insert_id(); - }else{ + } else { $sql = ''; - if($this->type=='hotpotatoes') - { //make an exception for HotPotatoes, don't update the score + if($this->type=='hotpotatoes') { + //make an exception for HotPotatoes, don't update the score //because it has been saved outside of this tool $sql = "UPDATE $item_view_table " . "SET total_time = ".$this->get_total_time().", " . @@ -2297,43 +2297,39 @@ function get_terms() "WHERE lp_item_id = ".$this->db_id." " . "AND lp_view_id = ".$this->view_id." " . "AND view_count = ".$this->attempt_id; - } - else - { //for all other content types... + } else { + //for all other content types... if ($this->type=='quiz') { $my_status = ' '; $total_time = ' '; if (!empty($_REQUEST['exeId'])) { - $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); - - $safe_exe_id = Database::escape_string($_REQUEST['exeId']); - $sql = 'SELECT start_date,exe_date FROM ' . $TBL_TRACK_EXERCICES . ' WHERE exe_id = '.(int)$safe_exe_id; - $res = api_sql_query($sql,__FILE__,__LINE__); - $row_dates = Database::fetch_array($res); - - $time_start_date = convert_mysql_date($row_dates['start_date']); - $time_exe_date = convert_mysql_date($row_dates['exe_date']); - $mytime = ((int)$time_exe_date-(int)$time_start_date); - $total_time =" total_time = ".$mytime.", "; - } - - - }else { + $TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES); + + $safe_exe_id = Database::escape_string($_REQUEST['exeId']); + $sql = 'SELECT start_date,exe_date FROM ' . $TBL_TRACK_EXERCICES . ' WHERE exe_id = '.(int)$safe_exe_id; + $res = api_sql_query($sql,__FILE__,__LINE__); + $row_dates = Database::fetch_array($res); + + $time_start_date = convert_mysql_date($row_dates['start_date']); + $time_exe_date = convert_mysql_date($row_dates['exe_date']); + $mytime = ((int)$time_exe_date-(int)$time_start_date); + $total_time =" total_time = ".$mytime.", "; + } + } else { $my_type_lp=learnpath::get_type_static($this->lp_id); // this is a array containing values finished $case_completed=array('completed','passed','browsed'); //is not multiple attempts - if ($this->get_prevent_reinit()==1) { - // process of status verified into data base - - $sql_verified='SELECT status FROM '.$item_view_table.' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; - $rs_verified=api_sql_query($sql_verified,__FILE__,__LINE__); - $row_verified=Database::fetch_array($rs_verified); - - //get type lp i.e 2=scorm and 1=lp dokeos - // if not is completed or passed or browsed and learnig path is scorm + if ($this->get_prevent_reinit()==1) { + // process of status verified into data base + $sql_verified='SELECT status FROM '.$item_view_table.' WHERE lp_item_id="'.$this->db_id.'" AND lp_view_id="'.$this->view_id.'" AND view_count="'.$this->attempt_id.'" ;'; + $rs_verified=api_sql_query($sql_verified,__FILE__,__LINE__); + $row_verified=Database::fetch_array($rs_verified); + + //get type lp: 1=lp dokeos and 2=scorm + // if not is completed or passed or browsed and learning path is scorm if(!in_array($this->get_status(false),$case_completed) && $my_type_lp==2 ) {//&& $this->type!='dir' $total_time =" total_time = total_time +".$this->get_total_time().", "; $my_status = " status = '".$this->get_status(false)."' ,"; @@ -2346,31 +2342,28 @@ function get_terms() $total_time =" total_time = total_time +".$this->get_total_time().", "; $my_status = " status = '".$this->get_status(false)."' ,"; }else { - //&& !in_array($row_verified['status'],$case_completed) - + //&& !in_array($row_verified['status'],$case_completed) //is lp dokeos if ($my_type_lp==1 && $this->type!='chapter') { $total_time =" total_time = total_time + ".$this->get_total_time().", "; $my_status = " status = '".$this->get_status(false)."' ,"; } - } - + } } } else { - // is multipe attempts + // is multiple attempts if (in_array($this->get_status(false),$case_completed) && $my_type_lp==2) { - //reset zero new attempt ? + //reset zero new attempt ? + $my_status = " status = '".$this->get_status(false)."' ,"; } elseif (!in_array($this->get_status(false),$case_completed) && $my_type_lp==2){ $total_time =" total_time = ".$this->get_total_time().", "; - $my_status = " status = '".$this->get_status(false)."' ,"; + $my_status = " status = '".$this->get_status(false)."' ,"; } else { - //is lp dokeos + //is dokeos LP $total_time =" total_time = total_time +".$this->get_total_time().", "; $my_status = " status = '".$this->get_status(false)."' ,"; - } - - } - + } + } /*if ($my_type_lp==1 && !in_array($row_verified['status'],$case_completed)) { $total_time =" total_time = total_time + ".$this->get_total_time().", "; }*/ @@ -2442,7 +2435,7 @@ function get_terms() "latency = '".Database::escape_string($interaction[7])."'" . "WHERE id = $iva_id"; $ivau_res = api_sql_query($ivau_sql,__FILE__,__LINE__); - }else{ + } else { //insert new one $ivai_sql = "INSERT INTO $iva_table " . "(order_id, lp_iv_id, interaction_id, interaction_type, " . diff --git a/main/newscorm/lp_ajax_save_item.php b/main/newscorm/lp_ajax_save_item.php index 1b4f3ca30e..82e4fc4671 100644 --- a/main/newscorm/lp_ajax_save_item.php +++ b/main/newscorm/lp_ajax_save_item.php @@ -109,7 +109,10 @@ function save_item($lp_id,$user_id,$view_id,$item_id,$score=-1,$max=-1,$min=-1,$ //id(0), type(1), time(2), weighting(3),correct_responses(4),student_response(5),result(6),latency(7) if(is_array($interactions) && count($interactions)>0){ foreach($interactions as $index=>$interaction){ - $mylpi->add_interaction($index,$interactions[$index]); + //$mylpi->add_interaction($index,$interactions[$index]); + //fix DT#4444 + $clean_interaction = str_replace('@@',',',$interactions[$index]); + $mylpi->add_interaction($index,$clean_interaction); } } $mylpi->set_core_exit($core_exit); diff --git a/main/newscorm/scorm_api.php b/main/newscorm/scorm_api.php old mode 100644 new mode 100755 index 51cd758af7..f98b27d455 --- a/main/newscorm/scorm_api.php +++ b/main/newscorm/scorm_api.php @@ -7,7 +7,7 @@ Copyright (c) Denes Nagy (darkden@freemail.hu) For a full list of contributors, see "credits.txt". - The full license can be read in "license.txt". + The full license can be read in "license.txt". This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -616,7 +616,7 @@ function LMSSetValue(param, val) { return_value='true'; break; case "student_response": - interactions[elem_id][5] = val; + interactions[elem_id][5] = ''+val; logit_scorm("Interaction "+elem_id+"'s student_response updated",2); return_value='true'; break; @@ -740,7 +740,6 @@ function reinit_update_table_list () { } function savedata(origin) { - //origin can be 'commit', 'finish' or 'terminate' if ((lesson_status != 'completed') && (lesson_status != 'passed') && (mastery_score >=0) && (score >= mastery_score)) { lesson_status = 'passed'; @@ -781,6 +780,7 @@ function savedata(origin) { logit_lms('saving data (status='+lesson_status+' - interactions: '+ interactions.length +')',1); old_item_id=info_lms_item[0]; + // xajax_save_item is replaced to xajax_save_item_scorm for scorm LP's //xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, session_time, suspend_data, lesson_location, interactions, lms_item_core_exit); xajax_save_item_scorm(lms_lp_id, lms_user_id, lms_view_id, old_item_id,my_get_value_scorm); @@ -1231,7 +1231,13 @@ function switch_item(current_item, next_item) { //(1) save the current item logit_lms('Called switch_item with params '+lms_item_id+' and '+next_item+'',0); if (lms_lp_type==1 || lms_item_type=='asset' || session_time == '0' || session_time == '0:00:00'){ - xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, asset_timer, suspend_data, lesson_location,interactions, lms_item_core_exit); + if (lms_lp_type==1) { + xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, asset_timer, suspend_data, lesson_location,interactions, lms_item_core_exit); + } else { + my_get_value_scorm=new Array(); + my_get_value_scorm=ProcessValueScorm(); + xajax_save_item_scorm(lms_lp_id, lms_user_id, lms_view_id, lms_item_id,my_get_value_scorm); + } if(item_objectives.length>0) { xajax_save_objectives(lms_lp_id,lms_user_id,lms_view_id,lms_item_id,item_objectives); } @@ -1262,6 +1268,7 @@ function switch_item(current_item, next_item) { //savedata('finish'); //} // xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score, max, min, lesson_status, session_time, suspend_data, lesson_location,interactions, lms_item_core_exit); + } execute_stats=false; //(2) Refresh all the values inside this SCORM API object - use AJAX @@ -1410,8 +1417,6 @@ function xajax_save_item(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, score } ); } - - } function xajax_save_item_scorm(lms_lp_id, lms_user_id, lms_view_id, lms_item_id,info_get_lms) { @@ -1454,21 +1459,32 @@ function xajax_save_item_scorm(lms_lp_id, lms_user_id, lms_view_id, lms_item_id, is_interactions='false'; } } - + + if (is_interactions=='true') { - interact_string = ''; + interact_string = ''; + temp = ''; for (i in interactions){ + interact_string += '&interact['+i+']='; interact_temp = '['; - for (j in interactions[i]) { - interact_temp += interactions[i][j]+','; + for (j in interactions[i]) { + temp = interactions[i][j]; + temp = ''+temp; // if temp == 1 there are problems with indexOf and an integer number + //this fix when an interaction have ',' i.e: {a,b,c,d} is replace to {a@@b@@c@@d} see DT#4444 + while(temp.indexOf(',') >= 0){ + temp = temp.replace(',','@@'); + }; + interact_temp +=temp+','; } interact_temp = interact_temp.substr(0,(interact_temp.length-2)) + ']'; - interact_string += encodeURIComponent(interact_temp); + // interact_string += encodeURIComponent(interact_temp); + + + interact_string += interact_temp; } - //interact_string = encodeURIComponent(interact_string.substr(0,(interact_string.length-1))); - - params += interact_string; + //interact_string = encodeURIComponent(interact_string.substr(0,(interact_string.length-1))); + params += interact_string; is_interactions='false'; } diff --git a/main/social/data_personal.inc.php b/main/social/data_personal.inc.php index 80b2ba9c92..f0f81068e6 100755 --- a/main/social/data_personal.inc.php +++ b/main/social/data_personal.inc.php @@ -5,6 +5,7 @@ $language_file = array('registration','messages','userInfo','admin','forum','blo require_once '../inc/global.inc.php'; require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php'; require_once api_get_path(LIBRARY_PATH).'social.lib.php'; +require_once api_get_path(LIBRARY_PATH).'course.lib.php'; // @todo here we must show the user information as read only //User picture size is calculated from SYSTEM path @@ -21,8 +22,8 @@ if (isset($_POST['load_ajax'])) { $course_db = $_POST['course_code']; // @todo goto the course link //echo ''.get_lang('GotoCourse').''; - $my_course_info_db=explode('_',$course_db); - $course_id=$my_course_info_db[1]; + $course_id=CourseManager::get_course_id_by_database_name($course_db); + if (api_is_user_of_course($course_id,api_get_user_id())) { $table_forums = Database :: get_course_table(TABLE_FORUM,$course_db); @@ -31,7 +32,8 @@ if (isset($_POST['load_ajax'])) { $table_item_property = Database :: get_course_table(TABLE_ITEM_PROPERTY,$course_db); $table_users = Database :: get_main_table(TABLE_MAIN_USER); - //------Forum messages + //------Forum messages + $forum_result = get_all_post_from_user($user_id, $course_db); $all_result_data = 0; if ($forum_result !='') { @@ -47,7 +49,7 @@ if (isset($_POST['load_ajax'])) { $result = get_blog_post_from_user($course_db, $user_id); if (!empty($result)) { echo '

    '; - api_display_tool_title(get_lang('BlogPosts')); + api_display_tool_title(api_xml_http_response_encode(get_lang('BlogPosts'))); echo ''; @@ -58,7 +60,7 @@ if (isset($_POST['load_ajax'])) { //------Blog comments $result = get_blog_comment_from_user($course_db, $user_id); if (!empty($result)) { - api_display_tool_title(get_lang('BlogComments')); + api_display_tool_title(api_xml_http_response_encode(get_lang('BlogComments'))); echo ''; @@ -71,9 +73,9 @@ if (isset($_POST['load_ajax'])) { } else { echo '

    '; - api_display_tool_title(get_lang('Details')); + api_display_tool_title(api_xml_http_response_encode(get_lang('Details'))); echo ''; echo '

    '; diff --git a/main/social/profile.php b/main/social/profile.php index ad26077eba..31e54ba3f9 100644 --- a/main/social/profile.php +++ b/main/social/profile.php @@ -551,7 +551,7 @@ echo '
    '; $friend_html.= ''; @@ -568,7 +568,7 @@ echo '
    '; echo '
    '; if ($count_pending_invitations > 0) { echo '
    '; - echo get_lang('PendingInvitations'); + echo api_convert_encoding(get_lang('PendingInvitations'),$charset,'UTF-8'); echo '
    '; for ($i=0;$i<$count_pending_invitations;$i++) { //var_dump($invitations); @@ -577,7 +577,7 @@ echo '
    '; echo ''; echo '
    '; echo '
    '; - echo ' '.substr($pending_invitations[$i]['content'],0,50); + echo ' '.api_convert_encoding(substr($pending_invitations[$i]['content'],0,50),$charset,'UTF-8'); echo '
    '; echo ''.get_lang('SocialAddToFriends').''; echo '
     
    '; @@ -701,17 +701,49 @@ echo '
    '; }*/ if ($show_full_profile) { - //-- Extra Data + //-- Extra Data + $t_uf = Database :: get_main_table(TABLE_MAIN_USER_FIELD); + $t_ufo = Database :: get_main_table(TABLE_MAIN_USER_FIELD_OPTIONS); $extra_user_data = UserManager::get_extra_user_data($user_id); if (is_array($extra_user_data) && count($extra_user_data)>0 ) { echo '
    '; echo get_lang('ExtraInformation'); echo '
    '; echo ''; echo '

    '; } diff --git a/main/survey/survey.php b/main/survey/survey.php index c3a8db1f4d..6047b9a66c 100644 --- a/main/survey/survey.php +++ b/main/survey/survey.php @@ -1,29 +1,10 @@ -, Ghent University: cleanup, refactoring and rewriting large parts of the code -* @version $Id: survey.php 21734 2009-07-02 17:12:41Z cvargas1 $ +* @version $Id: survey.php 22573 2009-08-03 03:38:13Z yannoo $ * * @todo use quickforms for the forms */ @@ -58,6 +39,7 @@ $table_survey_question_group = Database :: get_course_table(TABLE_SURVEY_QUES $table_course = Database :: get_main_table(TABLE_MAIN_COURSE); $table_user = Database :: get_main_table(TABLE_MAIN_USER); $user_info = Database :: get_main_table(TABLE_MAIN_SURVEY_REMINDER); +$survey_id = intval($_GET['survey_id']); // breadcrumbs $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('SurveyList')); @@ -66,7 +48,7 @@ $interbreadcrumb[] = array ("url" => "survey_list.php", "name" => get_lang('Surv if (isset($_GET['survey_id'])) { $course_code = api_get_course_id(); if ($course_code!=-1) { - $survey_data = survey_manager::get_survey($_GET['survey_id']); + $survey_data = survey_manager::get_survey($survey_id); } else { Display :: display_header(get_lang('Survey')); Display :: display_error_message(get_lang('NotAllowed'), false); @@ -99,7 +81,7 @@ if($is_survey_type_1 && ($_GET['action']=='addgroup')||($_GET['action']=='delete } elseif(!empty($_POST['name'])) { - api_sql_query('INSERT INTO '.$table_survey_question_group.' (name,description,survey_id) values (\''.Database::escape_string($_POST['name']).'\',\''.Database::escape_string($_POST['description']).'\',\''.Database::escape_string($_GET['survey_id']).'\') '); + api_sql_query('INSERT INTO '.$table_survey_question_group.' (name,description,survey_id) values (\''.Database::escape_string($_POST['name']).'\',\''.Database::escape_string($_POST['description']).'\',\''.Database::escape_string($survey_id).'\') '); $sendmsg = 'GroupCreatedSuccessfully'; } else { $sendmsg = 'GroupNeedName'; @@ -107,11 +89,11 @@ if($is_survey_type_1 && ($_GET['action']=='addgroup')||($_GET['action']=='delete } if($_GET['action']=='deletegroup'){ - api_sql_query('DELETE FROM '.$table_survey_question_group.' WHERE id = '.Database::escape_string($_GET['gid']).' and survey_id = '.Database::escape_string($_GET['survey_id'])); + api_sql_query('DELETE FROM '.$table_survey_question_group.' WHERE id = '.Database::escape_string($_GET['gid']).' and survey_id = '.Database::escape_string($survey_id)); $sendmsg = 'GroupDeletedSuccessfully'; } - header('Location:survey.php?survey_id='.(int)$_GET['survey_id'].'&sendmsg='.$sendmsg); + header('Location:survey.php?survey_id='.$survey_id.'&sendmsg='.$sendmsg); exit; } @@ -151,30 +133,30 @@ if(!empty($survey_data['survey_version'])) echo ''.get_lang('Version').': '.$ SurveyUtil::check_first_last_question($_GET['survey_id']); // Action links -$survey_actions = ''.Display::return_icon('edit.gif', get_lang('Edit')).' '.get_lang('EditSurvey').''; -$survey_actions .= ''.Display::return_icon('delete.gif', get_lang('Delete')).' '.get_lang('DeleteSurvey').''; -//$survey_actions .= ''.Display::return_icon('copy.gif', get_lang('Copy')).''; -$survey_actions .= ''.Display::return_icon('preview.gif', get_lang('Preview')).' '.get_lang('Preview').''; -$survey_actions .= ''.Display::return_icon('survey_publish.gif', get_lang('Publish')).' '.get_lang('Publish').''; -$survey_actions .= ''.Display::return_icon('statistics.gif', get_lang('Reporting')).' '.get_lang('Reporting').''; +$survey_actions = ''.Display::return_icon('edit.gif', get_lang('Edit')).' '.get_lang('EditSurvey').''; +$survey_actions .= ''.Display::return_icon('delete.gif', get_lang('Delete')).' '.get_lang('DeleteSurvey').''; +//$survey_actions .= ''.Display::return_icon('copy.gif', get_lang('Copy')).''; +$survey_actions .= ''.Display::return_icon('preview.gif', get_lang('Preview')).' '.get_lang('Preview').''; +$survey_actions .= ''.Display::return_icon('survey_publish.gif', get_lang('Publish')).' '.get_lang('Publish').''; +$survey_actions .= ''.Display::return_icon('statistics.gif', get_lang('Reporting')).' '.get_lang('Reporting').''; echo '
    '.$survey_actions.'
    '; if ($survey_data['survey_type']==0) { echo ''; } else { echo ''; - echo ''.get_lang('PersonalityQuestion').'
    '; + //echo '
    '.get_lang('Add groups').'
    '; + echo ''.get_lang('PersonalityQuestion').'
    '; echo '
    '; } @@ -193,7 +175,7 @@ if($is_survey_type_1) { echo ' '; // Displaying the table contents with all the questions $question_counter = 1; -$sql = "SELECT * FROM $table_survey_question_group WHERE survey_id = '".Database::escape_string($_GET['survey_id'])."' ORDER BY id"; +$sql = "SELECT * FROM $table_survey_question_group WHERE survey_id = '".Database::escape_string($survey_id)."' ORDER BY id"; $result = api_sql_query($sql, __FILE__, __LINE__); $groups = array(); while($row = Database::fetch_array($result)) { @@ -203,7 +185,7 @@ $sql = "SELECT survey_question.*, count(survey_question_option.question_option_i FROM $table_survey_question survey_question LEFT JOIN $table_survey_question_option survey_question_option ON survey_question.question_id = survey_question_option.question_id - WHERE survey_question.survey_id = '".Database::escape_string($_GET['survey_id'])."' + WHERE survey_question.survey_id = '".Database::escape_string($survey_id)."' GROUP BY survey_question.question_id ORDER BY survey_question.sort ASC"; $result = api_sql_query($sql, __FILE__, __LINE__); @@ -231,17 +213,17 @@ while ($row = Database::fetch_array($result,'ASSOC')) { echo '
    '; echo ' '; echo ' '; echo ' '; - $sql = 'SELECT id,name,description FROM '.$table_survey_question_group.' WHERE survey_id = '.Database::escape_string($_GET['survey_id']).' ORDER BY name'; + $sql = 'SELECT id,name,description FROM '.$table_survey_question_group.' WHERE survey_id = '.Database::escape_string($survey_id).' ORDER BY name'; $rs = api_sql_query($sql,__FILE__,__LINE__); while($row = Database::fetch_array($rs,ASSOC)){ $grouplist .= ''; } diff --git a/main/tracking/userLog.php b/main/tracking/userLog.php index 5823c0935f..4be936818b 100644 --- a/main/tracking/userLog.php +++ b/main/tracking/userLog.php @@ -333,7 +333,7 @@ function display_exercise_tracking_info($view, $user_id, $course_id) for($i = 0; $i < sizeof($hpresults); $i++) { $title = GetQuizName($hpresults[$i][0],''); if ($title == '') - $title = GetFileName($hpresults[$i][0]); + $title = basename($hpresults[$i][0]); $display_date = format_locale_date(get_lang('dateTimeFormatLong'), $hpresults[$i][3]); ?> diff --git a/main/tracking/userlogCSV.php b/main/tracking/userlogCSV.php index 78dfd8981e..215de7148f 100644 --- a/main/tracking/userlogCSV.php +++ b/main/tracking/userlogCSV.php @@ -284,7 +284,7 @@ function display_exercise_tracking_info($view, $user_id, $course_id) $title = GetQuizName($hpresults[$i][0],''); if ($title == '') - $title = GetFileName($hpresults[$i][0]); + $title = basename($hpresults[$i][0]); $display_date = format_locale_date(get_lang('dateTimeFormatLong'), $hpresults[$i][3]); $line .= $title.';'.$display_date.';'.$hpresults[$i][1].'/'.$hpresults[$i][2]."\n"; diff --git a/main/wiki/index.php b/main/wiki/index.php index 4e2fc9b025..93bdc73eec 100644 --- a/main/wiki/index.php +++ b/main/wiki/index.php @@ -195,9 +195,8 @@ $result=api_sql_query($sql,__LINE__,__FILE__); while ($is_editing_block=Database::fetch_array($result)) { $max_edit_time=1200; // 20 minutes - $timestamp_edit=convert_date_to_number($is_editing_block['time_edit']); - $time_editing=time()-$timestamp_edit; - + $timestamp_edit=strtotime($is_editing_block['time_edit']); + $time_editing=time()-$timestamp_edit; //first prevent concurrent users and double version if($is_editing_block['is_editing']==$_user['user_id']) @@ -234,8 +233,7 @@ if (isset($_POST['SaveWikiChange']) AND $_POST['title']<>'') { //prevent concurrent users and double version Display::display_error_message(get_lang("EditedByAnotherUser")); - } - + } else { $return_message=save_wiki(); @@ -360,7 +358,7 @@ if ($_GET['view']) if($last_row['is_editing']!=0 && $last_row['is_editing']!=$_user['user_id']) { //checking for concurrent users - $timestamp_edit=convert_date_to_number($last_row['time_edit']); + $timestamp_edit=strtotime($last_row['time_edit']); $time_editing=time()-$timestamp_edit; $max_edit_time=1200; // 20 minutes $rest_time=$max_edit_time-$time_editing; @@ -1230,11 +1228,10 @@ if ($_GET['action']=='showpage' AND !isset($_POST['SaveWikiNew'])) if ($_GET['action']=='edit') { $_clean['group_id']=(int)$_SESSION['_gid']; - - $sql='SELECT * FROM '.$tbl_wiki.'WHERE reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$groupfilter.' ORDER BY id DESC'; - $result=api_sql_query($sql,__LINE__,__FILE__); - $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version + $sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$tbl_wiki.'.'.$groupfilter.' ORDER BY id DESC'; + $result=api_sql_query($sql,__LINE__,__FILE__); + $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version if ($row['content']=='' AND $row['title']=='' AND $page=='') @@ -1316,9 +1313,82 @@ if ($_GET['action']=='edit') Display::display_normal_message(get_lang('PageLockedExtra')); } else - { - - //previous checking for concurrent editions + { + //check tasks + if (!empty($row['startdate_assig']) && $row['startdate_assig']!='0000-00-00 00:00:00' && time()strtotime($row['enddate_assig']) && $row['enddate_assig']!='0000-00-00 00:00:00' && $row['delayedsubmit']==0) + { + $message=get_lang('TheDeadlineHasBeenCompleted').': '.$row['enddate_assig']; + Display::display_warning_message($message); + if(!api_is_allowed_to_edit()) + { + exit; + } + } + + // + if(!empty($row['max_version']) && $row['version']>=$row['max_version']) + { + $message=get_lang('HasReachedMaxiNumVersions'); + Display::display_warning_message($message); + if(!api_is_allowed_to_edit()) + { + exit; + } + } + + // + if (!empty($row['max_text']) && $row['max_text']>=word_count($row['content'])) + { + $message=get_lang('HasReachedMaxNumWords'); + Display::display_warning_message($message); + if(!api_is_allowed_to_edit()) + { + exit; + } + + } + + //// + if (!empty($row['task'])) + { + $message_task=''.get_lang('DescriptionOfTheTask').'

    '.$row['task'].'


    '; + $message_task.='

    '.get_lang('StartDate').': '.$row['startdate_assig'].'

    '; + $message_task.='

    '.get_lang('EndDate').': '.$row['enddate_assig']; + $message_task.=' ('.get_lang('AllowLaterSends').') '.$row['delayedsubmit'].'

    '; + $message_task.='

    '.get_lang('OtherRequirements').': '.get_lang('NMaxVersion').': '.$row['max_version']; + $message_task.=' '.get_lang('NMaxWords').': '.$row['max_text']; + + Display::display_normal_message($message_task); + } + + if($row['progress']==$row['fprogress1'] && !empty($row['fprogress1'])) + { + $feedback_message=''.get_lang('Feedback').'

    '.$row['feedback1'].'

    '; + Display::display_normal_message($feedback_message); + } + elseif($row['progress']==$row['fprogress2'] && !empty($row['fprogress2'])) + { + $feedback_message=''.get_lang('Feedback').'

    '.$row['feedback2'].'

    '; + Display::display_normal_message($feedback_message); + } + elseif($row['progress']==$row['fprogress3'] && !empty($row['fprogress3'])) + { + $feedback_message=''.get_lang('Feedback').'

    '.$row['feedback3'].'

    '; + Display::display_normal_message($feedback_message); + } + + //previous checking for concurrent editions if($row['is_editing']==0) { Display::display_normal_message(get_lang('WarningMaxEditingTime')); @@ -1329,7 +1399,7 @@ if ($_GET['action']=='edit') } elseif($row['is_editing']!=$_user['user_id']) { - $timestamp_edit=convert_date_to_number($row['time_edit']); + $timestamp_edit=strtotime($row['time_edit']); $time_editing=time()-$timestamp_edit; $max_edit_time=1200; // 20 minutes $rest_time=$max_edit_time-$time_editing; @@ -1339,12 +1409,155 @@ if ($_GET['action']=='edit') $is_being_edited= get_lang('ThisPageisBeginEditedBy').' '.$userinfo['lastname'].', '.$userinfo['firstname'].'. '.get_lang('ThisPageisBeginEditedTryLater').' '.date( "i",$rest_time).' '.get_lang('MinMinutes').''; Display::display_normal_message($is_being_edited); exit; - } - - echo '
    '; - echo $icon_assignment.'   '.$title.'
    '; - echo '
    '; + } + //form echo ''; + echo '
    '; + echo $icon_assignment.'   '.$title; + // + + if((api_is_allowed_to_edit() || api_is_platform_admin()) && $_SESSION['_gid']!=0) + { + + echo' '.Display::return_icon('div_show.gif',get_lang('Show')).' '.get_lang('AdvancedParameters').''; + + echo '
    '.$tool_name.''.$row['number_of_options'].''; - echo ' '.Display::return_icon('edit.gif', get_lang('Edit')).''; - echo ' '.Display::return_icon('delete.gif', get_lang('Delete')).''; + echo ' '.Display::return_icon('edit.gif', get_lang('Edit')).''; + echo ' '.Display::return_icon('delete.gif', get_lang('Delete')).''; if ($question_counter > 1) { - echo ' '.Display::return_icon('up.gif', get_lang('MoveUp')).''; + echo ' '.Display::return_icon('up.gif', get_lang('MoveUp')).''; } else { Display::display_icon('up_na.gif'); } if ($question_counter < $question_counter_max) { - echo ' '.Display::return_icon('down.gif', get_lang('MoveDown')).''; + echo ' '.Display::return_icon('down.gif', get_lang('MoveDown')).''; } else { Display::display_icon('down_na.gif'); } @@ -271,16 +253,16 @@ if($is_survey_type_1) echo '
    '.get_lang('Name').''.get_lang('Description').'
    '; - echo '
    '; + echo ''; if($_GET['action']=='editgroup') { - $sql = 'SELECT name,description FROM '.$table_survey_question_group.' WHERE id = '.Database::escape_string($_GET['gid']).' AND survey_id = '.Database::escape_string($_GET['survey_id']).' limit 1'; + $sql = 'SELECT name,description FROM '.$table_survey_question_group.' WHERE id = '.Database::escape_string($_GET['gid']).' AND survey_id = '.Database::escape_string($survey_id).' limit 1'; $rs = api_sql_query($sql,__FILE__,__LINE__); $editedrow = Database::fetch_array($rs,'ASSOC'); echo ''; echo ''; echo ''; - echo ''; + echo ''; } else { echo ''; echo ''; @@ -295,14 +277,14 @@ if($is_survey_type_1) echo '
    '.get_lang('Modify').'
    '.$row['name'].''.$row['description'].''. - ''. + ''. Display::return_icon('edit.gif', get_lang('Edit')).' '. - ''. + ''. Display::return_icon('delete.gif', get_lang('Delete')).''. '
    '; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + echo '
    '.get_lang('DescriptionOfTheTask').'
    '; + echo '
    '; + + //feedback + echo '
     
     '.get_lang('AddFeedback').''; + echo '   '; + echo ''; + + //time limit + echo '
     
     '.get_lang('PutATimeLimit').''; + echo '   '; + echo ''; + + //other limit + echo '
     
     '.get_lang('OtherSettings').''; + echo '   '; + echo ''; + + // + echo '
    '; + } + + echo ''; + echo '
    '; + echo ''; echo ''; echo ''; @@ -1354,19 +1567,19 @@ if ($_GET['action']=='edit') : array('ToolbarSet' => 'WikiStudent', 'Width' => '100%', 'Height' => '400', 'UserStatus' => 'student') ); echo '
    '; - echo '
    '; + echo '
    '; //if(api_is_allowed_to_edit() || api_is_platform_admin()) //off for now //{ - echo get_lang('Comments').':     '; - //} - + echo get_lang('Comments').':     '; + //} echo ''; - //echo ''; //off for now - //echo ''; //off for now - //echo ''; //off for now - - echo ''; //get current version - + echo ''; + + //hack date for edit + echo ''; + echo ''; + + // echo get_lang('Progress').':  ';//prevent double post echo ''; //for save icon echo '';//for save button - echo ''; - echo '
    '; + echo ''; + echo ''; } } } diff --git a/main/wiki/wiki.inc.php b/main/wiki/wiki.inc.php index 34675e77e8..a9d6d92e7b 100644 --- a/main/wiki/wiki.inc.php +++ b/main/wiki/wiki.inc.php @@ -314,16 +314,46 @@ function save_wiki() { } //cleaning config variables - - $_clean['feedback1']=Database::escape_string(Security::remove_XSS($_POST['feedback1'])); - $_clean['feedback2']=Database::escape_string(Security::remove_XSS($_POST['feedback2'])); - $_clean['feedback3']=Database::escape_string(Security::remove_XSS($_POST['feedback3'])); - $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); - $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); - $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS($_POST['startdate_assig'])); - $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS($_POST['enddate_assig'])); - $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); + + if(!empty($_POST['task'])) + { + $_clean['task']=Database::escape_string(Security::remove_XSS($_POST['task'])); + } + if(!empty($_POST['feedback1']) || !empty($_POST['feedback2']) || !empty($_POST['feedback3'])) + { + $_clean['feedback1']=Database::escape_string(Security::remove_XSS($_POST['feedback1'])); + $_clean['feedback2']=Database::escape_string(Security::remove_XSS($_POST['feedback2'])); + $_clean['feedback3']=Database::escape_string(Security::remove_XSS($_POST['feedback3'])); + $_clean['fprogress1']=Database::escape_string(Security::remove_XSS($_POST['fprogress1'])); + $_clean['fprogress2']=Database::escape_string(Security::remove_XSS($_POST['fprogress2'])); + $_clean['fprogress3']=Database::escape_string(Security::remove_XSS($_POST['fprogress3'])); + } + + if(Security::remove_XSS($_POST['initstartdate']==1)) + { + $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('startdate_assig'))); + } + else + { + $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS($_POST['startdate_assig'])); + } + + if(Security::remove_XSS($_POST['initenddate']==1)) + { + $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('enddate_assig'))); + } + else + { + $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS($_POST['enddate_assig'])); + } + + $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); + if(!empty($_POST['max_text']) || !empty($_POST['max_version'])) + { + $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); + $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); + } $sql="INSERT INTO ".$tbl_wiki." (page_id, reflink, title, content, user_id, group_id, dtime, assignment, comment, progress, version, linksto, user_ip) VALUES ('".$_clean['page_id']."','".$_clean['reflink']."','".$_clean['title']."','".$_clean['content']."','".$_clean['user_id']."','".$_clean['group_id']."','".$dtime."','".$_clean['assignment']."','".$_clean['comment']."','".$_clean['progress']."','".$_clean['version']."','".$_clean['linksto']."','".Database::escape_string($_SERVER['REMOTE_ADDR'])."')"; @@ -332,12 +362,20 @@ function save_wiki() { if ($_clean['page_id'] ==0) { - $sql='UPDATE '.$tbl_wiki.' SET page_id="'.$Id.'" WHERE id="'.$Id.'"'; + $sql='UPDATE '.$tbl_wiki.' SET page_id="'.$Id.'" WHERE id="'.$Id.'"'; api_sql_query($sql,__FILE__,__LINE__); } //update wiki config - $sql='UPDATE'.$tbl_wiki.' SET page_id="'.$Id.'", feedback1="'.$_clean['feedback1'].'", feedback2="'.$_clean['feedback2'].'", feedback3="'.$_clean['feedback3'].'", max_text="'.$_clean['max_text'].'", max_version="'.$_clean['max_version'].'", startdate_assig="'.$_clean['startdate_assig'].'", enddate_assig="'.$_clean['enddate_assig'].'", delayedsubmit="'.$_clean['delayedsubmit'].'" WHERE id="'.$Id.'"'; + + if ($_clean['reflink']=='index' && $_clean['version']==1) + { + $sql="INSERT INTO ".$tbl_wiki_conf." (page_id, task, feedback1, feedback2, feedback3, fprogress1, fprogress2, fprogress3, max_text, max_version, startdate_assig, enddate_assig, delayedsubmit) VALUES ('".$Id."','".$_clean['task']."','".$_clean['feedback1']."','".$_clean['feedback2']."','".$_clean['feedback3']."','".$_clean['fprogress1']."','".$_clean['fprogress2']."','".$_clean['fprogress3']."','".$_clean['max_text']."','".$_clean['max_version']."','".$_clean['startdate_assig']."','".$_clean['enddate_assig']."','".$_clean['delayedsubmit']."')"; + } + else + { + $sql='UPDATE'.$tbl_wiki_conf.' SET task="'.$_clean['task'].'", feedback1="'.$_clean['feedback1'].'", feedback2="'.$_clean['feedback2'].'", feedback3="'.$_clean['feedback3'].'", fprogress1="'.$_clean['fprogress1'].'", fprogress2="'.$_clean['fprogress2'].'", fprogress3="'.$_clean['fprogress3'].'", max_text="'.$_clean['max_text'].'", max_version="'.$_clean['max_version'].'", startdate_assig="'.$_clean['startdate_assig'].'", enddate_assig="'.$_clean['enddate_assig'].'", delayedsubmit="'.$_clean['delayedsubmit'].'" WHERE page_id="'.$_clean['page_id'].'"'; + } api_sql_query($sql,__FILE__,__LINE__); api_item_property_update($_course, 'wiki', $Id, 'WikiAdded', api_get_user_id(), $_clean['group_id']); @@ -454,19 +492,37 @@ function save_new_wiki() { $_clean['linksto'] = links_to($_clean['content']); //check wikilinks - //cleaning config variables + //cleaning config variables + $_clean['task']=Database::escape_string(Security::remove_XSS($_POST['task'])); $_clean['feedback1']=Database::escape_string(Security::remove_XSS($_POST['feedback1'])); $_clean['feedback2']=Database::escape_string(Security::remove_XSS($_POST['feedback2'])); $_clean['feedback3']=Database::escape_string(Security::remove_XSS($_POST['feedback3'])); $_clean['fprogress1']=Database::escape_string(Security::remove_XSS($_POST['fprogress1'])); $_clean['fprogress2']=Database::escape_string(Security::remove_XSS($_POST['fprogress2'])); $_clean['fprogress3']=Database::escape_string(Security::remove_XSS($_POST['fprogress3'])); - $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); - $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); - $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('startdate_assig'))); - $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('enddate_assig'))); - $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); + + if(Security::remove_XSS($_POST['initstartdate']==1)) + { + $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('startdate_assig'))); + } + else + { + $_clean['startdate_assig']=Database::escape_string(Security::remove_XSS($_POST['startdate_assig'])); + } + + if(Security::remove_XSS($_POST['initenddate']==1)) + { + $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS(get_date_from_select('enddate_assig'))); + } + else + { + $_clean['enddate_assig']=Database::escape_string(Security::remove_XSS($_POST['enddate_assig'])); + } + $_clean['delayedsubmit']=Database::escape_string(Security::remove_XSS($_POST['delayedsubmit'])); + $_clean['max_text']=Database::escape_string(Security::remove_XSS($_POST['max_text'])); + $_clean['max_version']=Database::escape_string(Security::remove_XSS($_POST['max_version'])); + //filter no _uass if (api_eregi('_uass', $_POST['title']) || (api_strtoupper(trim($_POST['title'])) == 'INDEX' || api_strtoupper(trim(api_htmlentities($_POST['title'], ENT_QUOTES, $charset))) == api_strtoupper(api_htmlentities(get_lang('DefaultTitle'), ENT_QUOTES, $charset)))) { $message= get_lang('GoAndEditMainPage'); @@ -488,7 +544,7 @@ function save_new_wiki() { api_sql_query($sql,__FILE__,__LINE__); //insert wiki config - $sql="INSERT INTO ".$tbl_wiki_conf." (page_id, feedback1, feedback2, feedback3, fprogress1, fprogress2, fprogress3, max_text, max_version, startdate_assig, enddate_assig, delayedsubmit) VALUES ('".$Id."','".$_clean['feedback1']."','".$_clean['feedback2']."','".$_clean['feedback3']."','".$_clean['fprogress1']."','".$_clean['fprogress2']."','".$_clean['fprogress3']."','".$_clean['max_text']."','".$_clean['max_version']."','".$_clean['startdate_assig']."','".$_clean['enddate_assig']."','".$_clean['delayedsubmit']."')"; + $sql="INSERT INTO ".$tbl_wiki_conf." (page_id, task, feedback1, feedback2, feedback3, fprogress1, fprogress2, fprogress3, max_text, max_version, startdate_assig, enddate_assig, delayedsubmit) VALUES ('".$Id."','".$_clean['task']."','".$_clean['feedback1']."','".$_clean['feedback2']."','".$_clean['feedback3']."','".$_clean['fprogress1']."','".$_clean['fprogress2']."','".$_clean['fprogress3']."','".$_clean['max_text']."','".$_clean['max_version']."','".$_clean['startdate_assig']."','".$_clean['enddate_assig']."','".$_clean['delayedsubmit']."')"; api_sql_query($sql,__LINE__,__FILE__); api_item_property_update($_course, 'wiki', $Id, 'WikiAdded', api_get_user_id(), $_clean['group_id']); @@ -522,7 +578,7 @@ return true; } '; echo '
    '; echo '* '.get_lang(Title).': '; @@ -531,25 +587,31 @@ return true; { $_clean['group_id']=(int)$_SESSION['_gid']; // TODO: check if delete ? - - // echo' '.Display::return_icon('div_show.gif',get_lang('Show')).' '.get_lang('AdvancedParameters').''; // TODO: under develop, uncoment and activate later + + echo' '.Display::return_icon('div_show.gif',get_lang('Show')).' '.get_lang('AdvancedParameters').''; echo ''; echo '
    '; @@ -661,6 +745,7 @@ function display_wiki_entry() { global $charset; global $tbl_wiki; + global $tbl_wiki_conf; global $groupfilter; global $page; @@ -669,7 +754,8 @@ function display_wiki_entry() if ($_GET['view']) { $_clean['view']=(int)Database::escape_string($_GET['view']); - $filter=" AND id='".$_clean['view']."'"; + + $filter=' AND '.$tbl_wiki.'.id="'.$_clean['view'].'"'; } //first, check page visibility in the first page version @@ -679,9 +765,9 @@ function display_wiki_entry() $KeyVisibility=$row['visibility']; // second, show the last version - $sql="SELECT * FROM ".$tbl_wiki."WHERE reflink='".html_entity_decode(Database::escape_string(stripslashes(urldecode($page))))."' AND $groupfilter $filter ORDER BY id DESC"; - $result=api_sql_query($sql,__LINE__,__FILE__); - $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version + $sql='SELECT * FROM '.$tbl_wiki.', '.$tbl_wiki_conf.' WHERE '.$tbl_wiki_conf.'.page_id='.$tbl_wiki.'.page_id AND '.$tbl_wiki.'.reflink="'.html_entity_decode(Database::escape_string(stripslashes(urldecode($page)))).'" AND '.$tbl_wiki.'.'.$groupfilter.' '.$filter.' ORDER BY id DESC'; + $result=api_sql_query($sql,__LINE__,__FILE__); + $row=Database::fetch_array($result); // we do not need a while loop since we are always displaying the last version //update visits @@ -712,7 +798,7 @@ function display_wiki_entry() } - //assignment mode: for identify page type + //assignment mode: identify page type if(stripslashes($row['assignment'])==1) { $icon_assignment=''.get_lang('AssignmentDescExtra').''; @@ -721,8 +807,13 @@ function display_wiki_entry() { $icon_assignment=''.get_lang('AssignmentWorkExtra').''; } - - + + //task mode + + if (!empty($row['task'])) + { + $icon_task=''.get_lang('TaskExtra').''; + } //Show page. Show page to all users if isn't hide page. Mode assignments: if student is the author, can view if($KeyVisibility=="1" || api_is_allowed_to_edit() || api_is_platform_admin() || ($row['assignment']==2 && $KeyVisibility=="0" && (api_get_user_id()==$row['user_id']))) @@ -833,7 +924,7 @@ function display_wiki_entry() if (wiki_exist($title)) { - echo $icon_assignment.'   '.stripslashes($title); + echo $icon_assignment.' '.$icon_task.' '.stripslashes($title); } else { @@ -1723,17 +1814,6 @@ function double_post($wpost_id) } } -/** - * Function convert date to number - * 2008-10-12 00:00:00 ---to--> 12345672218 (timestamp) - */ -function convert_date_to_number($default) -{ - $parts = split(' ',$default); - list($d_year,$d_month,$d_day) = split('-',$parts[0]); - list($d_hour,$d_minute,$d_second) = split(':',$parts[1]); - return mktime($d_hour, $d_minute, $d_second, $d_month, $d_day, $d_year); -} /** * Function wizard individual assignment @@ -1980,7 +2060,7 @@ function display_wiki_search_results($search_term, $search_content=0) * */ function draw_date_picker($prefix,$default='') { - //$default = 2008-10-01 10:00:00 + if(empty($default)) { $default = date('Y-m-d H:i:s'); } @@ -2007,7 +2087,7 @@ function draw_date_picker($prefix,$default='') { array_unshift($minute,'00','01','02','03','04','05','06','07','08','09'); $date_form = make_select($prefix.'_day', array_combine(range(1,31),range(1,31)), $d_day); $date_form .= make_select($prefix.'_month', $month_list, $d_month); - $date_form .= make_select($prefix.'_year', array( $d_year=> $d_year, $d_year+1=>$d_year+1), $d_year).'    '; + $date_form .= make_select($prefix.'_year', array($d_year-2=>$d_year-2, $d_year-1=>$d_year-1, $d_year=> $d_year, $d_year+1=>$d_year+1, $d_year+2=>$d_year+2), $d_year).'    '; $date_form .= make_select($prefix.'_hour', array_combine(range(0,23),range(0,23)), $d_hour).' : '; $date_form .= make_select($prefix.'_minute', $minute, $d_minute); return $date_form; @@ -2026,14 +2106,6 @@ function make_select($name,$values,$checked='') { return $output; } -/** - * Enter description here... - * - */ -function make_checkbox($name,$checked='') { - return '' . - ''; -} /** * Enter description here... @@ -2051,4 +2123,5 @@ function two_digits($number) $number = (int)$number; return ($number < 10) ? '0'.$number : $number; } + ?> \ No newline at end of file diff --git a/whoisonline.php b/whoisonline.php old mode 100644 new mode 100755 index eb5331f5cb..2673992291 --- a/whoisonline.php +++ b/whoisonline.php @@ -146,7 +146,7 @@ function display_user_list($user_list, $_plugins) $user_info = api_get_user_info($uid); $table_row = array(); $url = '?id='.$uid.$course_url; - $image_array=UserManager::get_user_picture_path_by_id($uid,'web',false,true); + $image_array=UserManager::get_user_picture_path_by_id($uid,'system',false,true); $friends_profile = UserFriend::get_picture_user($uid, $image_array['file'], 92, 'medium_', ' width="90" height="90" '); //reduce image