Index: trunk/admin/config/edit_label.php =================================================================== diff -u -r374 -r517 --- trunk/admin/config/edit_label.php (.../edit_label.php) (revision 374) +++ trunk/admin/config/edit_label.php (.../edit_label.php) (revision 517) @@ -5,70 +5,70 @@ ## In-portal ## ## Intechnic Corporation ## ## All Rights Reserved, 1998-2002 ## -## ## -## No portion of this code may be copied, reproduced or ## +## ## +## No portion of this code may be copied, reproduced or ## ## otherwise redistributed without proper written ## ## consent of Intechnic Corporation. Violation will ## ## result in revocation of the license and support ## ## privileges along maximum prosecution allowed by law. ## ############################################################## if(!strlen($pathtoroot)) { - $path=dirname(realpath(__FILE__)); - if(strlen($path)) - { - /* determine the OS type for path parsing */ - $pos = strpos($path,":"); - if ($pos === false) - { - $gOS_TYPE="unix"; - $pathchar = "/"; - } - else - { - $gOS_TYPE="win"; - $pathchar="\\"; - } - $p = $path.$pathchar; - /*Start looking for the root flag file */ - while(!strlen($pathtoroot) && strlen($p)) - { - $sub = substr($p,strlen($pathchar)*-1); - if($sub==$pathchar) - { - $filename = $p."root.flg"; - } - else - $filename = $p.$pathchar."root.flg"; - if(file_exists($filename)) - { - $pathtoroot = $p; - } - else - { - $parent = realpath($p.$pathchar."..".$pathchar); - if($parent!=$p) + $path=dirname(realpath(__FILE__)); + if(strlen($path)) { - $p = $parent; + /* determine the OS type for path parsing */ + $pos = strpos($path,":"); + if ($pos === false) + { + $gOS_TYPE="unix"; + $pathchar = "/"; + } + else + { + $gOS_TYPE="win"; + $pathchar="\\"; + } + $p = $path.$pathchar; + /*Start looking for the root flag file */ + while(!strlen($pathtoroot) && strlen($p)) + { + $sub = substr($p,strlen($pathchar)*-1); + if($sub==$pathchar) + { + $filename = $p."root.flg"; + } + else + $filename = $p.$pathchar."root.flg"; + if(file_exists($filename)) + { + $pathtoroot = $p; + } + else + { + $parent = realpath($p.$pathchar."..".$pathchar); + if($parent!=$p) + { + $p = $parent; + } + else + $p = ""; + } + } + if(!strlen($pathtoroot)) + $pathtoroot = ".".$pathchar; } else - $p = ""; - } - } - if(!strlen($pathtoroot)) - $pathtoroot = ".".$pathchar; - } - else - { - $pathtoroot = ".".$pathchar; - } + { + $pathtoroot = ".".$pathchar; + } } $sub = substr($pathtoroot,strlen($pathchar)*-1); if($sub!=$pathchar) { - $pathtoroot = $pathtoroot.$pathchar; + $pathtoroot = $pathtoroot.$pathchar; } //echo $pathtoroot; @@ -77,51 +77,58 @@ $rootURL="http://".ThisDomain().$objConfig->Get("Site_Path"); $admin = $objConfig->Get("AdminDirectory"); if(!strlen($admin)) - $admin = "admin"; +$admin = "admin"; $localURL=$rootURL."kernel/"; $adminURL = $rootURL.$admin; -$imagesURL = $adminURL."/images"; +$imagesURL = $adminURL."/images"; -require_once ($pathtoroot.$admin."/include/elements.php"); -require_once ($pathtoroot."kernel/admin/include/navmenu.php"); +require_once ($pathtoroot.$admin."/include/elements.php"); +require_once ($pathtoroot."kernel/admin/include/navmenu.php"); require_once($pathtoroot.$admin."/toolbar.php"); require_once($pathtoroot.$admin."/listview/listview.php"); if(count($_POST)>0 && !$_GET['PhraseId'] && $add_error == '') { echo ""; die(); } $section = "in-portal:phrase_editor"; -$ids = $_GET["PhraseId"]; +$ids = GetVar('PhraseId'); if(strlen($ids)) { - $ids = str_replace("[","",$ids); - $ids = str_replace("]","",$ids); - $ids = str_replace("\"","",$ids); - $ids = str_replace("\\","",$ids); - $PhraseIds = explode(",",$ids); + $ids = str_replace("[","",$ids); + $ids = str_replace("]","",$ids); + $ids = str_replace("\"","",$ids); + $ids = str_replace("\\","",$ids); + $PhraseIds = explode(",",$ids); + $LangId = 0; } else { - $LangId = $_GET["LanguageId"]; + $LangId = GetVar('LanguageId'); + $PhraseIds = Array(); } -$EditDirect = (int)$_GET["direct"]; +$EditDirect = (int)GetVar('direct'); if($EditDirect) { - $NewLabel = $_GET["label"]; - if(!$LangId) - { - $LangId = $objSession->Get("Language"); - } + $NewLabel = GetVar('label'); + if(!$LangId) + { + $LangId = $objSession->Get("Language"); + } + SetVar( 'name', Array($NewLabel) ); } +else +{ + $NewLabel = ''; +} unset($objEditItems); @@ -131,29 +138,24 @@ else { $ado = GetADODBConnection(); $sql = "SELECT PhraseId FROM ".$objSession->GetEditTable("Phrase"); - + if ($LangId) { $sql .= " WHERE LanguageId = $LangId"; } - + $rs = $ado->Execute($sql); - - if (!$_GET['en']) { - $selected_id = $PhraseIds[0]; - } - else { - $selected_id = $_GET['PhraseId']; - } - + + $selected_id = !GetVar('en') ? $PhraseIds[0] : $_GET['PhraseId']; + $PhraseIdList = ''; while ($rs && !$rs->EOF) { $PhraseIdList .= $rs->fields['PhraseId'].","; $rs->MoveNext(); } - - $PhraseIdList = substr($PhraseIdList, 0, strlen($PhraseIdList)); + + $PhraseIdList = substr($PhraseIdList, 0, strlen($PhraseIdList)); $PhraseIdArr = explode(",", $PhraseIdList); - + $print_list = false; } @@ -166,22 +168,22 @@ $objListToolBar->Set("section",$section); $objListToolBar->Set("load_menu_func",""); $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"); +"swap('cancel', 'toolbar/tool_stop.gif');","window.close();","tool_stop.gif"); if (!$print_list) { $x = -1; foreach ($PhraseIdArr as $key => $value) { if ($value == $selected_id) { $x = $key; } - } + } if ($x <= 0) { $en_next = $PhraseIdArr[$x+1]; @@ -195,11 +197,11 @@ $en_next = $PhraseIdArr[$x+1]; $en_prev = $PhraseIdArr[$x-1]; } - - - $url = "edit_label.php?$envar&en=0"; + + + $url = "edit_label.php?$envar&en=0"; $form = "frmPhrase"; - MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,1,$url, "LangSubmitMove"); + MultiEditButtons($objListToolBar,$en_next,$en_prev,$form,1,$url, "LangSubmitMove"); } $title = admin_language("la_Text_Editing")." ".admin_language("la_Text_Label"); @@ -209,13 +211,15 @@
" method=POST> SourceTable = $objSession->GetEditTable("Phrase"); - +{ + $objPhraseList->SourceTable = $objSession->GetEditTable("Phrase"); +} $count_ids = 1; if ($print_list) { @@ -231,75 +235,80 @@ 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 != '' || $count_ids > 1)) - { - echo int_subsection_title_ret(admin_language("la_tab_General").": ".GetPrimaryTranslation($p->Get("Phrase"))); - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n"; + $p = $objPhraseList->GetItem($PhraseIds[$x]); - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n"; + //echo "
"; print_r($p); echo "
"; - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "\n"; + 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"))); + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n"; - echo "\n"; - echo " \n"; - echo " \n"; - echo "\n"; - unset($p); - } + 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"; + echo "\n"; + unset($p); + } } ?> 0) - { - "::".$PriTrans = GetPrimaryTranslation($NewLabel); - } +if(strlen($NewLabel)>0) +{ + "::".$PriTrans = GetPrimaryTranslation($NewLabel); +} +else +{ + $PriTrans = ''; +} + ?> - - + + > - + > - + @@ -315,7 +324,7 @@ - +
".admin_language("la_prompt_PhraseId")."".$p->Get("PhraseId")."
".admin_language("la_prompt_Label")."Get("PhraseId")."]\" VALUE=\"".$p->Get("Phrase")."\">
".admin_language("la_prompt_Value")."Get("PhraseId")."]\" VALUE=\"".$p->Get("Translation")."\">
".admin_language("la_prompt_PhraseId")."".$p->Get("PhraseId")."
".admin_language("la_prompt_PhraseType")."\n"; - echo " Get("PhraseId")."]\" VALUE=\"0\""; - if($p->Get("PhraseType")==0) - echo "CHECKED"; - echo ">"; - echo admin_language("la_Text_Front"); - echo " Get("PhraseId")."]\" VALUE=\"1\""; - if($p->Get("PhraseType")==1) - echo "CHECKED"; - echo ">"; - echo admin_language("la_Text_Admin"); - echo " Get("PhraseId")."]\" VALUE=\"2\""; - if($p->Get("PhraseType")==2) - echo "CHECKED"; - echo ">"; - echo admin_language("la_Text_Both"); - echo "
".admin_language("la_prompt_Label")."Get("PhraseId")."]\" VALUE=\"".$p->Get("Phrase")."\">
".admin_language("la_prompt_Value")."Get("PhraseId")."]\" VALUE=\"".$p->Get("Translation")."\">
".admin_language("la_prompt_PhraseType")."\n"; + echo " Get("PhraseId")."]\" VALUE=\"0\""; + if($p->Get("PhraseType")==0) + echo "CHECKED"; + echo ">"; + echo admin_language("la_Text_Front"); + echo " Get("PhraseId")."]\" VALUE=\"1\""; + if($p->Get("PhraseType")==1) + echo "CHECKED"; + echo ">"; + echo admin_language("la_Text_Admin"); + echo " Get("PhraseId")."]\" VALUE=\"2\""; + if($p->Get("PhraseType")==2) + echo "CHECKED"; + echo ">"; + echo admin_language("la_Text_Both"); + echo "