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 @@ - + - +
".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")."\">