Index: trunk/admin/config/edit_label.php =================================================================== diff -u -r38 -r105 --- trunk/admin/config/edit_label.php (.../edit_label.php) (revision 38) +++ trunk/admin/config/edit_label.php (.../edit_label.php) (revision 105) @@ -97,28 +97,26 @@ } $section = "in-portal:phrase_editor"; -$ids = GetVar('PhraseId'); +$ids = $_GET["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 = GetVar('direct'); +$EditDirect = (int)$_GET["direct"]; if($EditDirect) { - $NewLabel = GetVar('label'); + $NewLabel = $_GET["label"]; if(!$LangId) { $LangId = $objSession->Get("Language"); @@ -127,24 +125,24 @@ unset($objEditItems); -if ( isset($PhraseIds) && count($PhraseIds) > 1) { +if (count($PhraseIds) > 1) { $print_list = true; } else { $ado = GetADODBConnection(); $sql = "SELECT PhraseId FROM ".$objSession->GetEditTable("Phrase"); - if ( isset($LangId) && $LangId > 0 ) { + if ($LangId) { $sql .= " WHERE LanguageId = $LangId"; } $rs = $ado->Execute($sql); - if ( GetVar('en') === false ) { + if (!$_GET['en']) { $selected_id = $PhraseIds[0]; } else { - $selected_id = GetVar('PhraseId'); + $selected_id = $_GET['PhraseId']; } $PhraseIdList = ''; @@ -170,7 +168,9 @@ $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,15 +209,17 @@
" method=POST> SourceTable = $objSession->GetEditTable("Phrase"); +if(!is_object($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) { @@ -227,22 +229,23 @@ } } -for($x = 0; $x < $count_ids; $x++) +for($x=0;$x<$count_ids;$x++) { $p = $objPhraseList->GetItem($PhraseIds[$x]); - if( !isset($LangId) ) $LangId = $p->Get("LanguageId"); - if(is_object($p) && isset($selected_id) ) + //echo "
"; print_r($p); echo "
"; + + if(!$LangId) + $LangId = $p->Get("LanguageId"); + if(is_object($p) && ($selected_id != '' || $count_ids > 1)) { echo int_subsection_title_ret(admin_language("la_tab_General").": ".GetPrimaryTranslation($p->Get("Phrase"))); - if($p->Get('PhraseId') > 0) - { - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n"; - } + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; + echo "\n"; echo " \n"; echo " \n"; @@ -278,10 +281,14 @@ unset($p); } } -$PriTrans = isset($NewLabel) ? GetPrimaryTranslation($NewLabel) : ''; ?> - - +0) + { + "::".$PriTrans = GetPrimaryTranslation($NewLabel); + } +?> + > @@ -308,10 +315,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")."\">