Index: trunk/admin/config/edit_label.php =================================================================== diff -u -r13 -r38 --- trunk/admin/config/edit_label.php (.../edit_label.php) (revision 13) +++ trunk/admin/config/edit_label.php (.../edit_label.php) (revision 38) @@ -97,26 +97,28 @@ } $section = "in-portal:phrase_editor"; -$ids = $_GET["PhraseId"]; +$ids = GetVar('PhraseId'); -if(strlen($ids)) +if( strlen($ids) ) { + // useless code: begin $ids = str_replace("[","",$ids); $ids = str_replace("]","",$ids); $ids = str_replace("\"","",$ids); $ids = str_replace("\\","",$ids); + // useless code: end $PhraseIds = explode(",",$ids); } else { $LangId = $_GET["LanguageId"]; } -$EditDirect = (int)$_GET["direct"]; +$EditDirect = GetVar('direct'); if($EditDirect) { - $NewLabel = $_GET["label"]; + $NewLabel = GetVar('label'); if(!$LangId) { $LangId = $objSession->Get("Language"); @@ -125,24 +127,24 @@ unset($objEditItems); -if (count($PhraseIds) > 1) { +if ( isset($PhraseIds) && count($PhraseIds) > 1) { $print_list = true; } else { $ado = GetADODBConnection(); $sql = "SELECT PhraseId FROM ".$objSession->GetEditTable("Phrase"); - if ($LangId) { + if ( isset($LangId) && $LangId > 0 ) { $sql .= " WHERE LanguageId = $LangId"; } $rs = $ado->Execute($sql); - if (!$_GET['en']) { + if ( GetVar('en') === false ) { $selected_id = $PhraseIds[0]; } else { - $selected_id = $_GET['PhraseId']; + $selected_id = GetVar('PhraseId'); } $PhraseIdList = ''; @@ -168,9 +170,7 @@ $objListToolBar->Set("CheckClass","ThemeChecks"); $objListToolBar->Add("select", "la_ToolTip_Select","#","swap('select','toolbar/tool_select_f2.gif');", - "swap('select', 'toolbar/tool_select.gif');", - "LangSubmit();", - "tool_select.gif"); + "swap('select', 'toolbar/tool_select.gif');", "LangSubmit();", "tool_select.gif"); $objListToolBar->Add("cancel", "la_ToolTip_Stop","#","swap('cancel','toolbar/tool_stop_f2.gif');", "swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif"); @@ -209,17 +209,15 @@
" method=POST> SourceTable = $objSession->GetEditTable("Phrase"); +if( !isset($objPhraseList) ) $objPhraseList = new clsPhraseList(); + +if(!$EditDirect) $objPhraseList->SourceTable = $objSession->GetEditTable("Phrase"); $count_ids = 1; if ($print_list) { $count_ids = count($PhraseIds); + $selected_id = $PhraseIds[0]; } else { foreach($PhraseIdArr as $key => $value) { @@ -229,23 +227,22 @@ } } -for($x=0;$x<$count_ids;$x++) +for($x = 0; $x < $count_ids; $x++) { $p = $objPhraseList->GetItem($PhraseIds[$x]); - //echo "
"; print_r($p); echo "
"; - - if(!$LangId) - $LangId = $p->Get("LanguageId"); - if(is_object($p) && $selected_id != '') + if( !isset($LangId) ) $LangId = $p->Get("LanguageId"); + if(is_object($p) && isset($selected_id) ) { echo int_subsection_title_ret(admin_language("la_tab_General").": ".GetPrimaryTranslation($p->Get("Phrase"))); - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n"; - + if($p->Get('PhraseId') > 0) + { + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; + } echo "\n"; echo " \n"; echo " \n"; @@ -281,14 +278,10 @@ unset($p); } } +$PriTrans = isset($NewLabel) ? GetPrimaryTranslation($NewLabel) : ''; ?> -0) - { - "::".$PriTrans = GetPrimaryTranslation($NewLabel); - } -?> - + + > @@ -315,10 +308,10 @@ - + - + Index: trunk/kernel/admin/include/toolbar/phrase_editor.php =================================================================== diff -u -r13 -r38 --- trunk/kernel/admin/include/toolbar/phrase_editor.php (.../phrase_editor.php) (revision 13) +++ trunk/kernel/admin/include/toolbar/phrase_editor.php (.../phrase_editor.php) (revision 38) @@ -2,7 +2,7 @@ global $rootURL,$objConfig, $adminURL; $destform = $_GET["destform"]; - +if( !isset($errormsg) ) $errormsg = ''; print << @@ -41,53 +41,6 @@ } } -/*function LangSubmitMove(status_field, targetURL, save_value,env_str) -{ - // by Alex, submits form. - - var full_env = env; - if(env_str != null) full_env += env_str; - if(full_env.substr(0,3)!="env") - full_env = 'env='+full_env; - - - f = document.getElementById('frmPhrase'); - - if(f) - { - var valid = false; - if(save_value != 2 && save_value !=-1) - { - valid = DataIsValid(f); - } - else - { - var a = f.Action; - if(a) - { - a.value=''; - } - } - if(valid || save_value==2 || save_value==-1) - { - f.action = rootURL + targetURL + '?' + full_env; - if(status_field.length>0) - { - f.elements[status_field].value = save_value; //0= stay in temp, 1=save to perm, 2 = purge no save - } - - f.submit(); - } - else - if(!valid) - alert(ErrorMsg); - - } - else - alert('Form '+formname+' was not found.'); -}*/ - - //--> Index: trunk/admin/include/elements.php =================================================================== diff -u -r36 -r38 --- trunk/admin/include/elements.php (.../elements.php) (revision 36) +++ trunk/admin/include/elements.php (.../elements.php) (revision 38) @@ -511,7 +511,7 @@ $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');"; $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');"; - $var="env=".BuildEnv()."&en=$prev&lpn=".$_REQUEST['lpn']; + $var="env=".BuildEnv()."&en=$prev&lpn=".GetVar('lpn'); if (strlen($ExtraVar)) $var.= $ExtraVar;
".admin_language("la_prompt_PhraseId")."".$p->Get("PhraseId")."
".admin_language("la_prompt_PhraseId")."".$p->Get("PhraseId")."
".admin_language("la_prompt_Label")."Get("PhraseId")."]\" VALUE=\"".$p->Get("Phrase")."\">